changeset 11280:a5eb0bf7e158

revset: add tagged predicate
author Matt Mackall <mpm@selenic.com>
date Thu, 03 Jun 2010 17:39:40 -0500
parents 62ccf4cd6e7f
children b724b8467b82
files mercurial/revset.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 = {