From f8571693176bb9544b4c16cde70607223fae29a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Tue, 8 Jul 2014 12:04:24 +0200 Subject: [PATCH] Support origin/ checkouts with tags as well in gitsvn --- fdroidserver/common.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index f21a0e71..c542aa2d 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -617,7 +617,11 @@ class vcs_gitsvn(vcs): if rev: nospaces_rev = rev.replace(' ', '%20') # Try finding a svn tag - p = SilentPopen(['git', 'checkout', 'tags/' + nospaces_rev], cwd=self.local) + for treeish in ['origin/', '']: + p = SilentPopen(['git', 'checkout', treeish + 'tags/' + nospaces_rev], + cwd=self.local) + if p.returncode == 0: + break if p.returncode != 0: # No tag found, normal svn rev translation # Translate svn rev into git format @@ -634,7 +638,8 @@ class vcs_gitsvn(vcs): treeish += 'master' svn_rev = rev - p = SilentPopen(['git', 'svn', 'find-rev', 'r' + svn_rev, treeish], cwd=self.local) + p = SilentPopen(['git', 'svn', 'find-rev', 'r' + svn_rev, treeish], + cwd=self.local) git_rev = p.output.rstrip() if p.returncode == 0 and git_rev: -- 2.30.2