##// END OF EJS Templates
revset: prevent crash caused by empty group expression while optimizing "and"...
Yuya Nishihara -
r25995:4f703dcc stable
parent child Browse files
Show More
@@ -2245,8 +2245,10 def optimize(x, small):
2245 # (::x and not ::y)/(not ::y and ::x) have a fast path
2245 # (::x and not ::y)/(not ::y and ::x) have a fast path
2246 def isonly(revs, bases):
2246 def isonly(revs, bases):
2247 return (
2247 return (
2248 revs[0] == 'func'
2248 revs is not None
2249 and revs[0] == 'func'
2249 and getstring(revs[1], _('not a symbol')) == 'ancestors'
2250 and getstring(revs[1], _('not a symbol')) == 'ancestors'
2251 and bases is not None
2250 and bases[0] == 'not'
2252 and bases[0] == 'not'
2251 and bases[1][0] == 'func'
2253 and bases[1][0] == 'func'
2252 and getstring(bases[1][1], _('not a symbol')) == 'ancestors')
2254 and getstring(bases[1][1], _('not a symbol')) == 'ancestors')
@@ -1230,6 +1230,23 check that conversion to only works
1230 5
1230 5
1231 6
1231 6
1232
1232
1233 no crash by empty group "()" while optimizing to "only()"
1234
1235 $ try --optimize '::1 and ()'
1236 (and
1237 (dagrangepre
1238 ('symbol', '1'))
1239 (group
1240 None))
1241 * optimized:
1242 (and
1243 None
1244 (func
1245 ('symbol', 'ancestors')
1246 ('symbol', '1')))
1247 hg: parse error: missing argument
1248 [255]
1249
1233 we can use patterns when searching for tags
1250 we can use patterns when searching for tags
1234
1251
1235 $ log 'tag("1..*")'
1252 $ log 'tag("1..*")'
General Comments 0
You need to be logged in to leave comments. Login now