Patchwork D1285: repoview: add a new attribute _visibilityexceptions and related API

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

Comments

phabricator - Nov. 23, 2017, 1:24 a.m.
pulkit updated this revision to Diff 3784.
pulkit edited the summary of this revision.
pulkit retitled this revision from "localrepo: add a new attribute _visibilityexceptions and related API" to "repoview: add a new attribute _visibilityexceptions and related API".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1285?vs=3201&id=3784

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

AFFECTED FILES
  mercurial/localrepo.py
  mercurial/repoview.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -190,6 +190,8 @@ 
         object.__setattr__(self, r'filtername', filtername)
         object.__setattr__(self, r'_clcachekey', None)
         object.__setattr__(self, r'_clcache', None)
+        # hidden hashes which should be visible
+        self._visibilityexceptions = set()
 
     # not a propertycache on purpose we shall implement a proper cache later
     @property
@@ -231,6 +233,14 @@ 
             return self
         return self.unfiltered().filtered(name)
 
+    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
+
     # everything access are forwarded to the proxied repo
     def __getattr__(self, attr):
         return getattr(self._unfilteredrepo, attr)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -567,6 +567,14 @@ 
     def close(self):
         self._writecaches()
 
+    def addvisibilityexceptions(self, exceptions):
+        # should be called on a filtered repository
+        pass
+
+    def getvisibilityexceptions(self):
+        # should be called on a filtered repository
+        return ()
+
     def _loadextensions(self):
         extensions.loadall(self.ui)