# HG changeset patch # User Sean Farley # Date 1397594610 18000 # Node ID 870ddcf24291f5a0f666552c600c3234c3fd1e65 # Parent 6c90a18dd926e6975e2e81eb06de7da4f21b9edb localrepo: factor out _manifestmatch logic for workingctx diff -r 6c90a18dd926 -r 870ddcf24291 mercurial/context.py --- a/mercurial/context.py Tue Mar 11 18:38:44 2014 -0500 +++ b/mercurial/context.py Tue Apr 15 15:43:30 2014 -0500 @@ -1228,6 +1228,23 @@ pass return modified, fixup + def _manifestmatches(self, match, s): + """Slow path for workingctx + + The fast path is when we compare the working directory to its parent + which means this function is comparing with a non-parent; therefore we + need to build a manifest and return what matches. + """ + mf = self._repo['.']._manifestmatches(match, s) + modified, added, removed = s[0:3] + for f in modified + added: + mf[f] = None + mf.set(f, self.flags(f)) + for f in removed: + if f in mf: + del mf[f] + return mf + def _dirstatestatus(self, match=None, ignored=False, clean=False, unknown=False): '''Gets the status from the dirstate -- internal use only.'''