chiark / gitweb /
tags and trunk are variable; append to repo
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 5 Apr 2013 19:55:34 +0000 (21:55 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 5 Apr 2013 19:55:34 +0000 (21:55 +0200)
They will be in the form Repo:http://foo.com/svn/project;trunk=...;tags=...

Both trunk and tags are optional. If trunk is not given, it is assumed that the
Repo url itself contains the raw trunk folder.

fdroidserver/common.py

index 0db812a44f4ea1a946f31f72e474ee597f0160cf..d734dd942cf0959f88910141016f690562eb63f6 100644 (file)
@@ -197,8 +197,24 @@ class vcs_gitsvn(vcs):
     def gotorevisionx(self, rev):
         if not os.path.exists(self.local):
             # Brand new checkout...
-            if subprocess.call(['git', 'svn', 'clone', '-T', 'trunk', '-t', 'tags', self.remote, self.local]) != 0:
-                raise VCSException("Git clone failed")
+            gitsvn_cmd = ['git', 'svn', 'clone']
+            remote_split = self.remote.split(';')
+            if len(remote_split) > 1:
+                for i in remote_split[1:]:
+                    if i.startswith('trunk='):
+                        trunk = i[6:]
+                    elif i.startswith('tags='):
+                        tags = i[5:]
+                gitsvn_cmd = []
+                if trunk:
+                    gitsvn_cmd += ['-T', trunk]
+                if tags:
+                    gitsvn_cmd += ['-t', tags]
+                if subprocess.call(gitsvn_cmd + [remote_split[0], self.local]) != 0:
+                    raise VCSException("Git clone failed")
+            else:
+                if subprocess.call(gitsvn_cmd + [self.remote, self.local]) != 0:
+                    raise VCSException("Git clone failed")
             self.checkrepo()
         else:
             self.checkrepo()