[PATCH] templatekw: allow tagtypes other than global in getlatesttags

Andrew Shadura bugzilla at tut.by
Mon Dec 23 13:15:14 UTC 2013


# HG changeset patch
# User Andrew Shadura <andrew at shadura.me>
# Date 1387804471 -3600
#      Mon Dec 23 14:14:31 2013 +0100
# Node ID 9d828248ba21fc13ed6c4cc343761dd0966087ad
# Parent  4274eda143cb1025be1130ffdaaf62370a2a6961
templatekw: allow tagtypes other than global in getlatesttags

hg-git uses tagtype 'git', for example, so it's better
to check for tagtype != 'local', not strictly for 'global'

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -117,7 +117,7 @@ def getlatesttags(repo, ctx, cache):
         if rev in latesttags:
             continue
         ctx = repo[rev]
-        tags = [t for t in ctx.tags() if repo.tagtype(t) == 'global']
+        tags = [t for t in ctx.tags() if (repo.tagtype(t) and repo.tagtype(t) != 'local')]
         if tags:
             latesttags[rev] = ctx.date()[0], 0, ':'.join(sorted(tags))
             continue



More information about the Mercurial-devel mailing list