Commits

Pierre-Yves David committed b126551

revset

Comments (0)

Files changed (2)

 
 from mercurial import util
 from mercurial import context
+from mercurial import revset
 from mercurial.node import hex, bin
 
 # Patch changectx
     return ohidden(ctx)
 context.changectx.hidden = hidden
 
+# revset
+#############################
+
+def revsetobsolete(repo, subset, x):
+    args = revset.getargs(x, 0, 0, 'publicheads takes no arguments')
+    return [r for r in subset if repo[r].obsolete()] # XXX slow
+
+def extsetup(ui):
+    revset.symbols["obsolete"] = revsetobsolete
+
 # New commands
 #############################
 

tests/test-obsolete.t

   >    hg ci -m "add $1"
   > }
 
-  $ hg init repo
-  $ cd repo
+  $ hg init local
+  $ cd local
   $ mkcommit a # 0
   $ mkcommit b # 1
   $ mkcommit c # 2
   $ mkcommit obsol_c # 3
   created new head
   $ hg debugobsolete 3 2
+
+
+Test that obsolete changeset are hidden
+
   $ hg log
   changeset:   3:0d3f46688ccc
   tag:         tip
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add a
   
+  $ hg log -r 'obsolete()' --hidden
+  changeset:   2:4538525df7e2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add c
+  
+