mercurial/revset.py
changeset 25307 4d1e56b29a91
parent 25270 61b3529e2377
child 25308 036c26b08b71
equal deleted inserted replaced
25306:c87b05925054 25307:4d1e56b29a91
  2160             return w, (op, tb, ta)
  2160             return w, (op, tb, ta)
  2161         return w, (op, ta, tb)
  2161         return w, (op, ta, tb)
  2162     elif op == 'or':
  2162     elif op == 'or':
  2163         wa, ta = optimize(x[1], False)
  2163         wa, ta = optimize(x[1], False)
  2164         wb, tb = optimize(x[2], False)
  2164         wb, tb = optimize(x[2], False)
  2165         if wb < wa:
  2165         # we can't reorder trees by weight because it would change the order.
  2166             wb, wa = wa, wb
  2166         # ("sort(a + b)" == "sort(b + a)", but "a + b" != "b + a")
       
  2167         #   if wb < wa:
       
  2168         #       tb, ta = ta, tb
  2167         return max(wa, wb), (op, ta, tb)
  2169         return max(wa, wb), (op, ta, tb)
  2168     elif op == 'not':
  2170     elif op == 'not':
  2169         # Optimize not public() to _notpublic() because we have a fast version
  2171         # Optimize not public() to _notpublic() because we have a fast version
  2170         if x[1] == ('func', ('symbol', 'public'), None):
  2172         if x[1] == ('func', ('symbol', 'public'), None):
  2171             newsym =  ('func', ('symbol', '_notpublic'), None)
  2173             newsym =  ('func', ('symbol', '_notpublic'), None)