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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Nov 6 22:59:48 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/simplemerge.py

CHANGE DETAILS

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
 



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


More information about the Mercurial-devel mailing list