def pull(self): repo = self.data if repo['tag'] != '': result = util.executeCommand("git checkout '{0}'".format(repo['tag']), cwd=repo['local']) else: result = util.executeCommand('git pull --ff-only', cwd=repo['local']) return result
def update(self, repo): if os.path.exists(repo['local']): self.pull(repo) else: self.clone(repo) if repo['post_update'] != '': util.executeCommand(repo['post_update'], cwd=repo['local'])
def cloneGit(self, repo): branch = repo['branch'] if repo['tag'] != '': branch = repo['tag'] if branch != '': result = util.executeCommand("git clone --branch '{2}' '{0}' '{1}'".format( repo['remote'], repo['local'], branch )) else: result = util.executeCommand("git clone '{0}' '{1}'".format(repo['remote'], repo['local']))
def statusGit(self, repo): if not util.isGitCheckout(repo): error = "{0} is a Git repo in config file but not a Git checkout on disk".format(repo['local']) terminal.error("\n" + error) dolly.Dolly.warnings.append(error) return result = util.executeCommand('git status -s', cwd=repo['local']) for line in result['stdout'].splitlines(): change = os.path.join(repo['local'], ' '.join(line.split()[1:])) dolly.Dolly.changes.append({'repo': repo, 'change': change}) result = util.executeCommand('git status -s -b', cwd=repo['local']) if result['stdout']: if 'ahead' in result['stdout']: dolly.Dolly.unpushed.append(repo)
def statusGit(self, repo): if not util.isGitCheckout(repo): error = "{0} is a Git repo in config file but not a Git checkout on disk".format( repo['local']) terminal.error("\n" + error) dolly.Dolly.warnings.append(error) return result = util.executeCommand('git status -s', cwd=repo['local']) for line in result['stdout'].splitlines(): change = os.path.join(repo['local'], ' '.join(line.split()[1:])) dolly.Dolly.changes.append({'repo': repo, 'change': change}) result = util.executeCommand('git status -s -b', cwd=repo['local']) if result['stdout']: if 'ahead' in result['stdout']: dolly.Dolly.unpushed.append(repo)
def clone(self): repo = self.data create_parent_directories(repo['local']) branch = repo['branch'] if repo['tag'] != '': branch = repo['tag'] if branch != '': result = util.executeCommand("git clone --branch '{2}' '{0}' '{1}'".format( repo['remote'], repo['local'], branch )) else: result = util.executeCommand("git clone '{0}' '{1}'".format(repo['remote'], repo['local'])) return result
def get_revision(self): repo = self.data result = util.executeCommand('svnversion', cwd=repo['local']) if result['returncode'] == 0: return result['stdout'] else: return None
def visit(self, host): pool = Pool(5, init_worker) def pr(repo): return pool.apply_async(process_repo, (self, repo)) results = zip(host.tree, map(pr, host.tree)) for r in results: repo, result = r project.Project.currentProj += 1 util.printStatus(repo) # Workaround to Python issue 8296 where a SIGINT will # lock up the process when no wait time is given. result.wait(9999999) if host.post_update: util.executeCommand(host.post_update)
def statusSvn(self, repo): if not util.isSvnCheckout(repo): error = "{0} is a Svn repo in config file but not a Svn checkout on disk".format(repo['local']) terminal.error("\n" + error) dolly.Dolly.warnings.append(error) return result = util.executeCommand('svn status', cwd=repo['local']) for line in result['stdout'].splitlines(): change = os.path.join(repo['local'], ' '.join(line.split()[1:])) dolly.Dolly.changes.append({'repo': repo, 'change': change})
def statusSvn(self, repo): if not util.isSvnCheckout(repo): error = "{0} is a Svn repo in config file but not a Svn checkout on disk".format( repo['local']) terminal.error("\n" + error) dolly.Dolly.warnings.append(error) return result = util.executeCommand('svn status', cwd=repo['local']) for line in result['stdout'].splitlines(): change = os.path.join(repo['local'], ' '.join(line.split()[1:])) dolly.Dolly.changes.append({'repo': repo, 'change': change})
def pullSvn(self, repo): result = util.executeCommand('svn update', cwd=repo['local'])
def pullGit(self, repo): result = util.executeCommand('git pull --ff-only', cwd=repo['local'])
def cloneSvn(self, repo): result = util.executeCommand('svn checkout --config-option servers:global:store-plaintext-passwords=yes {0} {1}'.format(repo['remote'], repo['local']))
def cloneGit(self, repo): result = util.executeCommand('git clone {0} {1}'.format(repo['remote'], repo['local']))
def pullGit(self, repo): if repo['tag'] != '': result = util.executeCommand("git checkout '{0}'".format(repo['tag']), cwd=repo['local']) else: result = util.executeCommand('git pull --ff-only', cwd=repo['local'])
def cloneSvn(self, repo): result = util.executeCommand("svn checkout --config-option servers:global:store-plaintext-passwords=yes '{0}' '{1}'".format(repo['remote'], repo['local']))
def pull(self): repo = self.data return util.executeCommand('svn update', cwd=repo['local'])
def clone(self): repo = self.data return util.executeCommand("svn checkout --config-option servers:global:store-plaintext-passwords=yes '{0}' '{1}'".format(repo['remote'], repo['local']))