mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Try the old git svn find-rev format as well
This commit is contained in:
parent
452c13907c
commit
7d07e52e1f
1 changed files with 15 additions and 10 deletions
|
|
@ -622,19 +622,24 @@ class vcs_gitsvn(vcs):
|
||||||
# No tag found, normal svn rev translation
|
# No tag found, normal svn rev translation
|
||||||
# Translate svn rev into git format
|
# Translate svn rev into git format
|
||||||
rev_split = rev.split('/')
|
rev_split = rev.split('/')
|
||||||
|
|
||||||
|
p = None
|
||||||
|
for treeish in ['origin/', '']:
|
||||||
if len(rev_split) > 1:
|
if len(rev_split) > 1:
|
||||||
treeish = 'origin/' + rev_split[0]
|
treeish += rev_split[0]
|
||||||
svn_rev = rev_split[1]
|
svn_rev = rev_split[1]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# if no branch is specified, then assume trunk (ie. 'master'
|
# if no branch is specified, then assume trunk (i.e. 'master' branch):
|
||||||
# branch):
|
treeish += 'master'
|
||||||
treeish = 'origin/master'
|
|
||||||
svn_rev = rev
|
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()
|
git_rev = p.output.rstrip()
|
||||||
|
|
||||||
|
if p.returncode == 0 and git_rev:
|
||||||
|
break
|
||||||
|
|
||||||
if p.returncode != 0 or not git_rev:
|
if p.returncode != 0 or not git_rev:
|
||||||
# Try a plain git checkout as a last resort
|
# Try a plain git checkout as a last resort
|
||||||
p = SilentPopen(['git', 'checkout', rev], cwd=self.local)
|
p = SilentPopen(['git', 'checkout', rev], cwd=self.local)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue