Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 42231:d345627d104b
repoview: introduce a `experimental.extra-filter-revs` config
The option define revisions to additionally filter out of all repository "view".
The end goal is to provide and easy to way to serve multiple subset of the same
repository using multiple "shares".
The simplest use case of this feature is to have one view serving the public
changesets and one view also serving the draft. This is currently achievable
using the new `server.view` option introduced recently by Joerg Sonnenberger.
However, more advanced use cases need more advanced definitions. For example
some needs a view dedicated to some release branches, or view that hides
security fixes to be released. Joerg Sonnenberger and I discussed this topic at
the recent mini-sprint and the both of us have seen real life use cases for
this. (This series got written during the same mini-sprint).
The feature is fully functional, and use similar cache-fallback mechanism to
ensure decent performance. However,there remaining room to ensure each share
caches and hooks collaborate with each others. This will come at a later time
once users start to actually test this feature on real usecase.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 06 Apr 2019 17:46:19 +0200 |
parents | 0e41f40b01cc |
children | 32338e27bb9d |
comparison
equal
deleted
inserted
replaced
42230:fdbeacb9d456 | 42231:d345627d104b |
---|---|
1048 # Key to signature value. | 1048 # Key to signature value. |
1049 self._sparsesignaturecache = {} | 1049 self._sparsesignaturecache = {} |
1050 # Signature to cached matcher instance. | 1050 # Signature to cached matcher instance. |
1051 self._sparsematchercache = {} | 1051 self._sparsematchercache = {} |
1052 | 1052 |
1053 self._extrafilterid = repoview.extrafilter(ui) | |
1054 | |
1053 def _getvfsward(self, origfunc): | 1055 def _getvfsward(self, origfunc): |
1054 """build a ward for self.vfs""" | 1056 """build a ward for self.vfs""" |
1055 rref = weakref.ref(self) | 1057 rref = weakref.ref(self) |
1056 def checkvfs(path, mode=None): | 1058 def checkvfs(path, mode=None): |
1057 ret = origfunc(path, mode=mode) | 1059 ret = origfunc(path, mode=mode) |
1195 example calling `repo.filtered("served")` will return a repoview using | 1197 example calling `repo.filtered("served")` will return a repoview using |
1196 the "served" view, regardless of the initial view used by `repo`. | 1198 the "served" view, regardless of the initial view used by `repo`. |
1197 | 1199 |
1198 In other word, there is always only one level of `repoview` "filtering". | 1200 In other word, there is always only one level of `repoview` "filtering". |
1199 """ | 1201 """ |
1202 if self._extrafilterid is not None and '%' not in name: | |
1203 name = name + '%' + self._extrafilterid | |
1204 | |
1200 cls = repoview.newtype(self.unfiltered().__class__) | 1205 cls = repoview.newtype(self.unfiltered().__class__) |
1201 return cls(self, name, visibilityexceptions) | 1206 return cls(self, name, visibilityexceptions) |
1202 | 1207 |
1203 @repofilecache('bookmarks', 'bookmarks.current') | 1208 @repofilecache('bookmarks', 'bookmarks.current') |
1204 def _bookmarks(self): | 1209 def _bookmarks(self): |