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
--- 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 []