chiark / gitweb /
git-svn: Support <branch>/<rev> in commit field
authorأحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
Fri, 24 Jan 2014 08:47:57 +0000 (10:47 +0200)
committerأحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
Fri, 24 Jan 2014 08:49:20 +0000 (10:49 +0200)
commit=<rev> is still supported

fdroidserver/common.py

index 2cc1bf1f5f9253812c853b6cea7a93e1d3b6d082..27078ade698da6b52ff4ce203837052ba1bde0c5 100644 (file)
@@ -454,7 +454,16 @@ class vcs_gitsvn(vcs):
             else:
                 # No tag found, normal svn rev translation
                 # Translate svn rev into git format
-                p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev],
+                rev_split=rev.split('/')
+                if len(rev_split) > 1:
+                  treeish=rev_split[0]
+                  svn_rev=rev_split[1]
+                else:
+                  # if no branch is specified, then assume trunk (ie. 'master' 
+                  # branch):
+                  treeish='master'
+                  svn_rev=rev
+                p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + svn_rev, treeish],
                     cwd=self.local, stdout=subprocess.PIPE)
                 git_rev = p.communicate()[0].rstrip()
                 if p.returncode != 0 or not git_rev: