[PATCH 1 of 2] revset: extract function that creates range set from computed revisions

Yuya Nishihara yuya at tcha.org
Sat Oct 1 14:14:06 UTC 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1475320308 -32400
#      Sat Oct 01 20:11:48 2016 +0900
# Node ID 95ec9f99f4dc075caa28ca71580e913b35855d84
# Parent  3f4e1c033f40aaa8111de9b8212f05e8e09590aa
revset: extract function that creates range set from computed revisions

So we can pass m=0 to _makerangeset() even if the revision 0 is hidden.
Hidden revisions are filtered by spanset.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -366,8 +366,9 @@ def rangeset(repo, subset, x, y, order):
 
     if not m or not n:
         return baseset()
-    m, n = m.first(), n.last()
-
+    return _makerangeset(repo, subset, m.first(), n.last(), order)
+
+def _makerangeset(repo, subset, m, n, order):
     if m == n:
         r = baseset([m])
     elif n == node.wdirrev:


More information about the Mercurial-devel mailing list