Patchwork D1492: repoview: take out the logic of computehidden to a new function

login
register
mail settings
Submitter phabricator
Date Dec. 4, 2017, 2:16 p.m.
Message ID <223b897c23b36df9a5a845566db308a1@localhost.localdomain>
Download mbox | patch
Permalink /patch/25923/
State Not Applicable
Headers show

Comments

phabricator - Dec. 4, 2017, 2:16 p.m.
pulkit updated this revision to Diff 4093.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1492?vs=3786&id=4093

REVISION DETAIL
  https://phab.mercurial-scm.org/D1492

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -63,12 +63,8 @@ 
                 hidden.remove(p)
                 stack.append(p)
 
-def computehidden(repo):
-    """compute the set of hidden revision to filter
-
-    During most operation hidden should be filtered."""
-    assert not repo.changelog.filteredrevs
-
+def _computeperfiltername(repo, filtername):
+    """computes the set of revisions to filter for visible* filters"""
     hidden = hideablerevs(repo)
     if hidden:
         hidden = set(hidden - pinnedrevs(repo))
@@ -80,6 +76,13 @@ 
         _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)
 
+def computehidden(repo):
+    """compute the set of hidden revision to filter
+
+    During most operation hidden should be filtered."""
+    assert not repo.changelog.filteredrevs
+    return _computeperfiltername(repo, 'visible')
+
 def computeunserved(repo):
     """compute the set of revision that should be filtered when used a server