changeset 29118:8c295c3b2ce2

revset: introduce temporary variables in optimize() where they look better
author Yuya Nishihara <yuya@tcha.org>
date Mon, 02 May 2016 12:47:09 +0900
parents 7828cadd2873
children a032ebea4e97
files mercurial/revset.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Mon May 02 11:50:48 2016 +0900
+++ b/mercurial/revset.py	Mon May 02 12:47:09 2016 +0900
@@ -2099,8 +2099,8 @@
     if op == 'minus':
         return optimize(('and', x[1], ('not', x[2])), small)
     elif op == 'only':
-        return optimize(('func', ('symbol', 'only'),
-                         ('list', x[1], x[2])), small)
+        t = ('func', ('symbol', 'only'), ('list', x[1], x[2]))
+        return optimize(t, small)
     elif op == 'onlypost':
         return optimize(('func', ('symbol', 'only'), x[1]), small)
     elif op == 'dagrangepre':
@@ -2114,8 +2114,8 @@
     elif op == 'rangepost':
         return optimize(('range', x[1], ('string', 'tip')), small)
     elif op == 'negate':
-        return optimize(('string',
-                         '-' + getstring(x[1], _("can't negate that"))), small)
+        s = getstring(x[1], _("can't negate that"))
+        return optimize(('string', '-' + s), small)
     elif op in 'string symbol negate':
         return smallbonus, x # single revisions are small
     elif op == 'and':