diff options
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 |