changeset 23303:3f269bd4826c

context.status: avoid de- and reconstructing status tuple We can just modify the status tuple we got from dirstate.status() instead of deconstructing it and constructing a new instance, thereby simplifying the code a little.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 12 Nov 2014 22:07:31 -0800
parents 24f67ad49da7
children dd3f857598a0
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed Nov 12 16:51:11 2014 -0800
+++ b/mercurial/context.py	Wed Nov 12 22:07:31 2014 -0800
@@ -1408,19 +1408,17 @@
             subrepos = sorted(self.substate)
         cmp, s = self._repo.dirstate.status(match, subrepos, listignored,
                                             listclean, listunknown)
-        modified, added, removed, deleted, unknown, ignored, clean = s
 
         # check for any possibly clean files
         if cmp:
             modified2, fixup = self._checklookup(cmp)
-            modified += modified2
+            s.modified.extend(modified2)
 
             # update dirstate for files that are actually clean
             if fixup and listclean:
-                clean += fixup
+                s.clean.extend(fixup)
 
-        return scmutil.status(modified, added, removed, deleted, unknown,
-                              ignored, clean)
+        return s
 
     def _buildstatus(self, other, s, match, listignored, listclean,
                      listunknown):