Mercurial > public > mercurial-scm > hg
diff tests/test-revset.t @ 25385:a26a55406c0a
revrange: build balanced tree of addsets from revisions (issue4565)
This reduces the stack depth from O(n) to O(log(n)). Therefore, repeated
-rREV options will never exceed the Python stack limit.
Currently it depends on private revset._combinesets() function. But at some
point, we'll be able to drop the old-style parser, and revrange() can be
completely rewritten without using _combinesets():
trees = [parse(s) for s in revs]
optimize(('or',) + trees) # combine trees and optimize at once
...
Blockers that prevent eliminating old-style parser:
- nullary ":" operator
- revrange(repo, [intrev, ...]), can be mapped to 'rev(%d)' ?
- revrange(repo, [binnode, ...]), should be banned ?
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 24 May 2015 18:11:33 +0900 |
parents | 5909ac39b86a |
children | 015c0d1087a3 |
line wrap: on
line diff
--- a/tests/test-revset.t Sun May 24 17:59:55 2015 +0900 +++ b/tests/test-revset.t Sun May 24 18:11:33 2015 +0900 @@ -1084,6 +1084,13 @@ 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 xrange(500): print '-r 0::1 ',"` + 0 + 1 + check that conversion to only works $ try --optimize '::3 - ::1' (minus