1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-14 21:10:09 +02:00

Merge branch 'print-vcs-client-version' into 'master'

common: print VCS client version

See merge request fdroid/fdroidserver!349
This commit is contained in:
Hans-Christoph Steiner 2017-10-06 09:07:13 +00:00
commit 4f772596d2

View File

@ -586,6 +586,7 @@ def setup_vcs(app):
else:
remote = app.Repo
vcs = getvcs(app.RepoType, remote, build_dir)
logging.debug("Using %s" % vcs.clientversion())
return vcs, build_dir
@ -638,6 +639,13 @@ class vcs:
def repotype(self):
return None
def clientversion(self):
versionstr = FDroidPopen(self.clientversioncmd()).output
return versionstr[0:versionstr.find('\n')]
def clientversioncmd(self):
return None
def gotorevision(self, rev, refresh=True):
"""Take the local repository to a clean version of the given
revision, which is specificed in the VCS's native
@ -735,6 +743,9 @@ class vcs_git(vcs):
def repotype(self):
return 'git'
def clientversioncmd(self):
return ['git', '--version']
def checkrepo(self):
"""If the local directory exists, but is somehow not a git repository,
git will traverse up the directory tree until it finds one
@ -847,6 +858,9 @@ class vcs_gitsvn(vcs):
def repotype(self):
return 'git-svn'
def clientversioncmd(self):
return ['git', 'svn', '--version']
def checkrepo(self):
"""If the local directory exists, but is somehow not a git repository,
git will traverse up the directory tree until it finds one that
@ -973,6 +987,9 @@ class vcs_hg(vcs):
def repotype(self):
return 'hg'
def clientversioncmd(self):
return ['hg', '--version']
def gotorevisionx(self, rev):
if not os.path.exists(self.local):
p = FDroidPopen(['hg', 'clone', self.remote, self.local], output=False)
@ -1020,6 +1037,9 @@ class vcs_bzr(vcs):
def repotype(self):
return 'bzr'
def clientversioncmd(self):
return ['bzr', '--version']
def gotorevisionx(self, rev):
if not os.path.exists(self.local):
p = FDroidPopen(['bzr', 'branch', self.remote, self.local], output=False)