Patchwork D10211: typing: add an assertion to mercurial/hgweb/webcommands.py to help pytype

login
register
mail settings
Submitter phabricator
Date March 13, 2021, 7:34 p.m.
Message ID <differential-rev-PHID-DREV-wrwjxvdbfcun4oreuhfq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48525/
State Superseded
Headers show

Comments

phabricator - March 13, 2021, 7:34 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 this is needed, given the check immediately above.  But
  without it, I'm getting this:
  
    File "/mnt/c/Users/Matt/hg/mercurial/hgweb/webcommands.py", line 1164, in filelog: Missing parameter 'toline' in call to function mercurial.dagop.blockdescendants [missing-parameter]
             Expected: (fctx, fromline, toline)
      Actually passed: (fctx, fromline)
    File "/mnt/c/Users/Matt/hg/mercurial/hgweb/webcommands.py", line 1166, in filelog: Missing parameter 'toline' in call to function mercurial.dagop.blockancestors [missing-parameter]
             Expected: (fctx, fromline, toline, followfirst)
      Actually passed: (fctx, fromline)

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1156,6 +1156,7 @@ 
 
     linerange = None
     if lrange is not None:
+        assert lrange is not None  # help pytype (!?)
         linerange = webutil.formatlinerange(*lrange)
         # deactivate numeric nav links when linerange is specified as this
         # would required a dedicated "revnav" class