Mercurial > hg-stable
comparison mercurial/revset.py @ 25548:9584bcf27637
revset: mark the place where we are combining sets in the wrong direction
We should always combine with subset as the left operand (to preserve the
order). I do not have time to fix all of them so I'm just marking the spot.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 11 Jun 2015 14:21:21 -0700 |
parents | 99a1f73af85b |
children | f93ff3ab8d14 |
comparison
equal
deleted
inserted
replaced
25547:99a1f73af85b | 25548:9584bcf27637 |
---|---|
344 | 344 |
345 if m < n: | 345 if m < n: |
346 r = spanset(repo, m, n + 1) | 346 r = spanset(repo, m, n + 1) |
347 else: | 347 else: |
348 r = spanset(repo, m, n - 1) | 348 r = spanset(repo, m, n - 1) |
349 # XXX We should combine with subset first: 'subset & baseset(...)'. This is | |
350 # necessary to ensure we preserve the order in subset. | |
351 # | |
352 # This has performance implication, carrying the sorting over when possible | |
353 # would be more efficient. | |
349 return r & subset | 354 return r & subset |
350 | 355 |
351 def dagrange(repo, subset, x, y): | 356 def dagrange(repo, subset, x, y): |
352 r = fullreposet(repo) | 357 r = fullreposet(repo) |
353 xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y)) | 358 xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y)) |
359 # XXX We should combine with subset first: 'subset & baseset(...)'. This is | |
360 # necessary to ensure we preserve the order in subset. | |
354 return xs & subset | 361 return xs & subset |
355 | 362 |
356 def andset(repo, subset, x, y): | 363 def andset(repo, subset, x, y): |
357 return getset(repo, getset(repo, subset, x), y) | 364 return getset(repo, getset(repo, subset, x), y) |
358 | 365 |
1090 # i18n: "head" is a keyword | 1097 # i18n: "head" is a keyword |
1091 getargs(x, 0, 0, _("head takes no arguments")) | 1098 getargs(x, 0, 0, _("head takes no arguments")) |
1092 hs = set() | 1099 hs = set() |
1093 for b, ls in repo.branchmap().iteritems(): | 1100 for b, ls in repo.branchmap().iteritems(): |
1094 hs.update(repo[h].rev() for h in ls) | 1101 hs.update(repo[h].rev() for h in ls) |
1102 # XXX We should combine with subset first: 'subset & baseset(...)'. This is | |
1103 # necessary to ensure we preserve the order in subset. | |
1095 return baseset(hs).filter(subset.__contains__) | 1104 return baseset(hs).filter(subset.__contains__) |
1096 | 1105 |
1097 def heads(repo, subset, x): | 1106 def heads(repo, subset, x): |
1098 """``heads(set)`` | 1107 """``heads(set)`` |
1099 Members of set with no children in set. | 1108 Members of set with no children in set. |