context.status: make _dirstatestatus() return an status tuple
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 12 Nov 2014 16:51:11 -0800
changeset 23302 24f67ad49da7
parent 23301 c10dc5568069
child 23303 3f269bd4826c
context.status: make _dirstatestatus() return an status tuple Letting _dirstatestatus() return an scmutil.status instance also means that _buildstatus() will always return such an instance, so we can remove the conversion from the call sites.
mercurial/context.py
--- a/mercurial/context.py	Wed Nov 12 21:19:07 2014 -0800
+++ b/mercurial/context.py	Wed Nov 12 16:51:11 2014 -0800
@@ -129,7 +129,8 @@
             unknown = [fn for fn in unknown if fn not in mf1]
             ignored = [fn for fn in ignored if fn not in mf1]
 
-        return [modified, added, removed, deleted, unknown, ignored, clean]
+        return scmutil.status(modified, added, removed, deleted, unknown,
+                              ignored, clean)
 
     @propertycache
     def substate(self):
@@ -304,7 +305,6 @@
         r = ctx2._buildstatus(ctx1, r, match, listignored, listclean,
                               listunknown)
 
-        r = scmutil.status(*r)
         if reversed:
             # Reverse added and removed. Clear deleted, unknown and ignored as
             # these make no sense to reverse.
@@ -1419,7 +1419,8 @@
             if fixup and listclean:
                 clean += fixup
 
-        return [modified, added, removed, deleted, unknown, ignored, clean]
+        return scmutil.status(modified, added, removed, deleted, unknown,
+                              ignored, clean)
 
     def _buildstatus(self, other, s, match, listignored, listclean,
                      listunknown):
@@ -1434,12 +1435,12 @@
         # Filter out symlinks that, in the case of FAT32 and NTFS filesytems,
         # might have accidentally ended up with the entire contents of the file
         # they are susposed to be linking to.
-        s[0] = self._filtersuspectsymlink(s[0])
+        s.modified[:] = self._filtersuspectsymlink(s.modified)
         if other != self._repo['.']:
             s = super(workingctx, self)._buildstatus(other, s, match,
                                                      listignored, listclean,
                                                      listunknown)
-        self._status = scmutil.status(*s)
+        self._status = s
         return s
 
     def _matchstatus(self, other, match):