basectx: add _manifestmatches method
authorSean Farley <sean.michael.farley@gmail.com>
Wed, 23 Apr 2014 20:52:10 -0500
changeset 21466 3b1ec3d4ece6
parent 21465 2edb8648c500
child 21467 6c90a18dd926
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.
mercurial/context.py
--- 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)