comparison mercurial/localrepo.py @ 35496:3ad582b2895c

repoview: add visibilityexceptions as an optional argument to repo.filtered() This will help us in having an API where we can pass the filtername and the visibilityexceptions to get a new repo object. Visibility exceptions are the revs which must be visible even they should in theory belong to the hidden set. They are required as there has been desire to have a functionality to access hidden changesets using certain commands without passing --hidden. After this patch we can make those changesets visibility exceptions so that we can access them without requiring a unfiltered repo. Differential Revision: https://phab.mercurial-scm.org/D1746
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 22 Dec 2017 17:57:11 +0530
parents d13526333835
children 03e921942163
comparison
equal deleted inserted replaced
35495:ded3a63f305b 35496:3ad582b2895c
673 """Return unfiltered version of the repository 673 """Return unfiltered version of the repository
674 674
675 Intended to be overwritten by filtered repo.""" 675 Intended to be overwritten by filtered repo."""
676 return self 676 return self
677 677
678 def filtered(self, name): 678 def filtered(self, name, visibilityexceptions=None):
679 """Return a filtered version of a repository""" 679 """Return a filtered version of a repository"""
680 cls = repoview.newtype(self.unfiltered().__class__) 680 cls = repoview.newtype(self.unfiltered().__class__)
681 return cls(self, name) 681 return cls(self, name, visibilityexceptions)
682 682
683 @repofilecache('bookmarks', 'bookmarks.current') 683 @repofilecache('bookmarks', 'bookmarks.current')
684 def _bookmarks(self): 684 def _bookmarks(self):
685 return bookmarks.bmstore(self) 685 return bookmarks.bmstore(self)
686 686