Comments
Patch
@@ -2245,8 +2245,10 @@ def optimize(x, small):
# (::x and not ::y)/(not ::y and ::x) have a fast path
def isonly(revs, bases):
return (
- revs[0] == 'func'
+ revs is not None
+ and revs[0] == 'func'
and getstring(revs[1], _('not a symbol')) == 'ancestors'
+ and bases is not None
and bases[0] == 'not'
and bases[1][0] == 'func'
and getstring(bases[1][1], _('not a symbol')) == 'ancestors')
@@ -1230,6 +1230,23 @@ check that conversion to only works
5
6
+no crash by empty group "()" while optimizing to "only()"
+
+ $ try --optimize '::1 and ()'
+ (and
+ (dagrangepre
+ ('symbol', '1'))
+ (group
+ None))
+ * optimized:
+ (and
+ None
+ (func
+ ('symbol', 'ancestors')
+ ('symbol', '1')))
+ hg: parse error: missing argument
+ [255]
+
we can use patterns when searching for tags
$ log 'tag("1..*")'