D7403: subrepo: use field names instead of field numbers on scmutil.status

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 14 21:11:58 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As part of my pytype adventures I want to make scmutil.status no longer a
  subclass of tuple. This is part of that process.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7403

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1995,8 +1995,12 @@
         if match.always():
             output += self._gitcommand(cmd) + b'\n'
         else:
-            st = self.status(node2)[:3]
-            files = [f for sublist in st for f in sublist]
+            st = self.status(node2)
+            files = [
+                f
+                for sublist in (st.modified, st.added, st.removed)
+                for f in sublist
+            ]
             for f in files:
                 if match(f):
                     output += self._gitcommand(cmd + [b'--', f]) + b'\n'



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list