mercurial/repoview.py
changeset 42126 ef0e3cc684b3
parent 42125 bc15e37ecc16
child 42138 caebe5e7f4bd
--- a/mercurial/repoview.py	Sat Apr 13 20:57:50 2019 +0200
+++ b/mercurial/repoview.py	Mon May 21 17:28:35 2018 +0200
@@ -86,6 +86,14 @@
         _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)
 
+def computesecret(repo, visibilityexceptions=None):
+    """compute the set of revision that can never be exposed through hgweb
+
+    Changeset in the secret phase (or above) should stay unaccessible."""
+    assert not repo.changelog.filteredrevs
+    secrets = repo._phasecache.getrevset(repo, phases.remotehiddenphases)
+    return frozenset(secrets)
+
 def computeunserved(repo, visibilityexceptions=None):
     """compute the set of revision that should be filtered when used a server
 
@@ -93,9 +101,9 @@
     assert not repo.changelog.filteredrevs
     # fast path in simple case to avoid impact of non optimised code
     hiddens = filterrevs(repo, 'visible')
-    secrets = repo._phasecache.getrevset(repo, phases.remotehiddenphases)
+    secrets = filterrevs(repo, 'served.hidden')
     if secrets:
-        return frozenset(hiddens | frozenset(secrets))
+        return frozenset(hiddens | secrets)
     else:
         return hiddens
 
@@ -141,6 +149,7 @@
 # from scratch (very slow).
 filtertable = {'visible': computehidden,
                'visible-hidden': computehidden,
+               'served.hidden': computesecret,
                'served': computeunserved,
                'immutable':  computemutable,
                'base':  computeimpactable}