hidden: make _revealancestors() reveal ancestors exclusively
authorMartin von Zweigbergk <martinvonz@google.com>
Sat, 27 May 2017 23:05:10 -0700
changeset 32617 2af0b9a02bf9
parent 32616 c777dac2b27c
child 32618 c37ca35b8450
hidden: make _revealancestors() reveal ancestors exclusively I think this seems more expected. It also prepares for the next commit.
mercurial/repoview.py
--- a/mercurial/repoview.py	Sat May 27 22:55:19 2017 -0700
+++ b/mercurial/repoview.py	Sat May 27 23:05:10 2017 -0700
@@ -53,11 +53,10 @@
     - hidden: the (preliminary) hidden revisions, to be updated
     - revs: iterable of revnum,
 
-    (Ancestors are revealed inclusively, i.e. the elements in 'revs' are
-    also revealed)
+    (Ancestors are revealed exclusively, i.e. the elements in 'revs' are
+    *not* revealed)
     """
     stack = list(revs)
-    hidden -= set(stack)
     while stack:
         for p in pfunc(stack.pop()):
             if p != nullrev and p in hidden:
@@ -79,8 +78,7 @@
         visible = set(mutable - hidden)
         visible |= (hidden & pinnedrevs(repo))
         if visible:
-            # don't modify possibly cached result of hideablerevs()
-            hidden = hidden.copy()
+            hidden = hidden - visible
             _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)