grim/local-pipelines

Parents 76175381c6fe
Children da78cebcf5e2
vcs: add helper _owner_repo method for returning the origin path
--- a/pipelines/vcs.py Thu Jul 28 00:58:35 2016 -0700
+++ b/pipelines/vcs.py Thu Jul 28 00:58:59 2016 -0700
@@ -53,6 +53,13 @@
return run_command('git rev-parse HEAD',
self._path)
+ @property
+ def _owner_repo(self):
+ url = run_command('git remote get-url origin', self._path)
+ if url.endswith('.git'):
+ url = url[:-4]
+ return url.replace(':', '/').split('/')[-2:]
+
class hg_backend(object):
def __init__(self, path):