##// END OF EJS Templates
revset: introduce temporary variables in optimize() where they look better
Yuya Nishihara -
r29118:8c295c3b default
parent child Browse files
Show More
@@ -2099,8 +2099,8 b' def optimize(x, small):'
2099 if op == 'minus':
2099 if op == 'minus':
2100 return optimize(('and', x[1], ('not', x[2])), small)
2100 return optimize(('and', x[1], ('not', x[2])), small)
2101 elif op == 'only':
2101 elif op == 'only':
2102 return optimize(('func', ('symbol', 'only'),
2102 t = ('func', ('symbol', 'only'), ('list', x[1], x[2]))
2103 ('list', x[1], x[2])), small)
2103 return optimize(t, small)
2104 elif op == 'onlypost':
2104 elif op == 'onlypost':
2105 return optimize(('func', ('symbol', 'only'), x[1]), small)
2105 return optimize(('func', ('symbol', 'only'), x[1]), small)
2106 elif op == 'dagrangepre':
2106 elif op == 'dagrangepre':
@@ -2114,8 +2114,8 b' def optimize(x, small):'
2114 elif op == 'rangepost':
2114 elif op == 'rangepost':
2115 return optimize(('range', x[1], ('string', 'tip')), small)
2115 return optimize(('range', x[1], ('string', 'tip')), small)
2116 elif op == 'negate':
2116 elif op == 'negate':
2117 return optimize(('string',
2117 s = getstring(x[1], _("can't negate that"))
2118 '-' + getstring(x[1], _("can't negate that"))), small)
2118 return optimize(('string', '-' + s), small)
2119 elif op in 'string symbol negate':
2119 elif op in 'string symbol negate':
2120 return smallbonus, x # single revisions are small
2120 return smallbonus, x # single revisions are small
2121 elif op == 'and':
2121 elif op == 'and':
General Comments 0
You need to be logged in to leave comments. Login now