def status(path): if path not in self.checkouts: raise ConfigurationError( u"Missing VCS repository definition for", path) repository = VCS(self.checkouts[path]) if not repository.status(): raise VCSError( u"Checkout directory has local modification " u"and is scheduled to be deleted", path) return repository
def do_update(self, args): """Update the current package to the latest version. """ if self.checkout is not None: vcs = VCS(self.checkout) if vcs.inspect(checkout=False, update=True): vcs.install() self.session.need_reconfigure() else: raise InstallationError( u"No repository is defined for the working environment.") return False
def preinstall(self): __status__ = u"Preparing installing VCS directories." if self.checkouts: VCS.initialize() create_directory(self.directory) update = self.status.strategy != STRATEGY_QUICK def prepare(checkout): repository = VCS(checkout) repository.inspect(update=update) return repository self.repositories.extend(self._do(prepare, self.checkouts.values()))
def prepare(self, context): __status__ = u"Preparing remote development sources." checkouts = list(self.get_checkouts()) if checkouts: VCS.initialize() create_directory(self.directory) sources = {} for checkout in checkouts: if self.enabled and checkout.name not in self.enabled: continue sources[keyify(checkout.name)] = VCS(checkout) return VCSQuery(context, sources) return None
def __init__(self, session): super(VCSCommand, self).__init__(session) __status__ = u"Initializing VCS checkout" setup = session.configuration['setup'] self.repository = None self.checkout = None if 'repository' in setup: VCS.initialize() option = setup['repository'] directory = setup['prefix_directory'].as_text() name = 'setup' if 'egginfo' in session.configuration: egginfo = session.configuration['egginfo'] if 'name' in egginfo: name = egginfo['name'] self.repository = option.as_words() self.checkout = VCSCheckout( name, option, self.repository, directory=directory)
def preuninstall(self): __status__ = u"Prepare to remove VCS directories." paths = self.status.installed_paths.as_list() if paths: VCS.initialize() def status(path): if path not in self.checkouts: raise ConfigurationError( u"Missing VCS repository definition for", path) repository = VCS(self.checkouts[path]) if not repository.status(): raise VCSError( u"Checkout directory has local modification " u"and is scheduled to be deleted", path) return repository self.repositories.extend(self._do(status, paths))
def prepare(checkout): repository = VCS(checkout) repository.inspect(update=update) return repository