Patchwork D7294: cmdutil: suppress bogus pytype errors

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 11:02 p.m.
Message ID <differential-rev-PHID-DREV-pehx7cq4qx37wrpg4jqx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42847/
State Superseded
Headers show

Comments

phabricator - Nov. 6, 2019, 11:02 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  pytype seems to handle our subclass of tuple (scmutil.status)
  especially poorly. We should probably file a bug.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -347,7 +347,7 @@ 
                 ui, originalhunks, recordfn, operation
             )
     except crecordmod.fallbackerror as e:
-        ui.warn(b'%s\n' % e.message)
+        ui.warn(b'%s\n' % e.message)  # pytype: disable=attribute-error
         ui.warn(_(b'falling back to text mode\n'))
 
     return patch.filterpatch(ui, originalhunks, match, operation)
@@ -435,7 +435,7 @@ 
                 copymod.copy(status[3]),
                 copymod.copy(status[4]),
                 copymod.copy(status[5]),
-                copymod.copy(status[6]),
+                copymod.copy(status[6]),  # pytype: disable=wrong-arg-count
             )
 
             # Force allows -X subrepo to skip the subrepo.
@@ -1289,7 +1289,7 @@ 
             if isinstance(r, revlog.revlog):
                 pass
             elif util.safehasattr(r, b'_revlog'):
-                r = r._revlog
+                r = r._revlog  # pytype: disable=attribute-error
             elif r is not None:
                 raise error.Abort(_(b'%r does not appear to be a revlog') % r)