mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-10 01:10:11 +01:00
Only do the latest five tags when using UCM:Tags on git
This commit is contained in:
parent
3736da3761
commit
00fa44e916
@ -123,6 +123,9 @@ def check_tags(app, pattern):
|
|||||||
pat = re.compile(pattern)
|
pat = re.compile(pattern)
|
||||||
tags = [tag for tag in tags if pat.match(tag)]
|
tags = [tag for tag in tags if pat.match(tag)]
|
||||||
|
|
||||||
|
if repotype in ('git',):
|
||||||
|
tags = vcs.latesttags(tags, 5)
|
||||||
|
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
logging.debug("Check tag: '{0}'".format(tag))
|
logging.debug("Check tag: '{0}'".format(tag))
|
||||||
vcs.gotorevision(tag)
|
vcs.gotorevision(tag)
|
||||||
|
@ -320,6 +320,10 @@ class vcs:
|
|||||||
def gettags(self):
|
def gettags(self):
|
||||||
raise VCSException('gettags not supported for this vcs type')
|
raise VCSException('gettags not supported for this vcs type')
|
||||||
|
|
||||||
|
# Get a list of latest number tags
|
||||||
|
def latesttags(self, number):
|
||||||
|
raise VCSException('latesttags not supported for this vcs type')
|
||||||
|
|
||||||
# Get current commit reference (hash, revision, etc)
|
# Get current commit reference (hash, revision, etc)
|
||||||
def getref(self):
|
def getref(self):
|
||||||
raise VCSException('getref not supported for this vcs type')
|
raise VCSException('getref not supported for this vcs type')
|
||||||
@ -412,6 +416,14 @@ class vcs_git(vcs):
|
|||||||
p = SilentPopen(['git', 'tag'], cwd=self.local)
|
p = SilentPopen(['git', 'tag'], cwd=self.local)
|
||||||
return p.stdout.splitlines()
|
return p.stdout.splitlines()
|
||||||
|
|
||||||
|
def latesttags(self, alltags, number):
|
||||||
|
self.checkrepo()
|
||||||
|
p = SilentPopen(['echo "'+'\n'.join(alltags)+'" | \
|
||||||
|
xargs -I@ git log --format=format:"%at @%n" -1 @ | \
|
||||||
|
sort -n | awk \'{print $2}\''],
|
||||||
|
cwd=self.local, shell=True)
|
||||||
|
return p.stdout.splitlines()[-number:]
|
||||||
|
|
||||||
|
|
||||||
class vcs_gitsvn(vcs):
|
class vcs_gitsvn(vcs):
|
||||||
|
|
||||||
@ -1441,6 +1453,7 @@ def FDroidPopen(commands, cwd=None, shell=False, output=True):
|
|||||||
:returns: A PopenResult.
|
:returns: A PopenResult.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if output:
|
||||||
if cwd:
|
if cwd:
|
||||||
cwd = os.path.normpath(cwd)
|
cwd = os.path.normpath(cwd)
|
||||||
logging.info("Directory: %s" % cwd)
|
logging.info("Directory: %s" % cwd)
|
||||||
|
Loading…
Reference in New Issue
Block a user