diff options
author | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-28 21:47:50 +0200 |
---|---|---|
committer | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-28 21:47:50 +0200 |
commit | 919de84e24d9fc8d4a2fda6cb46cac79744522a8 (patch) | |
tree | ef9319f5d7041b748bfa5552ce541641c1e18d7c /MgaRepo/VCS.py | |
parent | db101fdddb6f631a342fedc0ef2560edbef580b5 (diff) | |
download | mgarepo-919de84e24d9fc8d4a2fda6cb46cac79744522a8.tar mgarepo-919de84e24d9fc8d4a2fda6cb46cac79744522a8.tar.gz mgarepo-919de84e24d9fc8d4a2fda6cb46cac79744522a8.tar.bz2 mgarepo-919de84e24d9fc8d4a2fda6cb46cac79744522a8.tar.xz mgarepo-919de84e24d9fc8d4a2fda6cb46cac79744522a8.zip |
store repo topdir in VCS class
Diffstat (limited to 'MgaRepo/VCS.py')
-rw-r--r-- | MgaRepo/VCS.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/MgaRepo/VCS.py b/MgaRepo/VCS.py index 46058a2..7a9170b 100644 --- a/MgaRepo/VCS.py +++ b/MgaRepo/VCS.py @@ -23,12 +23,13 @@ class VCSLogEntry(object): class VCS(object): vcs_dirname = None vcs_name = None - def __init__(self): + def __init__(self, path): self.vcs_command = None self.vcs_wrapper = "mga-ssh" self.vcs_supports = {'clone' : False} self.vcs_type = None self.env_defaults = None + self._path = path def _execVcs(self, *args, **kwargs): localcmds = ("add", "revert", "cleanup", "mv") @@ -385,6 +386,13 @@ class VCS(object): self._add_log(cmd, kwargs) return self._execVcs_success(*cmd, **kwargs) + def get_topdir(self): + vcsdir = os.path.join(self._path, self.vcs_dirname) + if os.path.exists(vcsdir) and os.path.isdir(vcsdir): + return self._path + else: + return None + class VCSLook(object): def __init__(self, repospath, txn=None, rev=None): self.repospath = repospath |