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

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

Comments

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

REPOSITORY
  rHG Mercurial

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

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

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

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -185,6 +185,9 @@ 
     subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
     """
 
+    # hidden revs which should be visible
+    _visibilityexceptions = set()
+
     def __init__(self, repo, filtername):
         object.__setattr__(self, r'_unfilteredrepo', repo)
         object.__setattr__(self, r'filtername', filtername)
@@ -231,6 +234,14 @@ 
             return self
         return self.unfiltered().filtered(name)
 
+    def addvisibilityexceptions(self, revs):
+        """adds hidden revs which should be visible to set of exceptions"""
+        self._visibilityexceptions.update(revs)
+
+    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
@@ -570,6 +570,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 set()
+
     def _loadextensions(self):
         extensions.loadall(self.ui)