Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 29944:5f56a3b9675e
revset: fix order of nested 'range' expression (BC)
Enforce range order only if necessary as the comment says "carrying the
sorting over would be more efficient."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 03 May 2016 12:52:50 +0900 |
parents | 80c86b9bb40b |
children | 89dbae952ec1 |
comparison
equal
deleted
inserted
replaced
29943:80c86b9bb40b | 29944:5f56a3b9675e |
---|---|
376 r = baseset([m]) + spanset(repo, len(repo) - 1, n - 1) | 376 r = baseset([m]) + spanset(repo, len(repo) - 1, n - 1) |
377 elif m < n: | 377 elif m < n: |
378 r = spanset(repo, m, n + 1) | 378 r = spanset(repo, m, n + 1) |
379 else: | 379 else: |
380 r = spanset(repo, m, n - 1) | 380 r = spanset(repo, m, n - 1) |
381 # XXX We should combine with subset first: 'subset & baseset(...)'. This is | 381 |
382 # necessary to ensure we preserve the order in subset. | 382 if order == defineorder: |
383 # | 383 return r & subset |
384 # This has performance implication, carrying the sorting over when possible | 384 else: |
385 # would be more efficient. | 385 # carrying the sorting over when possible would be more efficient |
386 return r & subset | 386 return subset & r |
387 | 387 |
388 def dagrange(repo, subset, x, y, order): | 388 def dagrange(repo, subset, x, y, order): |
389 r = fullreposet(repo) | 389 r = fullreposet(repo) |
390 xs = reachableroots(repo, getset(repo, r, x), getset(repo, r, y), | 390 xs = reachableroots(repo, getset(repo, r, x), getset(repo, r, y), |
391 includepath=True) | 391 includepath=True) |