Patchwork [7,of,9,v2] hidden: make _revealancestors() reveal ancestors exclusively

login
register
mail settings
Submitter via Mercurial-devel
Date May 30, 2017, 8:29 p.m.
Message ID <5ccdb1da554e113cfdb3.1496176174@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21081/
State Accepted
Headers show

Comments

via Mercurial-devel - May 30, 2017, 8:29 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495951510 25200
#      Sat May 27 23:05:10 2017 -0700
# Node ID 5ccdb1da554e113cfdb3bf88e65a05d0aa1efd5d
# Parent  114579789985724a694d86b9ea7ae7f37343c172
hidden: make _revealancestors() reveal ancestors exclusively

I think this seems more expected. It also prepares for the next
commit.

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -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)