extdiff: 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/D7390
--- a/hgext/extdiff.py Wed Nov 13 20:32:24 2019 -0500
+++ b/hgext/extdiff.py Thu Nov 14 15:24:22 2019 -0500
@@ -401,13 +401,14 @@
if node2 is None:
raise error.Abort(_(b'--patch requires two revisions'))
else:
- mod_a, add_a, rem_a = map(
- set, repo.status(node1a, node2, matcher, listsubrepos=subrepos)[:3]
- )
+ st = repo.status(node1a, node2, matcher, listsubrepos=subrepos)
+ mod_a, add_a, rem_a = set(st.modified), set(st.added), set(st.removed)
if do3way:
- mod_b, add_b, rem_b = map(
- set,
- repo.status(node1b, node2, matcher, listsubrepos=subrepos)[:3],
+ stb = repo.status(node1b, node2, matcher, listsubrepos=subrepos)
+ mod_b, add_b, rem_b = (
+ set(stb.modified),
+ set(stb.added),
+ set(stb.removed),
)
else:
mod_b, add_b, rem_b = set(), set(), set()