diff -r 997e8cf4d0a2 -r 531e85eec23c mercurial/revset.py --- a/mercurial/revset.py Sat Aug 13 04:21:42 2016 +0530 +++ b/mercurial/revset.py Mon Aug 15 12:26:02 2016 -0400 @@ -2433,6 +2433,9 @@ elif op == 'list': ws, ts = zip(*(_optimize(y, small) for y in x[1:])) return sum(ws), (op,) + ts + elif op == 'keyvalue': + w, t = _optimize(x[2], small) + return w, (op, x[1], t) elif op == 'func': f = getsymbol(x[1]) wa, ta = _optimize(x[2], small)