grim/local-pipelines

cf2d13c055f4
Parents b402a0acb748
Children 6504522f8b27
vcs: remove unused get_branch and _VCSS
--- a/pipelines/vcs.py Wed Jul 27 22:18:59 2016 -0700
+++ b/pipelines/vcs.py Wed Jul 27 22:20:25 2016 -0700
@@ -22,12 +22,6 @@
import subprocess
-_VCSS = {
- 'git': 'git rev-parse --abbrev-ref HEAD -C {}',
- 'hg': 'hg branch -R {}',
-}
-
-
def run_command(cmd, path):
env = os.environ.copy()
@@ -89,25 +83,3 @@
@property
def branch(self):
return self._repo.branch
-
-
-def get_branch(path):
- branch = None
- env = os.environ.copy()
-
- # ignore user's config
- env['HGRCPATH'] = '/dev/null'
- env['HOME'] = '/tmp'
- env['GIT_CONFIG_NOSYSTEM'] = '1'
-
- for _, cmd in _VCSS.iteritems():
- try:
- command = cmd.format(path)
- branch = subprocess.check_output(command.split(),
- stderr=open(os.devnull, 'w'),
- env=env)
- branch = branch.strip()
- except subprocess.CalledProcessError:
- pass
-
- return branch