Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 29766:5004ef47f437 stable
revset: fix keyword arguments to go through optimization process
Before, a keyvalue node was processed by the last catch-all condition of
_optimize(). Therefore, topo.firstbranch=expr would bypass tree rewriting
and would crash if an expr wasn't trivial.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 07 Aug 2016 14:58:49 +0900 |
parents | a8a5dd8986f0 |
children | 531e85eec23c |
comparison
equal
deleted
inserted
replaced
29717:a12d13eac513 | 29766:5004ef47f437 |
---|---|
2421 wb, tb = _optimize(x[2], small) | 2421 wb, tb = _optimize(x[2], small) |
2422 return wa + wb, (op, ta, tb) | 2422 return wa + wb, (op, ta, tb) |
2423 elif op == 'list': | 2423 elif op == 'list': |
2424 ws, ts = zip(*(_optimize(y, small) for y in x[1:])) | 2424 ws, ts = zip(*(_optimize(y, small) for y in x[1:])) |
2425 return sum(ws), (op,) + ts | 2425 return sum(ws), (op,) + ts |
2426 elif op == 'keyvalue': | |
2427 w, t = _optimize(x[2], small) | |
2428 return w, (op, x[1], t) | |
2426 elif op == 'func': | 2429 elif op == 'func': |
2427 f = getsymbol(x[1]) | 2430 f = getsymbol(x[1]) |
2428 wa, ta = _optimize(x[2], small) | 2431 wa, ta = _optimize(x[2], small) |
2429 if f in ("author branch closed date desc file grep keyword " | 2432 if f in ("author branch closed date desc file grep keyword " |
2430 "outgoing user"): | 2433 "outgoing user"): |