Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 25766:d51dac68ec98
revset: work around x:y range where x or y is wdir()
All revisions must be contiguous in spanset, so we need the special case
for the wdir revision.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 28 Jun 2015 16:08:07 +0900 |
parents | 5e1b0739611c |
children | 026105c442d7 |
comparison
equal
deleted
inserted
replaced
25765:5e1b0739611c | 25766:d51dac68ec98 |
---|---|
360 | 360 |
361 if not m or not n: | 361 if not m or not n: |
362 return baseset() | 362 return baseset() |
363 m, n = m.first(), n.last() | 363 m, n = m.first(), n.last() |
364 | 364 |
365 if m < n: | 365 if m == n: |
366 r = baseset([m]) | |
367 elif n == node.wdirrev: | |
368 r = spanset(repo, m, len(repo)) + baseset([n]) | |
369 elif m == node.wdirrev: | |
370 r = baseset([m]) + spanset(repo, len(repo) - 1, n - 1) | |
371 elif m < n: | |
366 r = spanset(repo, m, n + 1) | 372 r = spanset(repo, m, n + 1) |
367 else: | 373 else: |
368 r = spanset(repo, m, n - 1) | 374 r = spanset(repo, m, n - 1) |
369 # XXX We should combine with subset first: 'subset & baseset(...)'. This is | 375 # XXX We should combine with subset first: 'subset & baseset(...)'. This is |
370 # necessary to ensure we preserve the order in subset. | 376 # necessary to ensure we preserve the order in subset. |