Mercurial > hg
comparison mercurial/dirstatemap.py @ 47770:460e479be66e
typing: add several assertions to dirstatemap to appease pytype
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
Differential Revision: https://phab.mercurial-scm.org/D11235
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 30 Jul 2021 00:11:56 -0400 |
parents | b0314d8deee1 |
children | 3853e6ee160d |
comparison
equal
deleted
inserted
replaced
47758:ec77f709495c | 47770:460e479be66e |
---|---|
207 size = NONNORMAL | 207 size = NONNORMAL |
208 mtime = AMBIGUOUS_TIME | 208 mtime = AMBIGUOUS_TIME |
209 else: | 209 else: |
210 assert size != FROM_P2 | 210 assert size != FROM_P2 |
211 assert size != NONNORMAL | 211 assert size != NONNORMAL |
212 assert size is not None | |
213 assert mtime is not None | |
214 | |
212 state = b'n' | 215 state = b'n' |
213 size = size & rangemask | 216 size = size & rangemask |
214 mtime = mtime & rangemask | 217 mtime = mtime & rangemask |
215 assert state is not None | 218 assert state is not None |
216 assert size is not None | 219 assert size is not None |