Patchwork [8,of,9,v2] hidden: subtract pinned revs from hidden earlier

login
register
mail settings
Submitter via Mercurial-devel
Date May 30, 2017, 8:29 p.m.
Message ID <b3db386713b83543ad3b.1496176175@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21082/
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 1496165240 25200
#      Tue May 30 10:27:20 2017 -0700
# Node ID b3db386713b83543ad3b966a59caae359f0b67b4
# Parent  5ccdb1da554e113cfdb3bf88e65a05d0aa1efd5d
hidden: subtract pinned revs from hidden earlier

The pinned revs are simply revisions that should not be hidden even if
hideablerevs() says that should. Let's make that clear by simply
setting "hidden = hideablerevs() - pinnedrevs()" early on.

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -71,14 +71,13 @@ 
 
     hidden = hideablerevs(repo)
     if hidden:
+        hidden = set(hidden - pinnedrevs(repo))
         pfunc = repo.changelog.parentrevs
         mutablephases = (phases.draft, phases.secret)
         mutable = repo._phasecache.getrevset(repo, mutablephases)
 
         visible = set(mutable - hidden)
-        visible |= (hidden & pinnedrevs(repo))
         if visible:
-            hidden = hidden - visible
             _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)