Example #1
0
	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
Example #2
0
	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'])
Example #3
0
	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']))
Example #4
0
	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)
Example #5
0
 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)
Example #6
0
	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
Example #7
0
	def get_revision(self):
		repo = self.data
		result = util.executeCommand('svnversion', cwd=repo['local'])
		if result['returncode'] == 0:
			return result['stdout']
		else:
			return None
Example #8
0
	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)
Example #9
0
	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)
Example #10
0
	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})
Example #11
0
 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})
Example #12
0
	def pullSvn(self, repo):
		result = util.executeCommand('svn update', cwd=repo['local'])
Example #13
0
	def pullGit(self, repo):
		result = util.executeCommand('git pull --ff-only', cwd=repo['local'])
Example #14
0
	def cloneSvn(self, repo):
		result = util.executeCommand('svn checkout --config-option servers:global:store-plaintext-passwords=yes {0} {1}'.format(repo['remote'], repo['local']))
Example #15
0
	def cloneGit(self, repo):
		result = util.executeCommand('git clone {0} {1}'.format(repo['remote'], repo['local']))
Example #16
0
	def pullSvn(self, repo):
		result = util.executeCommand('svn update', cwd=repo['local'])
Example #17
0
	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'])
Example #18
0
	def cloneSvn(self, repo):
		result = util.executeCommand("svn checkout --config-option servers:global:store-plaintext-passwords=yes '{0}' '{1}'".format(repo['remote'], repo['local']))
Example #19
0
	def pull(self):
		repo = self.data
		return util.executeCommand('svn update', cwd=repo['local'])
Example #20
0
	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']))