--- a/tests/test-revset.t Fri Mar 02 21:43:55 2012 +0200
+++ b/tests/test-revset.t Fri Feb 24 11:02:21 2012 +0100
@@ -94,19 +94,25 @@
('symbol', 'a')
0
$ try b-a
- ('minus', ('symbol', 'b'), ('symbol', 'a'))
+ (minus
+ ('symbol', 'b')
+ ('symbol', 'a'))
1
$ try _a_b_c_
('symbol', '_a_b_c_')
6
$ try _a_b_c_-a
- ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
+ (minus
+ ('symbol', '_a_b_c_')
+ ('symbol', 'a'))
6
$ try .a.b.c.
('symbol', '.a.b.c.')
7
$ try .a.b.c.-a
- ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
+ (minus
+ ('symbol', '.a.b.c.')
+ ('symbol', 'a'))
7
$ try -- '-a-b-c-' # complains
hg: parse error at 7: not a prefix: end
@@ -114,7 +120,15 @@
$ log -a-b-c- # succeeds with fallback
4
$ try -- -a-b-c--a # complains
- ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
+ (minus
+ (minus
+ (minus
+ (negate
+ ('symbol', 'a'))
+ ('symbol', 'b'))
+ ('symbol', 'c'))
+ (negate
+ ('symbol', 'a')))
abort: unknown revision '-a'!
[255]
$ try é
@@ -124,7 +138,9 @@
quoting needed
$ try '"-a-b-c-"-a'
- ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
+ (minus
+ ('string', '-a-b-c-')
+ ('symbol', 'a'))
4
$ log '1 or 2'
@@ -136,15 +152,32 @@
$ log '1 and 2'
$ log '1&2'
$ try '1&2|3' # precedence - and is higher
- ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+ (or
+ (and
+ ('symbol', '1')
+ ('symbol', '2'))
+ ('symbol', '3'))
3
$ try '1|2&3'
- ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
+ (or
+ ('symbol', '1')
+ (and
+ ('symbol', '2')
+ ('symbol', '3')))
1
$ try '1&2&3' # associativity
- ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+ (and
+ (and
+ ('symbol', '1')
+ ('symbol', '2'))
+ ('symbol', '3'))
$ try '1|(2|3)'
- ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
+ (or
+ ('symbol', '1')
+ (group
+ (or
+ ('symbol', '2')
+ ('symbol', '3'))))
1
2
3
@@ -226,13 +259,19 @@
$ log 'grep("issue\d+")'
6
$ try 'grep("(")' # invalid regular expression
- ('func', ('symbol', 'grep'), ('string', '('))
+ (func
+ ('symbol', 'grep')
+ ('string', '('))
hg: parse error: invalid match pattern: unbalanced parenthesis
[255]
$ try 'grep("\bissue\d+")'
- ('func', ('symbol', 'grep'), ('string', '\x08issue\\d+'))
+ (func
+ ('symbol', 'grep')
+ ('string', '\x08issue\\d+'))
$ try 'grep(r"\bissue\d+")'
- ('func', ('symbol', 'grep'), ('string', '\\bissue\\d+'))
+ (func
+ ('symbol', 'grep')
+ ('string', '\\bissue\\d+'))
6
$ try 'grep(r"\")'
hg: parse error at 7: unterminated string
@@ -437,14 +476,20 @@
$ try m
('symbol', 'm')
- ('func', ('symbol', 'merge'), None)
+ (func
+ ('symbol', 'merge')
+ None)
6
test alias recursion
$ try sincem
('symbol', 'sincem')
- ('func', ('symbol', 'descendants'), ('func', ('symbol', 'merge'), None))
+ (func
+ ('symbol', 'descendants')
+ (func
+ ('symbol', 'merge')
+ None))
6
7
@@ -463,8 +508,16 @@
$ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
$ echo 'nested3($1) = max($1)' >> .hg/hgrc
$ try 'nested(2:5)'
- ('func', ('symbol', 'nested'), ('range', ('symbol', '2'), ('symbol', '5')))
- ('func', ('symbol', 'max'), ('range', ('symbol', '2'), ('symbol', '5')))
+ (func
+ ('symbol', 'nested')
+ (range
+ ('symbol', '2')
+ ('symbol', '5')))
+ (func
+ ('symbol', 'max')
+ (range
+ ('symbol', '2')
+ ('symbol', '5')))
5
test variable isolation, variable placeholders are rewritten as string
@@ -474,38 +527,100 @@
$ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
$ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
$ try 'callinjection(2:5)'
- ('func', ('symbol', 'callinjection'), ('range', ('symbol', '2'), ('symbol', '5')))
- ('func', ('symbol', 'descendants'), ('func', ('symbol', 'max'), ('string', '$1')))
+ (func
+ ('symbol', 'callinjection')
+ (range
+ ('symbol', '2')
+ ('symbol', '5')))
+ (func
+ ('symbol', 'descendants')
+ (func
+ ('symbol', 'max')
+ ('string', '$1')))
abort: unknown revision '$1'!
[255]
$ try 'd(2:5)'
- ('func', ('symbol', 'd'), ('range', ('symbol', '2'), ('symbol', '5')))
- ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('range', ('symbol', '2'), ('symbol', '5')), ('symbol', 'date'))))
+ (func
+ ('symbol', 'd')
+ (range
+ ('symbol', '2')
+ ('symbol', '5')))
+ (func
+ ('symbol', 'reverse')
+ (func
+ ('symbol', 'sort')
+ (list
+ (range
+ ('symbol', '2')
+ ('symbol', '5'))
+ ('symbol', 'date'))))
4
5
3
2
$ try 'rs(2 or 3, date)'
- ('func', ('symbol', 'rs'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date')))
- ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
+ (func
+ ('symbol', 'rs')
+ (list
+ (or
+ ('symbol', '2')
+ ('symbol', '3'))
+ ('symbol', 'date')))
+ (func
+ ('symbol', 'reverse')
+ (func
+ ('symbol', 'sort')
+ (list
+ (or
+ ('symbol', '2')
+ ('symbol', '3'))
+ ('symbol', 'date'))))
3
2
$ try 'rs()'
- ('func', ('symbol', 'rs'), None)
+ (func
+ ('symbol', 'rs')
+ None)
hg: parse error: invalid number of arguments: 0
[255]
$ try 'rs(2)'
- ('func', ('symbol', 'rs'), ('symbol', '2'))
+ (func
+ ('symbol', 'rs')
+ ('symbol', '2'))
hg: parse error: invalid number of arguments: 1
[255]
$ try 'rs(2, data, 7)'
- ('func', ('symbol', 'rs'), ('list', ('list', ('symbol', '2'), ('symbol', 'data')), ('symbol', '7')))
+ (func
+ ('symbol', 'rs')
+ (list
+ (list
+ ('symbol', '2')
+ ('symbol', 'data'))
+ ('symbol', '7')))
hg: parse error: invalid number of arguments: 3
[255]
$ try 'rs4(2 or 3, x, x, date)'
- ('func', ('symbol', 'rs4'), ('list', ('list', ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'x')), ('symbol', 'x')), ('symbol', 'date')))
- ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
+ (func
+ ('symbol', 'rs4')
+ (list
+ (list
+ (list
+ (or
+ ('symbol', '2')
+ ('symbol', '3'))
+ ('symbol', 'x'))
+ ('symbol', 'x'))
+ ('symbol', 'date')))
+ (func
+ ('symbol', 'reverse')
+ (func
+ ('symbol', 'sort')
+ (list
+ (or
+ ('symbol', '2')
+ ('symbol', '3'))
+ ('symbol', 'date'))))
3
2