revset: add tagged predicate
authorMatt Mackall <mpm@selenic.com>
Thu, 03 Jun 2010 17:39:40 -0500
changeset 11280 a5eb0bf7e158
parent 11279 62ccf4cd6e7f
child 11281 b724b8467b82
revset: add tagged predicate
mercurial/revset.py
--- a/mercurial/revset.py	Thu Jun 03 17:39:34 2010 -0500
+++ b/mercurial/revset.py	Thu Jun 03 17:39:40 2010 -0500
@@ -424,6 +424,11 @@
     print 'out', dest, o
     return [r for r in subset if r in o]
 
+def tagged(repo, subset, x):
+    cl = repo.changelog
+    s = set([cl.rev(n) for t, n in repo.tagslist() if t != 'tip'])
+    return [r for r in subset if r in s]
+
 symbols = {
     "ancestor": ancestor,
     "ancestors": ancestors,
@@ -455,6 +460,7 @@
     "adds": adds,
     "removes": removes,
     "outgoing": outgoing,
+    "tagged": tagged,
 }
 
 methods = {