aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/git.py
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-06-01 21:51:31 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-06-01 21:51:31 +0200
commita9932d0dffae1279b5260f238c71fe66fce9cad7 (patch)
tree343851713acac9a3e38a45bbb7821cd634d7869b /MgaRepo/git.py
parentd4362835271253080db30b71d7195572d7eb8ac3 (diff)
downloadmgarepo-a9932d0dffae1279b5260f238c71fe66fce9cad7.tar
mgarepo-a9932d0dffae1279b5260f238c71fe66fce9cad7.tar.gz
mgarepo-a9932d0dffae1279b5260f238c71fe66fce9cad7.tar.bz2
mgarepo-a9932d0dffae1279b5260f238c71fe66fce9cad7.tar.xz
mgarepo-a9932d0dffae1279b5260f238c71fe66fce9cad7.zip
fix so cloning into git repositories and updating of works targetpath
specified
Diffstat (limited to 'MgaRepo/git.py')
-rw-r--r--MgaRepo/git.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/MgaRepo/git.py b/MgaRepo/git.py
index c027079..515fae4 100644
--- a/MgaRepo/git.py
+++ b/MgaRepo/git.py
@@ -25,7 +25,7 @@ class GIT(VCS):
def clone(self, url, targetpath, **kwargs):
if lexists(join(targetpath, SVN.vcs_dirname)):
- raise Error("Target path %s already contains svn checkout, aborting...")
+ raise Error("Target path %s already contains svn checkout, aborting..." % targetpath)
if url.split(':')[0].find("svn") < 0:
return VCS.clone(self, url, **kwargs)
else:
@@ -46,7 +46,7 @@ class GIT(VCS):
#cmd = ["svn", "init", topurl, "--trunk="+trunk, "--tags="+tags", targetpath]
cmd = ["svn", "init", url, abspath(targetpath)]
self._execVcs(*cmd, **kwargs)
- os.environ.update({"GIT_WORK_TREE" : abspath(targetpath)})
+ os.environ.update({"GIT_WORK_TREE" : abspath(targetpath), "GIT_DIR" : join(abspath(targetpath),".git")})
for entry in logentries:
revisions.append(int(entry.attrib["revision"]))
revisions.sort()
@@ -78,7 +78,7 @@ class GIT(VCS):
return None
def update(self, path, **kwargs):
- os.environ.update({"GIT_WORK_TREE" : abspath(path)})
+ os.environ.update({"GIT_WORK_TREE" : abspath(targetpath), "GIT_DIR" : join(abspath(targetpath),".git")})
cmd = ["svn", "log", "--oneline", "--limit=1"]
retval, result = self._execVcs(*cmd)