Mercurial > hg
changeset 21466:3b1ec3d4ece6
basectx: add _manifestmatches method
This method is a duplicate of localrepo.mfmatches and sets the stage for
factoring localrepo.status into a context method that will be customizable
based on inheritance and object type.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 23 Apr 2014 20:52:10 -0500 |
parents | 2edb8648c500 |
children | 6c90a18dd926 |
files | mercurial/context.py |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Tue Mar 11 18:35:39 2014 -0500 +++ b/mercurial/context.py Wed Apr 23 20:52:10 2014 -0500 @@ -63,6 +63,21 @@ for f in sorted(self._manifest): yield f + def _manifestmatches(self, match, s): + """generate a new manifest filtered by the match argument + + This method is for internal use only and mainly exists to provide an + object oriented way for other contexts to customize the manifest + generation. + """ + mf = self.manifest().copy() + if match.always(): + return mf + for fn in mf.keys(): + if not match(fn): + del mf[fn] + return mf + @propertycache def substate(self): return subrepo.state(self, self._repo.ui)