changeset 43692:4093fc1777c2

logcmdutil: use field names instead of field numbers on scmutil.status As part of my pytype adventures I want to make scmutil.status no longer a subclass of tuple. This is part of that process. Differential Revision: https://phab.mercurial-scm.org/D7400
author Augie Fackler <augie@google.com>
date Thu, 14 Nov 2019 15:27:50 -0500
parents e035a8f71d52
children d649de29f1ff
files mercurial/logcmdutil.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Thu Nov 14 15:27:40 2019 -0500
+++ b/mercurial/logcmdutil.py	Thu Nov 14 15:27:50 2019 -0500
@@ -339,8 +339,11 @@
         self._exthook(ctx)
 
         if self.ui.debugflag:
-            files = ctx.p1().status(ctx)[:3]
-            for key, value in zip([b'files', b'files+', b'files-'], files):
+            files = ctx.p1().status(ctx)
+            for key, value in zip(
+                [b'files', b'files+', b'files-'],
+                [files.modified, files.added, files.removed],
+            ):
                 if value:
                     self.ui.write(
                         columns[key] % b" ".join(value),
@@ -470,9 +473,9 @@
         ):
             files = ctx.p1().status(ctx)
             fm.data(
-                modified=fm.formatlist(files[0], name=b'file'),
-                added=fm.formatlist(files[1], name=b'file'),
-                removed=fm.formatlist(files[2], name=b'file'),
+                modified=fm.formatlist(files.modified, name=b'file'),
+                added=fm.formatlist(files.added, name=b'file'),
+                removed=fm.formatlist(files.removed, name=b'file'),
             )
 
         verbose = not self.ui.debugflag and self.ui.verbose