diff options
-rw-r--r-- | MgaRepo/git.py | 7 | ||||
-rw-r--r-- | MgaRepo/svn.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/MgaRepo/git.py b/MgaRepo/git.py index b91dcb2..07d57ac 100644 --- a/MgaRepo/git.py +++ b/MgaRepo/git.py @@ -18,9 +18,9 @@ class GITLogEntry(VCSLogEntry): class GIT(VCS): vcs_dirname = ".git" + vcs_name = "git" def __init__(self): VCS.__init__(self) - self.vcs_name = "git" self.vcs_command = config.get("global", "git-command", ["git"]) self.vcs_supports['clone'] = True self.env_defaults = {"GIT_SSH": self.vcs_wrapper} @@ -42,8 +42,9 @@ class GIT(VCS): return True def clone(self, url, targetpath, fullnames=True, **kwargs): - if lexists(join(targetpath, SVN.vcs_dirname)): - raise Error("Target path %s already contains svn checkout, aborting..." % targetpath) + for vcs in (SVN, GIT): + if lexists(join(targetpath, vcs.vcs_dirname)): + raise Error("target path %s already contains %s repository, aborting..." % (targetpath, vcs.vcs_name)) if url.split(':')[0].find("svn") < 0: return VCS.clone(self, url, **kwargs) else: diff --git a/MgaRepo/svn.py b/MgaRepo/svn.py index 120c19c..a9038df 100644 --- a/MgaRepo/svn.py +++ b/MgaRepo/svn.py @@ -13,9 +13,9 @@ class SVNLogEntry(VCSLogEntry): class SVN(VCS): vcs_dirname = ".svn" + vcs_name = "svn" def __init__(self): VCS.__init__(self) - self.vcs_name = "svn" self.vcs_command = config.get("global", "svn-command", ["svn"]) self.env_defaults = {"SVN_SSH": self.vcs_wrapper} |