changeset 43693:d649de29f1ff

patch: 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/D7401
author Augie Fackler <augie@google.com>
date Thu, 14 Nov 2019 15:27:58 -0500
parents 4093fc1777c2
children d212d657ba0e
files mercurial/patch.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Nov 14 15:27:50 2019 -0500
+++ b/mercurial/patch.py	Thu Nov 14 15:27:58 2019 -0500
@@ -2605,7 +2605,14 @@
 
     if not changes:
         changes = ctx1.status(ctx2, match=match)
-    modified, added, removed = changes[:3]
+    if isinstance(changes, list):
+        modified, added, removed = changes[:3]
+    else:
+        modified, added, removed = (
+            changes.modified,
+            changes.added,
+            changes.removed,
+        )
 
     if not modified and not added and not removed:
         return []