mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-05 06:50:10 +01:00
Treat git-svn git checkouts correctly. Mute tags/*
This commit is contained in:
parent
1ad1e85373
commit
86cff4e49c
@ -233,19 +233,22 @@ class vcs_gitsvn(vcs):
|
|||||||
raise VCSException("Git svn rebase failed")
|
raise VCSException("Git svn rebase failed")
|
||||||
self.refreshed = True
|
self.refreshed = True
|
||||||
if rev:
|
if rev:
|
||||||
if rev == 'trunk':
|
|
||||||
if subprocess.call(['git', 'checkout', 'trunk'], cwd=self.local) != 0:
|
|
||||||
raise VCSException("Git checkout failed")
|
|
||||||
else:
|
|
||||||
# Try finding a svn tag
|
# Try finding a svn tag
|
||||||
if subprocess.call(['git', 'checkout', 'tags/' + rev], cwd=self.local) != 0:
|
p = subprocess.Popen(['git', 'checkout', 'tags/' + rev],
|
||||||
|
cwd=self.local, stderr=subprocess.PIPE)
|
||||||
|
if p.returncode == 0:
|
||||||
|
print p.communicate()[0]
|
||||||
|
else:
|
||||||
# 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
|
||||||
p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev],
|
p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev],
|
||||||
cwd=self.local, stdout=subprocess.PIPE)
|
cwd=self.local, stdout=subprocess.PIPE)
|
||||||
rev = p.communicate()[0].rstrip()
|
rev = p.communicate()[0].rstrip()
|
||||||
if p.returncode != 0 or len(rev) == 0:
|
if p.returncode != 0 or len(rev) == 0:
|
||||||
raise VCSException("Failed to get git treeish from svn rev")
|
# If it's not a svn rev, do a normal git checkout (master,
|
||||||
|
# trunk, raw git sha, etc)
|
||||||
|
if subprocess.call(['git', 'checkout', 'trunk'], cwd=self.local) != 0:
|
||||||
|
raise VCSException("No git treeish found and direct git checkout failed")
|
||||||
# Check out the appropriate git revision...
|
# Check out the appropriate git revision...
|
||||||
if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0:
|
if subprocess.call(['git', 'checkout', rev], cwd=self.local) != 0:
|
||||||
raise VCSException("Git checkout failed")
|
raise VCSException("Git checkout failed")
|
||||||
|
Loading…
Reference in New Issue
Block a user