changeset 21468:870ddcf24291

localrepo: factor out _manifestmatch logic for workingctx
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 15 Apr 2014 15:43:30 -0500
parents 6c90a18dd926
children 65cdc6bab91e
files mercurial/context.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.'''