mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-06 11:00:13 +02:00
common: print VCS client version
This may help to debug issues with too old VCS clients.
This commit is contained in:
parent
02449865f1
commit
0ab0b03648
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user