Patchwork D7390: extdiff: use field names instead of field numbers on scmutil.status

login
register
mail settings
Submitter phabricator
Date Nov. 14, 2019, 9:08 p.m.
Message ID <differential-rev-PHID-DREV-uwgd7d2chpgv3z7rrty3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43193/
State Superseded
Headers show

Comments

phabricator - Nov. 14, 2019, 9:08 p.m.
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/D7390

AFFECTED FILES
  hgext/extdiff.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 15, 2019, 3:20 a.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  THANK YOU.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7390/new/

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

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

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -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()