changeset 21399:3b6b1b407e99

localrepo: call _dirstatestatus instead of duplicating logic
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 11 Mar 2014 18:32:16 -0500
parents ed608a544719
children 78a60daacea8
files mercurial/localrepo.py
diffstat 1 files changed, 4 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Apr 22 13:20:30 2014 -0500
+++ b/mercurial/localrepo.py	Tue Mar 11 18:32:16 2014 -0500
@@ -1541,21 +1541,9 @@
             match.bad = bad
 
         if working: # we need to scan the working dir
-            subrepos = []
-            if '.hgsub' in self.dirstate:
-                subrepos = sorted(ctx2.substate)
-            s = self.dirstate.status(match, subrepos, listignored,
-                                     listclean, listunknown)
-            cmp, modified, added, removed, deleted, unknown, ignored, clean = s
-
-            # check for any possibly clean files
-            if parentworking and cmp:
-                modified2, fixup = ctx2._checklookup(cmp)
-                modified += modified2
-
-                # update dirstate for files that are actually clean
-                if fixup and listclean:
-                    clean += fixup
+            r = ctx2._dirstatestatus(match=match, ignored=listignored,
+                                     clean=listclean, unknown=listunknown)
+            modified, added, removed, deleted, unknown, ignored, clean = r
 
         if not parentworking:
             mf1 = mfmatches(ctx1)
@@ -1563,7 +1551,7 @@
                 # we are comparing working dir against non-parent
                 # generate a pseudo-manifest for the working dir
                 mf2 = mfmatches(self['.'])
-                for f in cmp + modified + added:
+                for f in modified + added:
                     mf2[f] = None
                     mf2.set(f, ctx2.flags(f))
                 for f in removed: