comparison mercurial/revset.py @ 25998:a7527c5769bb

merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 10 Aug 2015 15:30:28 -0500
parents e9cd028f2dff b12e00a05d57
children 748053b4a66b
comparison
equal deleted inserted replaced
25994:d6beeb618700 25998:a7527c5769bb
2274 wb, tb = optimize(x[2], True) 2274 wb, tb = optimize(x[2], True)
2275 2275
2276 # (::x and not ::y)/(not ::y and ::x) have a fast path 2276 # (::x and not ::y)/(not ::y and ::x) have a fast path
2277 def isonly(revs, bases): 2277 def isonly(revs, bases):
2278 return ( 2278 return (
2279 revs[0] == 'func' 2279 revs is not None
2280 and revs[0] == 'func'
2280 and getstring(revs[1], _('not a symbol')) == 'ancestors' 2281 and getstring(revs[1], _('not a symbol')) == 'ancestors'
2282 and bases is not None
2281 and bases[0] == 'not' 2283 and bases[0] == 'not'
2282 and bases[1][0] == 'func' 2284 and bases[1][0] == 'func'
2283 and getstring(bases[1][1], _('not a symbol')) == 'ancestors') 2285 and getstring(bases[1][1], _('not a symbol')) == 'ancestors')
2284 2286
2285 w = min(wa, wb) 2287 w = min(wa, wb)
2307 ws.append(w) 2309 ws.append(w)
2308 ts.append(t) 2310 ts.append(t)
2309 del ss[:] 2311 del ss[:]
2310 for y in x[1:]: 2312 for y in x[1:]:
2311 w, t = optimize(y, False) 2313 w, t = optimize(y, False)
2312 if t[0] == 'string' or t[0] == 'symbol': 2314 if t is not None and (t[0] == 'string' or t[0] == 'symbol'):
2313 ss.append((w, t)) 2315 ss.append((w, t))
2314 continue 2316 continue
2315 flushss() 2317 flushss()
2316 ws.append(w) 2318 ws.append(w)
2317 ts.append(t) 2319 ts.append(t)