Patchwork D7456: scmutil: add assertions to help pytype

login
register
mail settings
Submitter phabricator
Date Nov. 19, 2019, 10:46 p.m.
Message ID <differential-rev-PHID-DREV-ez42wdxpteggm66cx4sk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43369/
State Superseded
Headers show

Comments

phabricator - Nov. 19, 2019, 10:46 p.m.
mharbison72 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/D7456

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1917,6 +1917,7 @@ 
         def wrapped(tr):
             repo = reporef()
             if filtername:
+                assert repo is not None  # help pytype
                 repo = repo.filtered(filtername)
             func(repo, tr)
 
@@ -1936,6 +1937,7 @@ 
             if cgheads:
                 htext = _(b" (%+d heads)") % cgheads
             msg = _(b"added %d changesets with %d changes to %d files%s\n")
+            assert repo is not None  # help pytype
             repo.ui.status(msg % (cgchangesets, cgrevisions, cgfiles, htext))
 
     if txmatch(_reportobsoletedsource):