Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 29770:9c51a5de76db
revset: also parse x^: as (x^):
Given x^:y is (x^):y, this seems sensible.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 06 Aug 2016 20:37:48 +0900 |
parents | abe4eecc3253 |
children | 531e85eec23c |
comparison
equal
deleted
inserted
replaced
29769:abe4eecc3253 | 29770:9c51a5de76db |
---|---|
2321 return x | 2321 return x |
2322 | 2322 |
2323 op = x[0] | 2323 op = x[0] |
2324 if op == 'parent': | 2324 if op == 'parent': |
2325 # x^:y means (x^) : y, not x ^ (:y) | 2325 # x^:y means (x^) : y, not x ^ (:y) |
2326 # x^: means (x^) :, not x ^ (:) | |
2326 post = ('parentpost', x[1]) | 2327 post = ('parentpost', x[1]) |
2327 if x[2][0] == 'dagrangepre': | 2328 if x[2][0] == 'dagrangepre': |
2328 return _fixops(('dagrange', post, x[2][1])) | 2329 return _fixops(('dagrange', post, x[2][1])) |
2329 elif x[2][0] == 'rangepre': | 2330 elif x[2][0] == 'rangepre': |
2330 return _fixops(('range', post, x[2][1])) | 2331 return _fixops(('range', post, x[2][1])) |
2332 elif x[2][0] == 'rangeall': | |
2333 return _fixops(('rangepost', post)) | |
2331 | 2334 |
2332 return (op,) + tuple(_fixops(y) for y in x[1:]) | 2335 return (op,) + tuple(_fixops(y) for y in x[1:]) |
2333 | 2336 |
2334 def _optimize(x, small): | 2337 def _optimize(x, small): |
2335 if x is None: | 2338 if x is None: |