mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-17 03:40:11 +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:
commit
4f772596d2
@ -586,6 +586,7 @@ def setup_vcs(app):
|
|||||||
else:
|
else:
|
||||||
remote = app.Repo
|
remote = app.Repo
|
||||||
vcs = getvcs(app.RepoType, remote, build_dir)
|
vcs = getvcs(app.RepoType, remote, build_dir)
|
||||||
|
logging.debug("Using %s" % vcs.clientversion())
|
||||||
|
|
||||||
return vcs, build_dir
|
return vcs, build_dir
|
||||||
|
|
||||||
@ -638,6 +639,13 @@ class vcs:
|
|||||||
def repotype(self):
|
def repotype(self):
|
||||||
return None
|
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):
|
def gotorevision(self, rev, refresh=True):
|
||||||
"""Take the local repository to a clean version of the given
|
"""Take the local repository to a clean version of the given
|
||||||
revision, which is specificed in the VCS's native
|
revision, which is specificed in the VCS's native
|
||||||
@ -735,6 +743,9 @@ class vcs_git(vcs):
|
|||||||
def repotype(self):
|
def repotype(self):
|
||||||
return 'git'
|
return 'git'
|
||||||
|
|
||||||
|
def clientversioncmd(self):
|
||||||
|
return ['git', '--version']
|
||||||
|
|
||||||
def checkrepo(self):
|
def checkrepo(self):
|
||||||
"""If the local directory exists, but is somehow not a git repository,
|
"""If the local directory exists, but is somehow not a git repository,
|
||||||
git will traverse up the directory tree until it finds one
|
git will traverse up the directory tree until it finds one
|
||||||
@ -847,6 +858,9 @@ class vcs_gitsvn(vcs):
|
|||||||
def repotype(self):
|
def repotype(self):
|
||||||
return 'git-svn'
|
return 'git-svn'
|
||||||
|
|
||||||
|
def clientversioncmd(self):
|
||||||
|
return ['git', 'svn', '--version']
|
||||||
|
|
||||||
def checkrepo(self):
|
def checkrepo(self):
|
||||||
"""If the local directory exists, but is somehow not a git repository,
|
"""If the local directory exists, but is somehow not a git repository,
|
||||||
git will traverse up the directory tree until it finds one that
|
git will traverse up the directory tree until it finds one that
|
||||||
@ -973,6 +987,9 @@ class vcs_hg(vcs):
|
|||||||
def repotype(self):
|
def repotype(self):
|
||||||
return 'hg'
|
return 'hg'
|
||||||
|
|
||||||
|
def clientversioncmd(self):
|
||||||
|
return ['hg', '--version']
|
||||||
|
|
||||||
def gotorevisionx(self, rev):
|
def gotorevisionx(self, rev):
|
||||||
if not os.path.exists(self.local):
|
if not os.path.exists(self.local):
|
||||||
p = FDroidPopen(['hg', 'clone', self.remote, self.local], output=False)
|
p = FDroidPopen(['hg', 'clone', self.remote, self.local], output=False)
|
||||||
@ -1020,6 +1037,9 @@ class vcs_bzr(vcs):
|
|||||||
def repotype(self):
|
def repotype(self):
|
||||||
return 'bzr'
|
return 'bzr'
|
||||||
|
|
||||||
|
def clientversioncmd(self):
|
||||||
|
return ['bzr', '--version']
|
||||||
|
|
||||||
def gotorevisionx(self, rev):
|
def gotorevisionx(self, rev):
|
||||||
if not os.path.exists(self.local):
|
if not os.path.exists(self.local):
|
||||||
p = FDroidPopen(['bzr', 'branch', self.remote, self.local], output=False)
|
p = FDroidPopen(['bzr', 'branch', self.remote, self.local], output=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user