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.
--- 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)