comparison mercurial/context.py @ 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 ed608a544719
children 870ddcf24291
comparison
equal deleted inserted replaced
21465:2edb8648c500 21466:3b1ec3d4ece6
60 return self.filectx(key) 60 return self.filectx(key)
61 61
62 def __iter__(self): 62 def __iter__(self):
63 for f in sorted(self._manifest): 63 for f in sorted(self._manifest):
64 yield f 64 yield f
65
66 def _manifestmatches(self, match, s):
67 """generate a new manifest filtered by the match argument
68
69 This method is for internal use only and mainly exists to provide an
70 object oriented way for other contexts to customize the manifest
71 generation.
72 """
73 mf = self.manifest().copy()
74 if match.always():
75 return mf
76 for fn in mf.keys():
77 if not match(fn):
78 del mf[fn]
79 return mf
65 80
66 @propertycache 81 @propertycache
67 def substate(self): 82 def substate(self):
68 return subrepo.state(self, self._repo.ui) 83 return subrepo.state(self, self._repo.ui)
69 84