D1012: repoview: add two new filternames to be used for accessing hidden commits
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Wed Oct 11 19:10:40 UTC 2017
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This patch adds two new filternames 'visible-hidden' and 'visible-warnhidden'
which will be used to access hidden commits.
'visible-hidden' will allow access of hidden commits with any warning. This will
be for read only commands.
'visible-warnhidden' will allow acces of hidden commits but will warn for that.
This will be for recoverable write commands.
For unrecoverable write commands, we don't need to have anything new as that's
the current behaviour.
We are using the same computehidden() function as we will be adding the hidden
revisions to pinnedrevs.
The idea to add new filternames is taken from directaccess extension from
fb-hgext.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1012
AFFECTED FILES
mercurial/branchmap.py
mercurial/repoview.py
CHANGE DETAILS
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -139,6 +139,8 @@
# Otherwise your filter will have to recompute all its branches cache
# from scratch (very slow).
filtertable = {'visible': computehidden,
+ 'visible-warnhidden': computehidden,
+ 'visible-hidden': computehidden,
'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-hidden': 'visible'}
def updatecache(repo):
cl = repo.changelog
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list