Exemplo n.º 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
Exemplo n.º 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'])
Exemplo n.º 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']))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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})
Exemplo n.º 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})
Exemplo n.º 12
0
	def pullSvn(self, repo):
		result = util.executeCommand('svn update', cwd=repo['local'])
Exemplo n.º 13
0
	def pullGit(self, repo):
		result = util.executeCommand('git pull --ff-only', cwd=repo['local'])
Exemplo n.º 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']))
Exemplo n.º 15
0
	def cloneGit(self, repo):
		result = util.executeCommand('git clone {0} {1}'.format(repo['remote'], repo['local']))
Exemplo n.º 16
0
	def pullSvn(self, repo):
		result = util.executeCommand('svn update', cwd=repo['local'])
Exemplo n.º 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'])
Exemplo n.º 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']))
Exemplo n.º 19
0
	def pull(self):
		repo = self.data
		return util.executeCommand('svn update', cwd=repo['local'])
Exemplo n.º 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']))