Mercurial > hg
view tests/test-revset2.t @ 46582:b0a3ca02d17a
copies-rust: implement PartialEqual manually
Now that we know that each (dest, rev) pair has at most a unique CopySource, we
can simplify comparison a lot.
This "simple" step buy a good share of the previous slowdown back in some case:
Repo Case Source-Rev Dest-Rev # of revisions old time new time Difference Factor time per rev
---------------------------------------------------------------------------------------------------------------------------------------------------------------
mozilla-try x00000_revs_x00000_added_x000_copies 9b2a99adc05e 8e29777b48e6 : 382065 revs, 43.304637 s, 34.443661 s, -8.860976 s, × 0.7954, 90 µs/rev
Full benchmark:
Repo Case Source-Rev Dest-Rev # of revisions old time new time Difference Factor time per rev
---------------------------------------------------------------------------------------------------------------------------------------------------------------
mercurial x_revs_x_added_0_copies ad6b123de1c7 39cfcef4f463 : 1 revs, 0.000043 s, 0.000043 s, +0.000000 s, × 1.0000, 43 µs/rev
mercurial x_revs_x_added_x_copies 2b1c78674230 0c1d10351869 : 6 revs, 0.000114 s, 0.000117 s, +0.000003 s, × 1.0263, 19 µs/rev
mercurial x000_revs_x000_added_x_copies 81f8ff2a9bf2 dd3267698d84 : 1032 revs, 0.004937 s, 0.004892 s, -0.000045 s, × 0.9909, 4 µs/rev
pypy x_revs_x_added_0_copies aed021ee8ae8 099ed31b181b : 9 revs, 0.000339 s, 0.000196 s, -0.000143 s, × 0.5782, 21 µs/rev
pypy x_revs_x000_added_0_copies 4aa4e1f8e19a 359343b9ac0e : 1 revs, 0.000049 s, 0.000050 s, +0.000001 s, × 1.0204, 50 µs/rev
pypy x_revs_x_added_x_copies ac52eb7bbbb0 72e022663155 : 7 revs, 0.000202 s, 0.000117 s, -0.000085 s, × 0.5792, 16 µs/rev
pypy x_revs_x00_added_x_copies c3b14617fbd7 ace7255d9a26 : 1 revs, 0.000409 s, 0.6f1f4a s, -0.000087 s, × 0.7873, 322 µs/rev
pypy x_revs_x000_added_x000_copies df6f7a526b60 a83dc6a2d56f : 6 revs, 0.011984 s, 0.011949 s, -0.000035 s, × 0.9971, 1991 µs/rev
pypy x000_revs_xx00_added_0_copies 89a76aede314 2f22446ff07e : 4785 revs, 0.050820 s, 0.050802 s, -0.000018 s, × 0.9996, 10 µs/rev
pypy x000_revs_x000_added_x_copies 8a3b5bfd266e 2c68e87c3efe : 6780 revs, 0.087953 s, 0.088090 s, +0.000137 s, × 1.0016, 12 µs/rev
pypy x000_revs_x000_added_x000_copies 89a76aede314 7b3dda341c84 : 5441 revs, 0.062902 s, 0.062079 s, -0.000823 s, × 0.9869, 11 µs/rev
pypy x0000_revs_x_added_0_copies d1defd0dc478 c9cb1334cc78 : 43645 revs, 0.679234 s, 0.635337 s, -0.043897 s, × 0.9354, 14 µs/rev
pypy x0000_revs_xx000_added_0_copies bf2c629d0071 4ffed77c095c : 2 revs, 0.013095 s, 0.013262 s, +0.000167 s, × 1.0128, 6631 µs/rev
pypy x0000_revs_xx000_added_x000_copies 08ea3258278e d9fa043f30c0 : 11316 revs, 0.120910 s, 0.120085 s, -0.000825 s, × 0.9932, 10 µs/rev
netbeans x_revs_x_added_0_copies fb0955ffcbcd a01e9239f9e7 : 2 revs, 0.000087 s, 0.000085 s, -0.000002 s, × 0.9770, 42 µs/rev
netbeans x_revs_x000_added_0_copies 6f360122949f 20eb231cc7d0 : 2 revs, 0.000107 s, 0.000110 s, +0.000003 s, × 1.0280, 55 µs/rev
netbeans x_revs_x_added_x_copies 1ada3faf6fb6 5a39d12eecf4 : 3 revs, 0.000186 s, 0.000177 s, -0.000009 s, × 0.9516, 59 µs/rev
netbeans x_revs_x00_added_x_copies 35be93ba1e2c 9eec5e90c05f : 9 revs, 0.000754 s, 0.000743 s, -0.000011 s, × 0.9854, 82 µs/rev
netbeans x000_revs_xx00_added_0_copies eac3045b4fdd 51d4ae7f1290 : 1421 revs, 0.010443 s, 0.010168 s, -0.000275 s, × 0.9737, 7 µs/rev
netbeans x000_revs_x000_added_x_copies e2063d266acd 6081d72689dc : 1533 revs, 0.015697 s, 0.015946 s, +0.000249 s, × 1.0159, 10 µs/rev
netbeans x000_revs_x000_added_x000_copies ff453e9fee32 411350406ec2 : 5750 revs, 0.063528 s, 0.062712 s, -0.000816 s, × 0.9872, 10 µs/rev
netbeans x0000_revs_xx000_added_x000_copies 588c2d1ced70 1aad62e59ddd : 66949 revs, 0.545515 s, 0.523832 s, -0.021683 s, × 0.9603, 7 µs/rev
mozilla-central x_revs_x_added_0_copies 3697f962bb7b 7015fcdd43a2 : 2 revs, 0.000089 s, 0.000090 s, +0.000001 s, × 1.0112, 45 µs/rev
mozilla-central x_revs_x000_added_0_copies dd390860c6c9 40d0c5bed75d : 8 revs, 0.000265 s, 0.000264 s, -0.000001 s, × 0.9962, 33 µs/rev
mozilla-central x_revs_x_added_x_copies 8d198483ae3b 14207ffc2b2f : 9 revs, 0.000381 s, 0.000187 s, -0.000194 s, × 0.4908, 20 µs/rev
mozilla-central x_revs_x00_added_x_copies 98cbc58cc6bc 446a150332c3 : 7 revs, 0.000672 s, 0.000665 s, -0.000007 s, × 0.9896, 95 µs/rev
mozilla-central x_revs_x000_added_x000_copies 3c684b4b8f68 0a5e72d1b479 : 3 revs, 0.003497 s, 0.003556 s, +0.000059 s, × 1.0169, 1185 µs/rev
mozilla-central x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.073204 s, 0.071345 s, -0.001859 s, × 0.9746, 11890 µs/rev
mozilla-central x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.006482 s, 0.006551 s, +0.000069 s, × 1.0106, 4 µs/rev
mozilla-central x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.005066 s, 0.005078 s, +0.000012 s, × 1.0024, 123 µs/rev
mozilla-central x000_revs_x000_added_x000_copies 7c97034feb78 4407bd0c6330 : 7839 revs, 0.065707 s, 0.065823 s, +0.000116 s, × 1.0018, 8 µs/rev
mozilla-central x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.026800 s, 0.027050 s, +0.000250 s, × 1.0093, 43 µs/rev
mozilla-central x0000_revs_xx000_added_x000_copies f78c615a656c 96a38b690156 : 30263 revs, 0.203856 s, 0.202443 s, -0.001413 s, × 0.9931, 6 µs/rev
mozilla-central x00000_revs_x0000_added_x0000_copies 6832ae71433c 4c222a1d9a00 : 153721 revs, 1.293394 s, 1.261583 s, -0.031811 s, × 0.9754, 8 µs/rev
mozilla-central x00000_revs_x00000_added_x000_copies 76caed42cf7c 1daa622bbe42 : 204976 revs, 1.698239 s, 1.643869 s, -0.054370 s, × 0.9680, 8 µs/rev
mozilla-try x_revs_x_added_0_copies aaf6dde0deb8 9790f499805a : 2 revs, 0.000875 s, 0.000868 s, -0.000007 s, × 0.9920, 434 µs/rev
mozilla-try x_revs_x000_added_0_copies d8d0222927b4 5bb8ce8c7450 : 2 revs, 0.000891 s, 0.000887 s, -0.000004 s, × 0.9955, 443 µs/rev
mozilla-try x_revs_x_added_x_copies 092fcca11bdb 936255a0384a : 4 revs, 0.000292 s, 0.000168 s, -0.000124 s, × 0.5753, 42 µs/rev
mozilla-try x_revs_x00_added_x_copies b53d2fadbdb5 017afae788ec : 2 revs, 0.003939 s, 0.001160 s, -0.002779 s, × 0.2945, 580 µs/rev
mozilla-try x_revs_x000_added_x000_copies 20408ad61ce5 6f0ee96e21ad : 1 revs, 0.033027 s, 0.033016 s, -0.000011 s, × 0.9997, 33016 µs/rev
mozilla-try x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.073703 s, 0.073312 s, -0.39ae31 s, × 0.9947, 12218 µs/rev
mozilla-try x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.006469 s, 0.006485 s, +0.000016 s, × 1.0025, 4 µs/rev
mozilla-try x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.005278 s, 0.005494 s, +0.000216 s, × 1.0409, 134 µs/rev
mozilla-try x000_revs_x000_added_x000_copies 1346fd0130e4 4c65cbdabc1f : 6657 revs, 0.064995 s, 0.064879 s, -0.000116 s, × 0.9982, 9 µs/rev
mozilla-try x0000_revs_x_added_0_copies 63519bfd42ee a36a2a865d92 : 40314 revs, 0.301041 s, 0.301469 s, +0.000428 s, × 1.0014, 7 µs/rev
mozilla-try x0000_revs_x_added_x_copies 9fe69ff0762d bcabf2a78927 : 38690 revs, 0.285575 s, 0.297113 s, +0.011538 s, × 1.0404, 7 µs/rev
mozilla-try x0000_revs_xx000_added_x_copies 156f6e2674f2 4d0f2c178e66 : 8598 revs, 0.085597 s, 0.085890 s, +0.000293 s, × 1.0034, 9 µs/rev
mozilla-try x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.027118 s, 0.027718 s, +0.000600 s, × 1.0221, 45 µs/rev
mozilla-try x0000_revs_xx000_added_x000_copies 89294cd501d9 7ccb2fc7ccb5 : 97052 revs, 2.119204 s, 2.048949 s, -0.070255 s, × 0.9668, 21 µs/rev
mozilla-try x0000_revs_x0000_added_x0000_copies e928c65095ed e951f4ad123a : 52031 revs, 0.701479 s, 0.685924 s, -0.015555 s, × 0.9778, 13 µs/rev
mozilla-try x00000_revs_x_added_0_copies 6a320851d377 1ebb79acd503 : 363753 revs, 4.482399 s, 4.482891 s, +0.000492 s, × 1.0001, 12 µs/rev
mozilla-try x00000_revs_x00000_added_0_copies dc8a3ca7010e d16fde900c9c : 34414 revs, 0.574082 s, 0.577633 s, +0.003551 s, × 1.0062, 16 µs/rev
mozilla-try x00000_revs_x_added_x_copies 5173c4b6f97c 95d83ee7242d : 362229 revs, 4.480366 s, 4.397816 s, -0.082550 s, × 0.9816, 12 µs/rev
mozilla-try x00000_revs_x000_added_x_copies 9126823d0e9c ca82787bb23c : 359344 revs, 4.369070 s, 4.370538 s, +0.001468 s, × 1.0003, 12 µs/rev
mozilla-try x00000_revs_x0000_added_x0000_copies 8d3fafa80d4b eb884023b810 : 192665 revs, 1.592506 s, 1.570439 s, -0.022067 s, × 0.9861, 8 µs/rev
mozilla-try x00000_revs_x00000_added_x0000_copies 1b661134e2ca 1ae03d022d6d : 228985 revs, 87.824489 s, 88.388512 s, +0.564023 s, × 1.0064, 386 µs/rev
mozilla-try x00000_revs_x00000_added_x000_copies 9b2a99adc05e 8e29777b48e6 : 382065 revs, 43.304637 s, 34.443661 s, -8.860976 s, × 0.7954, 90 µs/rev
private : 459513 revs, 33.853687 s, 27.370148 s, -6.483539 s, × 0.8085, 59 µs/rev
Differential Revision: https://phab.mercurial-scm.org/D9653
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 16 Dec 2020 11:11:05 +0100 |
parents | 95c4cca641f6 |
children | 7d908ee19b5b |
line wrap: on
line source
$ HGENCODING=utf-8 $ export HGENCODING $ cat >> $HGRCPATH << EOF > [extensions] > drawdag=$TESTDIR/drawdag.py > EOF $ try() { > hg debugrevspec --debug "$@" > } $ log() { > hg log --template '{rev}\n' -r "$1" > } $ hg init repo $ cd repo $ echo a > a $ hg branch a marked working directory as branch a (branches are permanent and global, did you want a bookmark?) $ hg ci -Aqm0 $ echo b > b $ hg branch b marked working directory as branch b $ hg ci -Aqm1 $ rm a $ hg branch a-b-c- marked working directory as branch a-b-c- $ hg ci -Aqm2 -u Bob $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' 2 $ hg log -r "extra('branch')" --template '{rev}\n' 0 1 2 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' 0 a 2 a-b-c- $ hg co 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch +a+b+c+ marked working directory as branch +a+b+c+ $ hg ci -Aqm3 $ hg co 2 # interleave 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bb > b $ hg branch -- -a-b-c- marked working directory as branch -a-b-c- $ hg ci -Aqm4 -d "May 12 2005" $ hg co 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch !a/b/c/ marked working directory as branch !a/b/c/ $ hg ci -Aqm"5 bug" $ hg merge 4 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg branch _a_b_c_ marked working directory as branch _a_b_c_ $ hg ci -Aqm"6 issue619" $ hg branch .a.b.c. marked working directory as branch .a.b.c. $ hg ci -Aqm7 $ hg branch all marked working directory as branch all $ hg co 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch é marked working directory as branch \xc3\xa9 (esc) $ hg ci -Aqm9 $ hg tag -r6 1.0 $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $ hg clone --quiet -U -r 7 . ../remote1 $ hg clone --quiet -U -r 8 . ../remote2 $ echo "[paths]" >> .hg/hgrc $ echo "default = ../remote1" >> .hg/hgrc test subtracting something from an addset $ log '(outgoing() or removes(a)) - removes(a)' 8 9 test intersecting something with an addset $ log 'parents(outgoing() or removes(a))' 1 4 8 test that `or` operation combines elements in the right order: $ log '3:4 or 2:5' 3 4 2 5 $ log '3:4 or 5:2' 3 4 5 2 $ log 'sort(3:4 or 2:5)' 2 3 4 5 $ log 'sort(3:4 or 5:2)' 2 3 4 5 test that more than one `-r`s are combined in the right order and deduplicated: $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' 3 4 5 2 0 1 test that `or` operation skips duplicated revisions from right-hand side $ try 'reverse(1::5) or ancestors(4)' (or (list (func (symbol 'reverse') (dagrange (symbol '1') (symbol '5'))) (func (symbol 'ancestors') (symbol '4')))) * set: <addset <baseset- [1, 3, 5]>, <generatorsetdesc+>> 5 3 1 0 2 4 $ try 'sort(ancestors(4) or reverse(1::5))' (func (symbol 'sort') (or (list (func (symbol 'ancestors') (symbol '4')) (func (symbol 'reverse') (dagrange (symbol '1') (symbol '5')))))) * set: <addset+ <generatorsetdesc+>, <baseset- [1, 3, 5]>> 0 1 2 3 4 5 test optimization of trivial `or` operation $ try --optimize '0|(1)|"2"|-2|tip|null' (or (list (symbol '0') (group (symbol '1')) (string '2') (negate (symbol '2')) (symbol 'tip') (symbol 'null'))) * optimized: (func (symbol '_list') (string '0\x001\x002\x00-2\x00tip\x00null')) * set: <baseset [0, 1, 2, 8, 9, -1]> 0 1 2 8 9 -1 $ try --optimize '0|1|2:3' (or (list (symbol '0') (symbol '1') (range (symbol '2') (symbol '3')))) * optimized: (or (list (func (symbol '_list') (string '0\x001')) (range (symbol '2') (symbol '3')))) * set: <addset <baseset [0, 1]>, <spanset+ 2:4>> 0 1 2 3 $ try --optimize '0:1|2|3:4|5|6' (or (list (range (symbol '0') (symbol '1')) (symbol '2') (range (symbol '3') (symbol '4')) (symbol '5') (symbol '6'))) * optimized: (or (list (range (symbol '0') (symbol '1')) (symbol '2') (range (symbol '3') (symbol '4')) (func (symbol '_list') (string '5\x006')))) * set: <addset <addset <spanset+ 0:2>, <baseset [2]>>, <addset <spanset+ 3:5>, <baseset [5, 6]>>> 0 1 2 3 4 5 6 unoptimized `or` looks like this $ try --no-optimized -p analyzed '0|1|2|3|4' * analyzed: (or (list (symbol '0') (symbol '1') (symbol '2') (symbol '3') (symbol '4'))) * set: <addset <addset <baseset [0]>, <baseset [1]>>, <addset <baseset [2]>, <addset <baseset [3]>, <baseset [4]>>>> 0 1 2 3 4 test that `_list` should be narrowed by provided `subset` $ log '0:2 and (null|1|2|3)' 1 2 test that `_list` should remove duplicates $ log '0|1|2|1|2|-1|tip' 0 1 2 9 test unknown revision in `_list` $ log '0|unknown' abort: unknown revision 'unknown' [255] test integer range in `_list` $ log '-1|-10' 9 0 $ log '-10|-11' abort: unknown revision '-11' [255] $ log '9|10' abort: unknown revision '10' [255] test '0000' != '0' in `_list` $ log '0|0000' 0 -1 test ',' in `_list` $ log '0,1' hg: parse error: can't use a list in this context (see 'hg help "revsets.x or y"') [10] $ try '0,1,2' (list (symbol '0') (symbol '1') (symbol '2')) hg: parse error: can't use a list in this context (see 'hg help "revsets.x or y"') [10] test that chained `or` operations make balanced addsets $ try '0:1|1:2|2:3|3:4|4:5' (or (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')) (range (symbol '3') (symbol '4')) (range (symbol '4') (symbol '5')))) * set: <addset <addset <spanset+ 0:2>, <spanset+ 1:3>>, <addset <spanset+ 2:4>, <addset <spanset+ 3:5>, <spanset+ 4:6>>>> 0 1 2 3 4 5 no crash by empty group "()" while optimizing `or` operations $ try --optimize '0|()' (or (list (symbol '0') (group None))) * optimized: (or (list (symbol '0') None)) hg: parse error: missing argument [10] test that chained `or` operations never eat up stack (issue4624) (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) $ hg log -T '{rev}\n' -r `"$PYTHON" -c "print('+'.join(['0:1'] * 500))"` 0 1 test that repeated `-r` options never eat up stack (issue4565) (uses `-r 0::1` to avoid possible optimization at old-style parser) $ hg log -T '{rev}\n' `"$PYTHON" -c "for i in range(500): print('-r 0::1 ')"` 0 1 check that conversion to only works $ try --optimize '::3 - ::1' (minus (dagrangepre (symbol '3')) (dagrangepre (symbol '1'))) * optimized: (func (symbol 'only') (list (symbol '3') (symbol '1'))) * set: <baseset+ [3]> 3 $ try --optimize 'ancestors(1) - ancestors(3)' (minus (func (symbol 'ancestors') (symbol '1')) (func (symbol 'ancestors') (symbol '3'))) * optimized: (func (symbol 'only') (list (symbol '1') (symbol '3'))) * set: <baseset+ []> $ try --optimize 'not ::2 and ::6' (and (not (dagrangepre (symbol '2'))) (dagrangepre (symbol '6'))) * optimized: (func (symbol 'only') (list (symbol '6') (symbol '2'))) * set: <baseset+ [3, 4, 5, 6]> 3 4 5 6 $ try --optimize 'ancestors(6) and not ancestors(4)' (and (func (symbol 'ancestors') (symbol '6')) (not (func (symbol 'ancestors') (symbol '4')))) * optimized: (func (symbol 'only') (list (symbol '6') (symbol '4'))) * set: <baseset+ [3, 5, 6]> 3 5 6 no crash by empty group "()" while optimizing to "only()" $ try --optimize '::1 and ()' (and (dagrangepre (symbol '1')) (group None)) * optimized: (andsmally (func (symbol 'ancestors') (symbol '1')) None) hg: parse error: missing argument [10] optimization to only() works only if ancestors() takes only one argument $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' * optimized: (difference (func (symbol 'ancestors') (symbol '6')) (func (symbol 'ancestors') (list (symbol '4') (symbol '1')))) 0 1 3 5 6 $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' * optimized: (difference (func (symbol 'ancestors') (list (symbol '6') (symbol '1'))) (func (symbol 'ancestors') (symbol '4'))) 5 6 optimization disabled if keyword arguments passed (because we're too lazy to support it) $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' * optimized: (difference (func (symbol 'ancestors') (keyvalue (symbol 'set') (symbol '6'))) (func (symbol 'ancestors') (keyvalue (symbol 'set') (symbol '4')))) 3 5 6 invalid function call should not be optimized to only() $ log '"ancestors"(6) and not ancestors(4)' hg: parse error: not a symbol [10] $ log 'ancestors(6) and not "ancestors"(4)' hg: parse error: not a symbol [10] test empty string $ log '' hg: parse error: empty query [10] $ log 'parents("")' hg: parse error: empty string is not a valid revision [10] test empty revset $ hg log 'none()' we can use patterns when searching for tags $ log 'tag("1..*")' abort: tag '1..*' does not exist [255] $ log 'tag("re:1..*")' 6 $ log 'tag("re:[0-9].[0-9]")' 6 $ log 'tag("literal:1.0")' 6 $ log 'tag("re:0..*")' $ log 'tag(unknown)' abort: tag 'unknown' does not exist [255] $ log 'tag("re:unknown")' $ log 'present(tag("unknown"))' $ log 'present(tag("re:unknown"))' $ log 'branch(unknown)' abort: unknown revision 'unknown' [255] $ log 'branch("literal:unknown")' abort: branch 'unknown' does not exist [255] $ log 'branch("re:unknown")' $ log 'present(branch("unknown"))' $ log 'present(branch("re:unknown"))' $ log 'user(bob)' 2 $ log '4::8' 4 8 $ log '4:8' 4 5 6 7 8 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' 4 2 5 $ log 'not 0 and 0:2' 1 2 $ log 'not 1 and 0:2' 0 2 $ log 'not 2 and 0:2' 0 1 $ log '(1 and 2)::' $ log '(1 and 2):' $ log '(1 and 2):3' $ log 'sort(head(), -rev)' 9 7 6 5 4 3 2 1 0 $ log '4::8 - 8' 4 matching() should preserve the order of the input set: $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' 2 3 1 $ log 'named("unknown")' abort: namespace 'unknown' does not exist [255] $ log 'named("re:unknown")' $ log 'present(named("unknown"))' $ log 'present(named("re:unknown"))' $ log 'tag()' 6 $ log 'named("tags")' 6 issue2437 $ log '3 and p1(5)' 3 $ log '4 and p2(6)' 4 $ log '1 and parents(:2)' 1 $ log '2 and children(1:)' 2 $ log 'roots(all()) or roots(all())' 0 $ hg debugrevspec 'roots(all()) or roots(all())' 0 $ log 'heads(branch(é)) or heads(branch(é))' 9 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(é)))' 4 issue2654: report a parse error if the revset was not completely parsed $ log '1 OR 2' hg: parse error at 2: invalid token (1 OR 2 ^ here) [10] or operator should preserve ordering: $ log 'reverse(2::4) or tip' 4 2 9 parentrevspec $ log 'merge()^0' 6 $ log 'merge()^' 5 $ log 'merge()^1' 5 $ log 'merge()^2' 4 $ log '(not merge())^2' $ log 'merge()^^' 3 $ log 'merge()^1^' 3 $ log 'merge()^^^' 1 $ hg debugrevspec -s '(merge() | 0)~-1' * set: <baseset+ [1, 7]> 1 7 $ log 'merge()~-1' 7 $ log 'tip~-1' $ log '(tip | merge())~-1' 7 $ log 'merge()~0' 6 $ log 'merge()~1' 5 $ log 'merge()~2' 3 $ log 'merge()~2^1' 1 $ log 'merge()~3' 1 $ log '(-3:tip)^' 4 6 8 $ log 'tip^foo' hg: parse error: ^ expects a number 0, 1, or 2 [10] $ log 'branchpoint()~-1' abort: revision in set has more than one child [255] Bogus function gets suggestions $ log 'add()' hg: parse error: unknown identifier: add (did you mean adds?) [10] $ log 'added()' hg: parse error: unknown identifier: added (did you mean adds?) [10] $ log 'remo()' hg: parse error: unknown identifier: remo (did you mean one of remote, removes?) [10] $ log 'babar()' hg: parse error: unknown identifier: babar [10] Bogus function with a similar internal name doesn't suggest the internal name $ log 'matches()' hg: parse error: unknown identifier: matches (did you mean matching?) [10] Undocumented functions aren't suggested as similar either $ log 'tagged2()' hg: parse error: unknown identifier: tagged2 [10] multiple revspecs $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' 8 9 4 5 6 7 test usage in revpair (with "+") (real pair) $ hg diff -r 'tip^^' -r 'tip' diff -r 2326846efdab -r d2e607fcf9e4 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0 $ hg diff -r 'tip^^::tip' diff -r 2326846efdab -r d2e607fcf9e4 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0 (single rev) $ hg diff -r 'tip^' -r 'tip^' $ hg diff -r 'tip^:tip^' (single rev that does not looks like a range) $ hg diff -r 'tip^::tip^ or tip^' diff -r d5d0dcbdc4d9 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags * (glob) @@ -0,0 +1,1 @@ +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0 $ hg diff -r 'tip^ or tip^' diff -r d5d0dcbdc4d9 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags * (glob) @@ -0,0 +1,1 @@ +d5e6808a86077d6f5c1ff626d4352d01da7d2a1f 1.0 (no rev) $ hg diff -r 'author("babar") or author("celeste")' abort: empty revision range [255] aliases: $ echo '[revsetalias]' >> .hg/hgrc $ echo 'm = merge()' >> .hg/hgrc (revset aliases can override builtin revsets) $ echo 'p2($1) = p1($1)' >> .hg/hgrc $ echo 'sincem = descendants(m)' >> .hg/hgrc $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc $ try m (symbol 'm') * expanded: (func (symbol 'merge') None) * set: <filteredset <fullreposet+ 0:10>, <merge>> 6 $ HGPLAIN=1 $ export HGPLAIN $ try m (symbol 'm') abort: unknown revision 'm' [255] $ HGPLAINEXCEPT=revsetalias $ export HGPLAINEXCEPT $ try m (symbol 'm') * expanded: (func (symbol 'merge') None) * set: <filteredset <fullreposet+ 0:10>, <merge>> 6 $ unset HGPLAIN $ unset HGPLAINEXCEPT $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * expanded: (func (symbol 'p1') (symbol '.')) * set: <baseset+ [8]> 8 $ HGPLAIN=1 $ export HGPLAIN $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * set: <baseset+ []> $ HGPLAINEXCEPT=revsetalias $ export HGPLAINEXCEPT $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * expanded: (func (symbol 'p1') (symbol '.')) * set: <baseset+ [8]> 8 $ unset HGPLAIN $ unset HGPLAINEXCEPT test alias recursion $ try sincem (symbol 'sincem') * expanded: (func (symbol 'descendants') (func (symbol 'merge') None)) * set: <generatorsetasc+> 6 7 test infinite recursion $ echo 'recurse1 = recurse2' >> .hg/hgrc $ echo 'recurse2 = recurse1' >> .hg/hgrc $ try recurse1 (symbol 'recurse1') hg: parse error: infinite expansion of revset alias "recurse1" detected [10] $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc $ try "level2(level1(1, 2), 3)" (func (symbol 'level2') (list (func (symbol 'level1') (list (symbol '1') (symbol '2'))) (symbol '3'))) * expanded: (or (list (symbol '3') (or (list (symbol '1') (symbol '2'))))) * set: <addset <baseset [3]>, <baseset [1, 2]>> 3 1 2 test nesting and variable passing $ echo 'nested($1) = nested2($1)' >> .hg/hgrc $ 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'))) * expanded: (func (symbol 'max') (range (symbol '2') (symbol '5'))) * set: <baseset <max <fullreposet+ 0:10>, <spanset+ 2:6>>> 5 test chained `or` operations are flattened at parsing phase $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc $ try 'chainedorops(0:1, 1:2, 2:3)' (func (symbol 'chainedorops') (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')))) * expanded: (or (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')))) * set: <addset <spanset+ 0:2>, <addset <spanset+ 1:3>, <spanset+ 2:4>>> 0 1 2 3 test variable isolation, variable placeholders are rewritten as string then parsed and matched again as string. Check they do not leak too far away. $ 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'))) * expanded: (func (symbol 'descendants') (func (symbol 'max') (string '$1'))) abort: unknown revision '$1' [255] test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', but 'all()' should never be substituted to '0()'. $ echo 'universe = all()' >> .hg/hgrc $ echo 'shadowall(all) = all and universe' >> .hg/hgrc $ try 'shadowall(0)' (func (symbol 'shadowall') (symbol '0')) * expanded: (and (symbol '0') (func (symbol 'all') None)) * set: <filteredset <baseset [0]>, <spanset+ 0:10>> 0 test unknown reference: $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' (func (symbol 'unknownref') (symbol '0')) abort: bad definition of revset alias "unknownref": invalid symbol '$2' [255] $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" (symbol 'tip') warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end * set: <baseset [9]> 9 $ try 'tip' (symbol 'tip') * set: <baseset [9]> 9 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" (symbol 'tip') warning: bad declaration of revset alias "bad name": at 4: invalid token * set: <baseset [9]> 9 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc $ try 'strictreplacing("foo", tip)' (func (symbol 'strictreplacing') (list (string 'foo') (symbol 'tip'))) * expanded: (or (list (symbol 'tip') (func (symbol 'desc') (string '$1')))) * set: <addset <baseset [9]>, <filteredset <fullreposet+ 0:10>, <desc '$1'>>> 9 $ try 'd(2:5)' (func (symbol 'd') (range (symbol '2') (symbol '5'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (range (symbol '2') (symbol '5')) (symbol 'date')))) * set: <baseset [4, 5, 3, 2]> 4 5 3 2 $ try 'rs(2 or 3, date)' (func (symbol 'rs') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date')))) * set: <baseset [3, 2]> 3 2 $ try 'rs()' (func (symbol 'rs') None) hg: parse error: invalid number of arguments: 0 [10] $ try 'rs(2)' (func (symbol 'rs') (symbol '2')) hg: parse error: invalid number of arguments: 1 [10] $ try 'rs(2, data, 7)' (func (symbol 'rs') (list (symbol '2') (symbol 'data') (symbol '7'))) hg: parse error: invalid number of arguments: 3 [10] $ try 'rs4(2 or 3, x, x, date)' (func (symbol 'rs4') (list (or (list (symbol '2') (symbol '3'))) (symbol 'x') (symbol 'x') (symbol 'date'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date')))) * set: <baseset [3, 2]> 3 2 issue4553: check that revset aliases override existing hash prefix $ hg log -qr d5e 6:d5e6808a8607 $ hg log -qr d5e --config revsetalias.d5e="all()" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:d5e6808a8607 7:586353d483b3 8:d5d0dcbdc4d9 9:d2e607fcf9e4 $ hg log -qr d5e: --config revsetalias.d5e="0" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:d5e6808a8607 7:586353d483b3 8:d5d0dcbdc4d9 9:d2e607fcf9e4 $ hg log -qr :d5e --config revsetalias.d5e="9" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:d5e6808a8607 7:586353d483b3 8:d5d0dcbdc4d9 9:d2e607fcf9e4 $ hg log -qr d5e: 6:d5e6808a8607 7:586353d483b3 8:d5d0dcbdc4d9 9:d2e607fcf9e4 $ hg log -qr :d5e 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:d5e6808a8607 issue2549 - correct optimizations $ try 'limit(1 or 2 or 3, 2) and not 2' (and (func (symbol 'limit') (list (or (list (symbol '1') (symbol '2') (symbol '3'))) (symbol '2'))) (not (symbol '2'))) * set: <filteredset <baseset [1, 2]>, <not <baseset [2]>>> 1 $ try 'max(1 or 2) and not 2' (and (func (symbol 'max') (or (list (symbol '1') (symbol '2')))) (not (symbol '2'))) * set: <filteredset <baseset <max <fullreposet+ 0:10>, <baseset [1, 2]>>>, <not <baseset [2]>>> $ try 'min(1 or 2) and not 1' (and (func (symbol 'min') (or (list (symbol '1') (symbol '2')))) (not (symbol '1'))) * set: <filteredset <baseset <min <fullreposet+ 0:10>, <baseset [1, 2]>>>, <not <baseset [1]>>> $ try 'last(1 or 2, 1) and not 2' (and (func (symbol 'last') (list (or (list (symbol '1') (symbol '2'))) (symbol '1'))) (not (symbol '2'))) * set: <filteredset <baseset [2]>, <not <baseset [2]>>> issue4289 - ordering of built-ins $ hg log -M -q -r 3:2 3:8528aa5637f2 2:5ed5505e9f1c test revsets started with 40-chars hash (issue3669) $ ISSUE3669_TIP=`hg tip --template '{node}'` $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' 9 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' 8 test or-ed indirect predicates (issue3775) $ log '6 or 6^1' | sort 5 6 $ log '6^1 or 6' | sort 5 6 $ log '4 or 4~1' | sort 2 4 $ log '4~1 or 4' | sort 2 4 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort 0 1 2 3 4 5 6 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort 0 1 2 3 4 5 6 tests for 'remote()' predicate: #. (csets in remote) (id) (remote) 1. less than local current branch "default" 2. same with local specified "default" 3. more than local specified specified $ hg clone --quiet -U . ../remote3 $ cd ../remote3 $ hg update -q 7 $ echo r > r $ hg ci -Aqm 10 $ log 'remote()' 7 $ log 'remote("a-b-c-")' 2 $ cd ../repo $ log 'remote(".a.b.c.", "../remote3")' tests for concatenation of strings/symbols by "##" $ try "278 ## '5f5' ## 1ee ## 'ce5'" (_concat (_concat (_concat (symbol '278') (string '5f5')) (symbol '1ee')) (string 'ce5')) * concatenated: (string '2785f51eece5') * set: <baseset [0]> 0 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc $ try "cat4(278, '5f5', 1ee, 'ce5')" (func (symbol 'cat4') (list (symbol '278') (string '5f5') (symbol '1ee') (string 'ce5'))) * expanded: (_concat (_concat (_concat (symbol '278') (string '5f5')) (symbol '1ee')) (string 'ce5')) * concatenated: (string '2785f51eece5') * set: <baseset [0]> 0 (check concatenation in alias nesting) $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc $ log "cat2x2(278, '5f5', 1ee, 'ce5')" 0 (check operator priority) $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc $ log "cat2n2(2785f5, 1eece5, d2e607, fcf9e4)" 0 4 $ cd .. prepare repository that has "default" branches of multiple roots $ hg init namedbranch $ cd namedbranch $ echo default0 >> a $ hg ci -Aqm0 $ echo default1 >> a $ hg ci -m1 $ hg branch -q stable $ echo stable2 >> a $ hg ci -m2 $ echo stable3 >> a $ hg ci -m3 $ hg update -q null $ echo default4 >> a $ hg ci -Aqm4 $ echo default5 >> a $ hg ci -m5 "null" revision belongs to "default" branch (issue4683) $ log 'branch(null)' 0 1 4 5 "null" revision belongs to "default" branch, but it shouldn't appear in set unless explicitly specified (issue4682) $ log 'children(branch(default))' 1 2 5 $ cd .. test author/desc/keyword in problematic encoding # unicode: cp932: # u30A2 0x83 0x41(= 'A') # u30C2 0x83 0x61(= 'a') $ hg init problematicencoding $ cd problematicencoding $ "$PYTHON" <<EOF > open('setup.sh', 'wb').write(u''' > echo a > text > hg add text > hg --encoding utf-8 commit -u '\u30A2' -m none > echo b > text > hg --encoding utf-8 commit -u '\u30C2' -m none > echo c > text > hg --encoding utf-8 commit -u none -m '\u30A2' > echo d > text > hg --encoding utf-8 commit -u none -m '\u30C2' > '''.encode('utf-8')) > EOF $ sh < setup.sh test in problematic encoding $ "$PYTHON" <<EOF > open('test.sh', 'wb').write(u''' > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' > '''.encode('cp932')) > EOF $ sh < test.sh 0 ==== 1 ==== 2 ==== 3 ==== 0 2 ==== 1 3 test error message of bad revset $ hg log -r 'foo\\' hg: parse error at 3: syntax error in revset 'foo\\' (foo\\ ^ here) [10] $ cd .. Test that revset predicate of extension isn't loaded at failure of loading it $ cd repo $ cat <<EOF > $TESTTMP/custompredicate.py > from mercurial import error, registrar, revset > > revsetpredicate = registrar.revsetpredicate() > > @revsetpredicate(b'custom1()') > def custom1(repo, subset, x): > return revset.baseset([1]) > > raise error.Abort(b'intentional failure of loading extension') > EOF $ cat <<EOF > .hg/hgrc > [extensions] > custompredicate = $TESTTMP/custompredicate.py > EOF $ hg debugrevspec "custom1()" *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension hg: parse error: unknown identifier: custom1 [10] Test repo.anyrevs with customized revset overrides $ cat > $TESTTMP/printprevset.py <<EOF > from mercurial import encoding, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'printprevset') > def printprevset(ui, repo): > alias = {} > p = encoding.environ.get(b'P') > if p: > alias[b'P'] = p > revs = repo.anyrevs([b'P'], user=True, localalias=alias) > ui.write(b'P=%r\n' % list(revs)) > EOF $ cat >> .hg/hgrc <<EOF > custompredicate = ! > printprevset = $TESTTMP/printprevset.py > EOF $ unset P $ hg --config revsetalias.P=1 printprevset P=[1] $ P=3 hg --config revsetalias.P=2 printprevset P=[3] $ cd .. Test obsstore related revsets $ hg init repo1 $ cd repo1 $ cat <<EOF >> .hg/hgrc > [experimental] > evolution.createmarkers=True > EOF $ hg debugdrawdag <<'EOS' > F G > |/ # split: B -> E, F > B C D E # amend: B -> C -> D > \|/ | # amend: F -> G > A A Z # amend: A -> Z > EOS 3 new orphan changesets 3 new content-divergent changesets $ hg log -r 'successors(Z)' -T '{desc}\n' Z $ hg log -r 'successors(F)' -T '{desc}\n' F G $ hg tag --remove --local C D E F G $ hg log -r 'successors(B)' -T '{desc}\n' B D E G $ hg log -r 'successors(B)' -T '{desc}\n' --hidden B C D E F G $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden D E G $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' A Z B $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' Z Test `draft() & ::x` optimization $ hg init $TESTTMP/repo2 $ cd $TESTTMP/repo2 $ hg debugdrawdag <<'EOS' > P5 S1 > | | > S2 | D3 > \|/ > P4 > | > P3 D2 > | | > P2 D1 > |/ > P1 > | > P0 > EOS $ hg phase --public -r P5 $ hg phase --force --secret -r S1+S2 $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' o 8 P5 public | | o 10 S1 secret | | | o 7 D3 draft |/ | o 9 S2 secret |/ o 6 P4 public | o 5 P3 public | o 3 P2 public | | o 4 D2 draft | | | o 2 D1 draft |/ o 1 P1 public | o 0 P0 public $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' * analyzed: (and (func (symbol 'draft') None) (func (symbol 'ancestors') (or (list (and (or (list (symbol 'S1') (symbol 'D1') (symbol 'P5'))) (not (symbol 'D3'))) (symbol 'S2'))))) * optimized: (func (symbol '_phaseandancestors') (list (symbol 'draft') (or (list (difference (func (symbol '_list') (string 'S1\x00D1\x00P5')) (symbol 'D3')) (symbol 'S2'))))) $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' * analyzed: (and (func (symbol 'secret') None) (func (symbol 'ancestors') (symbol '9'))) * optimized: (func (symbol '_phaseandancestors') (list (symbol 'secret') (symbol '9'))) $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' * analyzed: (and (symbol '7') (and (not (func (symbol 'public') None)) (func (symbol 'ancestors') (func (symbol 'tag') None)))) * optimized: (and (symbol '7') (func (symbol '_phaseandancestors') (list (symbol '_notpublic') (func (symbol 'tag') None)))) $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' * optimized: (and (func (symbol '_notpublic') None) (func (symbol 'ancestors') (list (func (symbol '_list') (string 'S1\x00D2\x00P5')) (symbol '1')))) $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' * optimized: (and (func (symbol '_notpublic') None) (func (symbol 'ancestors') (list (func (symbol '_list') (string 'S1\x00D2\x00P5')) (keyvalue (symbol 'depth') (symbol '1'))))) test commonancestors and its optimization $ hg debugrevspec --verify -p analyzed -p optimized 'heads(commonancestors(head()))' * analyzed: (func (symbol 'heads') (func (symbol 'commonancestors') (func (symbol 'head') None))) * optimized: (func (symbol '_commonancestorheads') (func (symbol 'head') None))