changeset 32588:d964959cbf66

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)
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 27 May 2017 22:10:20 -0700
parents b9b41d8f4522
children 306bba74c56e
files mercurial/repoview.py
diffstat 1 files changed, 5 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repoview.py	Sat May 27 21:17:06 2017 -0700
+++ b/mercurial/repoview.py	Sat May 27 22:10:20 2017 -0700
@@ -59,33 +59,13 @@
                 break
     return blockers
 
-def _revealancestors(pfunc, hidden, revs, domain):
-    """reveals contiguous chains of hidden ancestors of 'revs' within 'domain'
-    by removing them from 'hidden'
+def _revealancestors(pfunc, hidden, revs):
+    """reveals contiguous chains of hidden ancestors of 'revs' by removing them
+    from 'hidden'
 
     - pfunc(r): a funtion returning parent of 'r',
     - hidden: the (preliminary) hidden revisions, to be updated
     - 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(pfunc, hidden, blockers, mutable)
+            _revealancestors(pfunc, hidden, blockers)
     return frozenset(hidden)
 
 def computeunserved(repo):