tests/test-glog.t
changeset 16146 267cebac84c3
parent 14133 28085b82f801
child 16147 5607d829bf17
--- a/tests/test-glog.t	Wed Feb 22 15:22:12 2012 -0600
+++ b/tests/test-glog.t	Wed Feb 22 12:30:14 2012 +0100
@@ -83,8 +83,26 @@
   >   hg commit -Aqd "$rev 0" -m "($rev) $msg"
   > }
 
+  $ cat > printrevset.py <<EOF
+  > from mercurial import extensions, revset, commands
+  > from hgext import graphlog
+  >  
+  > def uisetup(ui):
+  >     def printrevset(orig, ui, repo, *pats, **opts):
+  >         if opts.get('print_revset'):
+  >             expr = graphlog.revset(pats, opts)
+  >             tree = revset.parse(expr)[0]
+  >             ui.write(tree, "\n")
+  >             return 0
+  >         return orig(ui, repo, *pats, **opts)
+  >     entry = extensions.wrapcommand(commands.table, 'log', printrevset)
+  >     entry[1].append(('', 'print-revset', False,
+  >                      'print generated revset and exit (DEPRECATED)'))
+  > EOF
+
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "graphlog=" >> $HGRCPATH
+  $ echo "printrevset=`pwd`/printrevset.py" >> $HGRCPATH
 
   $ hg init repo
   $ cd repo
@@ -1400,7 +1418,8 @@
   $ hg log -G -b 'something nice'
   abort: unknown revision 'something nice'!
   [255]
-  $ hg log -G -k 'something nice'
+  $ hg log -G --print-revset -k 'something' -k 'nice'
+  ('group', ('and', ('func', ('symbol', 'keyword'), ('string', 'something')), ('func', ('symbol', 'keyword'), ('string', 'nice'))))
   $ hg log -G --only-branch 'something nice'
   abort: unknown revision 'something nice'!
   [255]