( )⚙ D11235 typing: add several assertions to dirstatemap to appease pytype

This is an archive of the discontinued Mercurial Phabricator instance.

typing: add several assertions to dirstatemap to appease pytype
ClosedPublic

Authored by mharbison72 on Jul 30 2021, 1:13 AM.

Details

Summary

I think it's been mentioned in IRC that these can't be None in this case. This
fixes:

File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 213, in addfile: unsupported operand type(s) for &: 'None' and 'int' [unsupported-operands]
  No attribute '__and__' on None or '__rand__' on int
Called from (traceback):
  line 290, in reset_state
File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 214, in addfile: unsupported operand type(s) for &: 'None' and 'int' [unsupported-operands]
  No attribute '__and__' on None or '__rand__' on int
Called from (traceback):
  line 290, in reset_state

Diff Detail

Repository
rHG Mercurial
Branch
stable
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

mharbison72 created this revision.Jul 30 2021, 1:13 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.

For some reason, phabsend did not record the branch information (which was stable, according to Matt Harbison), so this went on default. It also shouldn't have landed on default at all since we're in a freeze, but the impact is minimal. I'll graft it to stable soon.