From 4c5cd7a360d57543170fdc557759ec9a408d20b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 30 Oct 2013 21:54:09 +0100 Subject: [PATCH] Add support for UCM:Tags in bzr --- docs/fdroid.texi | 6 +++--- fdroidserver/checkupdates.py | 4 ++-- fdroidserver/common.py | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 80d0abd6..052ff3fe 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -1111,9 +1111,9 @@ are known to forget to tag releases. Like RepoManifest, it will not return the correct value if the directory containing the AndroidManifest.xml has moved. Despite these caveats, it is the often the favourite update check mode. -It currently only works for git, hg and git-svn repositories. In the case of -the latter, the repo URL must encode the path to the trunk and tags or else no -tags will be found. +It currently only works for git, hg, bzr and git-svn repositories. In the case +of the latter, the repo URL must encode the path to the trunk and tags or else +no tags will be found. @item @code{HTTP} - HTTP requests are used to determine the current version code and version name. This is controlled by the @code{Update Check Data} field, which diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index b8a0d124..99051c0a 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -93,8 +93,8 @@ def check_tags(app, sdk_path): build_dir = os.path.join('build/', app['id']) repotype = app['Repo Type'] - if repotype not in ('git', 'git-svn', 'hg'): - return (None, 'Tags update mode only works for git, hg and git-svn repositories currently') + if repotype not in ('git', 'git-svn', 'hg', 'bzr'): + return (None, 'Tags update mode only works for git, hg, bzr and git-svn repositories currently', None) # Set up vcs interface and make sure we have the latest code... vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir, sdk_path) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index a21281aa..a0d8da94 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -415,6 +415,12 @@ class vcs_bzr(vcs): self.refreshed = False self.srclib = None + def gettags(self): + p = subprocess.Popen(['bzr', 'tags'], + stdout=subprocess.PIPE, cwd=self.local) + return [tag.split(' ')[0].strip() for tag in + p.communicate()[0].splitlines()] + # Get the type expected for a given metadata field. def metafieldtype(name):