chiark / gitweb /
Add UCM:Tags support to hg
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Sep 2013 18:33:47 +0000 (20:33 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Sep 2013 18:33:47 +0000 (20:33 +0200)
docs/fdroid.texi
fdroidserver/checkupdates.py
fdroidserver/common.py

index 924ecff9c74b072bf318ced253c0c94b1728b3db..4168c50568cb1def75f7fe2e035e37471944fb0b 100644 (file)
@@ -1077,8 +1077,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 and git-svn repositories. In the case of the
-latter, the repo URL must encode the path to the trunk and tags.
+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.
 @end itemize
 
 @node Auto Update Mode
index a1ba958656dbc8d4408c775c394f857548352b6d..9c39a2b38fff70c1480da82983c05c9cdf50f8bf 100644 (file)
@@ -50,8 +50,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'):
-            return (None, 'Tags update mode only works for git and git-svn repositories currently')
+        if repotype not in ('git', 'git-svn', 'hg'):
+            return (None, 'Tags update mode only works for git, hg and git-svn repositories currently')
 
         # Set up vcs interface and make sure we have the latest code...
         vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir, sdk_path)
index d418f7900a3b53114759e126ba8863ba317c0f04..51f9a95533cf3439e8d24a8c19bbed2c1039febd 100644 (file)
@@ -342,6 +342,11 @@ class vcs_hg(vcs):
                     cwd=self.local) != 0:
                 raise VCSException("Hg checkout failed")
 
+    def gettags(self):
+        p = subprocess.Popen(['hg', 'tags', '-q'],
+                stdout=subprocess.PIPE, cwd=self.local)
+        return p.communicate()[0].splitlines()[1:]
+
 
 class vcs_bzr(vcs):