Mercurial > hg
comparison mercurial/context.py @ 21481:2f1567ef70ba
basectx: add _matchstatus method for factoring out last of parentworking logic
This patch paves the way to allow a workingctx to override the match object
with a custom 'bad' method for cases where status is sent a directory pattern.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 23 Apr 2014 15:39:30 -0500 |
parents | d19f491e5d5b |
children | 869a28d016e9 |
comparison
equal
deleted
inserted
replaced
21480:d19f491e5d5b | 21481:2f1567ef70ba |
---|---|
75 return mf | 75 return mf |
76 for fn in mf.keys(): | 76 for fn in mf.keys(): |
77 if not match(fn): | 77 if not match(fn): |
78 del mf[fn] | 78 del mf[fn] |
79 return mf | 79 return mf |
80 | |
81 def _matchstatus(self, other, s, match, listignored, listclean, | |
82 listunknown): | |
83 """return match.always if match is none | |
84 | |
85 This internal method provides a way for child objects to override the | |
86 match operator. | |
87 """ | |
88 return match or matchmod.always(self._repo.root, self._repo.getcwd()) | |
80 | 89 |
81 def _prestatus(self, other, s, match, listignored, listclean, listunknown): | 90 def _prestatus(self, other, s, match, listignored, listclean, listunknown): |
82 """provide a hook to allow child objects to preprocess status results | 91 """provide a hook to allow child objects to preprocess status results |
83 | 92 |
84 For example, this allows other contexts, such as workingctx, to query | 93 For example, this allows other contexts, such as workingctx, to query |