D1285: localrepo: add a new attribute _visibilityexceptions and related API
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Thu Nov 2 18:04:59 UTC 2017
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Currently we don't have a defined way in core to make some hidden revisions
visible in filtered repo. Extensions to achieve the purpose of unhiding some
hidden commits, wrap repoview.pinnedrevs() function.
To make the above task simple and have well defined API, this patch adds a new
attribute '_visibilityexceptions' to localrepository class which will contains
the hidden revs which should be exception.
This patch also adds API to add revs to the attribute set and get them.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1285
AFFECTED FILES
mercurial/localrepo.py
CHANGE DETAILS
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -509,6 +509,16 @@
self._sparsesignaturecache = {}
# Signature to cached matcher instance.
self._sparsematchercache = {}
+ # hidden hashed which should be visible
+ self._visibilityexceptions = set()
+
+ def addvisibilityexceptions(self, exceptions):
+ """ adds hidden revs which should be visible to set of exceptions """
+ self._visibilityexceptions.update(exceptions)
+
+ def getvisibilityexceptions(self):
+ """ returns the set of hidden revs which should be visible """
+ return self._visibilityexceptions
def _getvfsward(self, origfunc):
"""build a ward for self.vfs"""
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list