grim/local-pipelines
Clone
Summary
Browse
Changes
Graph
Closing the golang branch since rewriting in golang doesn't gain us much now that we're on pypi
golang
2016-07-25, Gary Kramlich
043d23cab7bf
Closing the golang branch since rewriting in golang doesn't gain us much now that we're on pypi
# vi:et:ts=4 sw=4 sts=4
import
subprocess
_VCSS
=
{
'git'
:
'git rev-parse --abbrev-ref HEAD -C
{}
'
,
'hg'
:
'hg branch -R
{}
'
,
}
def
get_branch
(
path
):
branch
=
None
for
_
,
cmd
in
_VCSS
.
iteritems
():
try
:
command
=
cmd
.
format
(
path
)
branch
=
subprocess
.
check_output
(
command
.
split
())
branch
=
branch
.
strip
()
except
subprocess
.
CalledProcessError
:
pass
return
branch
def
get_vcses
():
return
_VCSS
.
keys
()