diff options
author | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-01 21:49:34 +0200 |
---|---|---|
committer | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-01 21:49:34 +0200 |
commit | d4362835271253080db30b71d7195572d7eb8ac3 (patch) | |
tree | 71de4d5259d94fe3bb1a11eb2d91aa401f12c786 /MgaRepo/git.py | |
parent | a6c6cedd46157ef311556da3a1c412c65950c152 (diff) | |
download | mgarepo-d4362835271253080db30b71d7195572d7eb8ac3.tar mgarepo-d4362835271253080db30b71d7195572d7eb8ac3.tar.gz mgarepo-d4362835271253080db30b71d7195572d7eb8ac3.tar.bz2 mgarepo-d4362835271253080db30b71d7195572d7eb8ac3.tar.xz mgarepo-d4362835271253080db30b71d7195572d7eb8ac3.zip |
make sure target path doesn't already have svn checkout before cloning
into
Diffstat (limited to 'MgaRepo/git.py')
-rw-r--r-- | MgaRepo/git.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MgaRepo/git.py b/MgaRepo/git.py index 01a1272..c027079 100644 --- a/MgaRepo/git.py +++ b/MgaRepo/git.py @@ -1,7 +1,8 @@ from MgaRepo import Error, config from MgaRepo.util import execcmd from MgaRepo.VCS import * -from os.path import basename, dirname, abspath +from MgaRepo.svn import SVN +from os.path import basename, dirname, abspath, lexists, join from os import chdir, getcwd import sys import re @@ -23,6 +24,8 @@ class GIT(VCS): self.env_defaults = {"GIT_SSH": self.vcs_wrapper} def clone(self, url, targetpath, **kwargs): + if lexists(join(targetpath, SVN.vcs_dirname)): + raise Error("Target path %s already contains svn checkout, aborting...") if url.split(':')[0].find("svn") < 0: return VCS.clone(self, url, **kwargs) else: |