revset: mark the place where we are combining sets in the wrong direction
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 11 Jun 2015 14:21:21 -0700
changeset 25548 9584bcf27637
parent 25547 99a1f73af85b
child 25549 f93ff3ab8d14
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.
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):