Patchwork D7456: scmutil: add assertions to help pytype

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2019, 1:35 p.m.
Message ID <c2415c0b34abc6acf4cdafb620228241@localhost.localdomain>
Download mbox | patch
Permalink /patch/43383/
State Not Applicable
Headers show

Comments

phabricator - Nov. 21, 2019, 1:35 p.m.
Closed by commit rHG5b90a050082b: scmutil: add assertions to help pytype (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7456?vs=18245&id=18257

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7456/new/

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers, indygreg, dlax, pulkit
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):