Patchwork D11924: pytype: stop excluding webcommands.py

login
register
mail settings
Submitter phabricator
Date Dec. 14, 2021, 9:12 p.m.
Message ID <differential-rev-PHID-DREV-3tiyznb5qxygvn6gjxtx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50249/
State New
Headers show

Comments

phabricator - Dec. 14, 2021, 9:12 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I have no idea why, but asserting that each value added to `emptydirs` is not
  None didn't fix this:
  
    File "/mnt/c/Users/Matt/hg/mercurial/hgweb/webcommands.py", line 621, in dirlist:
        Function bytes.join was called with the wrong arguments [wrong-arg-types]
             Expected: (self, iterable: Iterable[bytes])
      Actually passed: (self, iterable: List[None])

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py
  tests/test-check-pytype.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t
--- a/tests/test-check-pytype.t
+++ b/tests/test-check-pytype.t
@@ -18,7 +18,6 @@ 
 mercurial/exchange.py         # [attribute-error]
 mercurial/hgweb/hgweb_mod.py  # [attribute-error], [name-error], [wrong-arg-types]
 mercurial/hgweb/server.py     # [attribute-error], [name-error], [module-attr]
-mercurial/hgweb/webcommands.py  # [missing-parameter]
 mercurial/hgweb/wsgicgi.py    # confused values in os.environ
 mercurial/httppeer.py         # [attribute-error], [wrong-arg-types]
 mercurial/interfaces          # No attribute 'capabilities' on peer [attribute-error]
@@ -55,7 +54,6 @@ 
   >    -x mercurial/exchange.py \
   >    -x mercurial/hgweb/hgweb_mod.py \
   >    -x mercurial/hgweb/server.py \
-  >    -x mercurial/hgweb/webcommands.py \
   >    -x mercurial/hgweb/wsgicgi.py \
   >    -x mercurial/httppeer.py \
   >    -x mercurial/interfaces \
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -519,6 +519,7 @@ 
 
 
 def decodepath(path):
+    # type: (bytes) -> bytes
     """Hook for mapping a path in the repository to a path in the
     working copy.
 
@@ -616,7 +617,9 @@ 
             yield {
                 b"parity": next(parity),
                 b"path": path,
+                # pytype: disable=wrong-arg-types
                 b"emptydirs": b"/".join(emptydirs),
+                # pytype: enable=wrong-arg-types
                 b"basename": d,
             }