D460: revset: micro optimize _flipand by using anyorder for inner set

quark (Jun Wu) phabricator at mercurial-scm.org
Sun Aug 20 22:13:11 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Now the ordering issues are resolved so we can use `anyorder` for `x` in
  `_flipand(x, y)`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D460

AFFECTED FILES
  mercurial/revset.py
  tests/test-revset.t

CHANGE DETAILS

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -2070,7 +2070,7 @@
   * set:
   <filteredset
     <spanset- 0:3>,
-    <baseset+ [0, 1, 2]>>
+    <baseset [0, 1, 2]>>
   2
   1
   0
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -937,10 +937,7 @@
     """Equivalent to ``y and x``, but faster when x is small"""
     x, y = getargs(args, 2, 2, _("missing argument"))
     if order == defineorder:
-        # NOTE: In theory this could be "anyorder". But many revsets (ex.
-        # "contains") do not handle "defineorder" correctly. This has to be
-        # followorder for now to hide those issues.
-        xorder = followorder
+        xorder = anyorder
     else:
         xorder = order
     return getset(repo, getset(repo, subset, x, xorder), y, order)



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list