# HG changeset patch # User Pierre-Yves David # Date 1434057681 25200 # Node ID 9584bcf27637f87b0154fd20f38507d59d44e038 # Parent 99a1f73af85b4798cd79e0f51097ce661aa5cfa7 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. diff -r 99a1f73af85b -r 9584bcf27637 mercurial/revset.py --- a/mercurial/revset.py Thu Jun 11 14:00:13 2015 -0700 +++ b/mercurial/revset.py Thu Jun 11 14:21:21 2015 -0700 @@ -346,11 +346,18 @@ r = spanset(repo, m, n + 1) else: r = spanset(repo, m, n - 1) + # XXX We should combine with subset first: 'subset & baseset(...)'. This is + # necessary to ensure we preserve the order in subset. + # + # This has performance implication, carrying the sorting over when possible + # would be more efficient. return r & subset def dagrange(repo, subset, x, y): r = fullreposet(repo) xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y)) + # XXX We should combine with subset first: 'subset & baseset(...)'. This is + # necessary to ensure we preserve the order in subset. return xs & subset def andset(repo, subset, x, y): @@ -1092,6 +1099,8 @@ hs = set() for b, ls in repo.branchmap().iteritems(): hs.update(repo[h].rev() for h in ls) + # XXX We should combine with subset first: 'subset & baseset(...)'. This is + # necessary to ensure we preserve the order in subset. return baseset(hs).filter(subset.__contains__) def heads(repo, subset, x):