Mercurial > hg
comparison mercurial/revset.py @ 25102:bb2f543b48b5
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 15 May 2015 11:52:09 -0500 |
parents | 263bbed1833c 8b99e9a8db05 |
children | 2f34746c27df |
comparison
equal
deleted
inserted
replaced
25100:d6e7ac651973 | 25102:bb2f543b48b5 |
---|---|
2093 "func": func, | 2093 "func": func, |
2094 "ancestor": ancestorspec, | 2094 "ancestor": ancestorspec, |
2095 "parent": parentspec, | 2095 "parent": parentspec, |
2096 "parentpost": p1, | 2096 "parentpost": p1, |
2097 "only": only, | 2097 "only": only, |
2098 "onlypost": only, | |
2099 } | 2098 } |
2100 | 2099 |
2101 def optimize(x, small): | 2100 def optimize(x, small): |
2102 if x is None: | 2101 if x is None: |
2103 return 0, x | 2102 return 0, x |
2110 if op == 'minus': | 2109 if op == 'minus': |
2111 return optimize(('and', x[1], ('not', x[2])), small) | 2110 return optimize(('and', x[1], ('not', x[2])), small) |
2112 elif op == 'only': | 2111 elif op == 'only': |
2113 return optimize(('func', ('symbol', 'only'), | 2112 return optimize(('func', ('symbol', 'only'), |
2114 ('list', x[1], x[2])), small) | 2113 ('list', x[1], x[2])), small) |
2114 elif op == 'onlypost': | |
2115 return optimize(('func', ('symbol', 'only'), x[1]), small) | |
2115 elif op == 'dagrangepre': | 2116 elif op == 'dagrangepre': |
2116 return optimize(('func', ('symbol', 'ancestors'), x[1]), small) | 2117 return optimize(('func', ('symbol', 'ancestors'), x[1]), small) |
2117 elif op == 'dagrangepost': | 2118 elif op == 'dagrangepost': |
2118 return optimize(('func', ('symbol', 'descendants'), x[1]), small) | 2119 return optimize(('func', ('symbol', 'descendants'), x[1]), small) |
2119 elif op == 'rangepre': | 2120 elif op == 'rangepre': |