##// END OF EJS Templates
repoview: add visibilityexceptions as an optional argument to repo.filtered()...
Pulkit Goyal -
r35508:3ad582b2 default
parent child Browse files
Show More
@@ -675,10 +675,10 b' class localrepository(object):'
675 675 Intended to be overwritten by filtered repo."""
676 676 return self
677 677
678 def filtered(self, name):
678 def filtered(self, name, visibilityexceptions=None):
679 679 """Return a filtered version of a repository"""
680 680 cls = repoview.newtype(self.unfiltered().__class__)
681 return cls(self, name)
681 return cls(self, name, visibilityexceptions)
682 682
683 683 @repofilecache('bookmarks', 'bookmarks.current')
684 684 def _bookmarks(self):
@@ -187,11 +187,14 b' class repoview(object):'
187 187 subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
188 188 """
189 189
190 def __init__(self, repo, filtername):
190 def __init__(self, repo, filtername, visibilityexceptions=None):
191 191 object.__setattr__(self, r'_unfilteredrepo', repo)
192 192 object.__setattr__(self, r'filtername', filtername)
193 193 object.__setattr__(self, r'_clcachekey', None)
194 194 object.__setattr__(self, r'_clcache', None)
195 # revs which are exceptions and must not be hidden
196 object.__setattr__(self, r'_visibilityexceptions',
197 visibilityexceptions)
195 198
196 199 # not a propertycache on purpose we shall implement a proper cache later
197 200 @property
@@ -227,11 +230,11 b' class repoview(object):'
227 230 """Return an unfiltered version of a repo"""
228 231 return self._unfilteredrepo
229 232
230 def filtered(self, name):
233 def filtered(self, name, visibilityexceptions=None):
231 234 """Return a filtered version of a repository"""
232 if name == self.filtername:
235 if name == self.filtername and not visibilityexceptions:
233 236 return self
234 return self.unfiltered().filtered(name)
237 return self.unfiltered().filtered(name, visibilityexceptions)
235 238
236 239 def __repr__(self):
237 240 return r'<%s:%s %r>' % (self.__class__.__name__,
General Comments 0
You need to be logged in to leave comments. Login now