diff mercurial/patch.py @ 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 9f70512ae2cf
children 7eb701e355bd
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 []