Patchwork D7287: simplemerge: disable a pytype error where it's just confused

login
register
mail settings
Submitter phabricator
Date Nov. 7, 2019, 8:35 a.m.
Message ID <cd9a933e83b368b45dce3e09f4cbc32e@localhost.localdomain>
Download mbox | patch
Permalink /patch/42881/
State Not Applicable
Headers show

Comments

phabricator - Nov. 7, 2019, 8:35 a.m.
Closed by commit rHG3b581ad59459: simplemerge: disable a pytype error where it&#039;s just confused (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7287?vs=17657&id=17701

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

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

AFFECTED FILES
  mercurial/simplemerge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py
--- a/mercurial/simplemerge.py
+++ b/mercurial/simplemerge.py
@@ -291,7 +291,19 @@ 
             if region[0] != b"conflict":
                 yield region
                 continue
-            issue, z1, z2, a1, a2, b1, b2 = region
+            # pytype thinks this tuple contains only 3 things, but
+            # that's clearly not true because this code successfully
+            # executes. It might be wise to rework merge_regions to be
+            # some kind of attrs type.
+            (
+                issue,
+                z1,
+                z2,
+                a1,
+                a2,
+                b1,
+                b2,
+            ) = region  # pytype: disable=bad-unpacking
             alen = a2 - a1
             blen = b2 - b1