--- a/mercurial/revset.py Mon Jul 06 22:01:41 2015 +0900
+++ b/mercurial/revset.py Sun Jul 05 12:15:54 2015 +0900
@@ -125,7 +125,7 @@
("dagrangepost", 17)),
"..": (17, None, ("dagrangepre", 17), ("dagrange", 17),
("dagrangepost", 17)),
- ":": (15, None, ("rangepre", 15), ("range", 15), ("rangepost", 15)),
+ ":": (15, "rangeall", ("rangepre", 15), ("range", 15), ("rangepost", 15)),
"not": (10, None, ("not", 10), None, None),
"!": (10, None, ("not", 10), None, None),
"and": (5, None, None, ("and", 5), None),
@@ -2227,6 +2227,8 @@
return optimize(('func', ('symbol', 'ancestors'), x[1]), small)
elif op == 'dagrangepost':
return optimize(('func', ('symbol', 'descendants'), x[1]), small)
+ elif op == 'rangeall':
+ return optimize(('range', ('string', '0'), ('string', 'tip')), small)
elif op == 'rangepre':
return optimize(('range', ('string', '0'), x[1]), small)
elif op == 'rangepost':
--- a/tests/test-revset.t Mon Jul 06 22:01:41 2015 +0900
+++ b/tests/test-revset.t Sun Jul 05 12:15:54 2015 +0900
@@ -117,6 +117,25 @@
<spanset+ 0:1>
0
1
+ $ try --optimize :
+ (rangeall
+ None)
+ * optimized:
+ (range
+ ('string', '0')
+ ('string', 'tip'))
+ * set:
+ <spanset+ 0:9>
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
$ try 3::6
(dagrange
('symbol', '3')