[PATCH 4 of 8] hidden: remove unnecessary 'domain' parameter from _revealancestors()

Martin von Zweigbergk martinvonz at google.com
Sun May 28 02:15:32 EDT 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1495948220 25200
#      Sat May 27 22:10:20 2017 -0700
# Node ID dd4f27063e5a2c7350509ba99e28b7c9b810acac
# Parent  aef3194855e763ecced80c2df6bd9672207aefbc
hidden: remove unnecessary 'domain' parameter from _revealancestors()

The function will stop searching as soon as it runs into a non-hidden
revision, so there is no need to restrict by the domain (of mutable
revisions) as well.

This doesn't seem to have much impact on "perfvolatilesets".

Before:
! obsolete
! wall 0.004903 comb 0.000000 user 0.000000 sys 0.000000 (best of 535)
! visible
! wall 0.008913 comb 0.010000 user 0.010000 sys 0.000000 (best of 300)

After:
! obsolete
! wall 0.004616 comb 0.000000 user 0.000000 sys 0.000000 (best of 570)
! visible
! wall 0.008235 comb 0.010000 user 0.010000 sys 0.000000 (best of 326)

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -59,33 +59,13 @@
                 break
     return blockers
 
-def _revealancestors(hidden, pfunc, revs, domain):
-    """reveals contiguous chains of hidden ancestors of 'revs' within 'domain'
-    by removing them from 'hidden'
+def _revealancestors(hidden, pfunc, revs):
+    """reveals contiguous chains of hidden ancestors of 'revs' by removing them
+    from 'hidden'
 
     - hidden: the (preliminary) hidden revisions, to be updated
     - pfunc(r): a funtion returning parent of 'r',
     - revs: iterable of revnum,
-    - domain: consistent set of revnum.
-
-    The domain must be consistent: no connected subset are the ancestors of
-    another connected subset. In other words, if the parents of a revision are
-    not in the domains, no other ancestors of that revision. For example, with
-    the following graph:
-
-        F
-        |
-        E
-        | D
-        | |
-        | C
-        |/
-        B
-        |
-        A
-
-    If C, D, E and F are in the domain but B is not, A cannot be ((A) is an
-    ancestors disconnected subset disconnected of (C+D)).
 
     (Ancestors are revealed inclusively, i.e. the elements in 'revs' are
     also revealed)
@@ -94,7 +74,7 @@
     hidden -= set(stack)
     while stack:
         for p in pfunc(stack.pop()):
-            if p != nullrev and p in domain and p in hidden:
+            if p != nullrev and p in hidden:
                 hidden.remove(p)
                 stack.append(p)
 
@@ -118,7 +98,7 @@
         if blockers:
             # don't modify possibly cached result of hideablerevs()
             hidden = hidden.copy()
-            _revealancestors(hidden, pfunc, blockers, mutable)
+            _revealancestors(hidden, pfunc, blockers)
     return frozenset(hidden)
 
 def computeunserved(repo):


More information about the Mercurial-devel mailing list