obsolete: add an hidden revset
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 27 Jun 2012 12:30:10 +0200
changeset 321 41ba89f0caa5
parent 320 63f267bd2176
child 322 f4a00b2d8bfb
obsolete: add an hidden revset
hgext/obsolete.py
--- a/hgext/obsolete.py	Wed Jun 27 12:30:16 2012 +0200
+++ b/hgext/obsolete.py	Wed Jun 27 12:30:10 2012 +0200
@@ -150,6 +150,10 @@
 ### revset
 #############################
 
+def revsethidden(repo, subset, x):
+    """hidden changesets"""
+    args = revset.getargs(x, 0, 0, 'hidden takes no argument')
+    return [r for r in subset if r in repo.changelog.hiddenrevs]
 
 def revsetobsolete(repo, subset, x):
     """obsolete changesets"""
@@ -375,6 +379,7 @@
 
 def extsetup(ui):
 
+    revset.symbols["hidden"] = revsethidden
     revset.symbols["obsolete"] = revsetobsolete
     revset.symbols["unstable"] = revsetunstable
     revset.symbols["suspended"] = revsetsuspended