mercurial/filesetlang.py
changeset 38864 73731fa8d1bd
parent 38863 61ab546b71c3
child 38865 899b4c74209c
equal deleted inserted replaced
38863:61ab546b71c3 38864:73731fa8d1bd
   205             return wa, _optimizeandops(op, ta, tb)
   205             return wa, _optimizeandops(op, ta, tb)
   206         else:
   206         else:
   207             return wb, _optimizeandops(op, tb, ta)
   207             return wb, _optimizeandops(op, tb, ta)
   208     if op == 'or':
   208     if op == 'or':
   209         ws, ts = zip(*(_optimize(y) for y in x[1:]))
   209         ws, ts = zip(*(_optimize(y) for y in x[1:]))
       
   210         ts = tuple(it[1] for it in sorted(enumerate(ts),
       
   211                                           key=lambda it: ws[it[0]]))
   210         return max(ws), (op,) + ts
   212         return max(ws), (op,) + ts
   211     if op == 'list':
   213     if op == 'list':
   212         ws, ts = zip(*(_optimize(y) for y in x[1:]))
   214         ws, ts = zip(*(_optimize(y) for y in x[1:]))
   213         return sum(ws), (op,) + ts
   215         return sum(ws), (op,) + ts
   214     if op == 'func':
   216     if op == 'func':