Patchwork D1287: repoview: add two new filternames to be used for accessing hidden commits

login
register
mail settings
Submitter phabricator
Date Nov. 23, 2017, 1:24 a.m.
Message ID <ec5a2c6b4651d79e7ed5a499d53b568b@localhost.localdomain>
Download mbox | patch
Permalink /patch/25726/
State Not Applicable
Headers show

Comments

phabricator - Nov. 23, 2017, 1:24 a.m.
pulkit updated this revision to Diff 3787.
pulkit edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1287?vs=3207&id=3787

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

AFFECTED FILES
  mercurial/branchmap.py
  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
@@ -77,6 +77,16 @@ 
         _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)
 
+def computewarnhidden(repo):
+    """"""
+    assert not repo.changelog.filteredrevs
+    return _computeperfiltername(repo, 'visible-warnhidden')
+
+def computeallowhidden(repo):
+    """"""
+    assert not repo.changelog.filteredrevs
+    return _computeperfiltername(repo, 'visible-allowhidden')
+
 def computehidden(repo):
     """compute the set of hidden revision to filter
 
@@ -143,6 +153,8 @@ 
 # Otherwise your filter will have to recompute all its branches cache
 # from scratch (very slow).
 filtertable = {'visible': computehidden,
+               'visible-warnhidden': computewarnhidden,
+               'visible-allowhidden': computeallowhidden,
                'served': computeunserved,
                'immutable':  computemutable,
                'base':  computeimpactable}
diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -86,7 +86,9 @@ 
 subsettable = {None: 'visible',
                'visible': 'served',
                'served': 'immutable',
-               'immutable': 'base'}
+               'immutable': 'base',
+               'visible-warnhidden': 'visible',
+               'visible-allowhidden': 'visible'}
 
 def updatecache(repo):
     cl = repo.changelog