comparison mercurial/revlog.py @ 48283:ebac18733142

typing: add a few assertions to revlog.py to help pytype I've seen this before, but this was seen as potentially `None` with pytype 2021.10.18. Differential Revision: https://phab.mercurial-scm.org/D11718
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 23 Oct 2021 16:04:05 -0400
parents 60ccc86a12f3
children c514936d92b4 ccd9cb73125c
comparison
equal deleted inserted replaced
48282:0d6a099bba58 48283:ebac18733142
2579 ifh.write(data[1]) 2579 ifh.write(data[1])
2580 assert not sidedata 2580 assert not sidedata
2581 self._enforceinlinesize(transaction) 2581 self._enforceinlinesize(transaction)
2582 if self._docket is not None: 2582 if self._docket is not None:
2583 # revlog-v2 always has 3 writing handles, help Pytype 2583 # revlog-v2 always has 3 writing handles, help Pytype
2584 assert self._writinghandles[2] is not None 2584 wh1 = self._writinghandles[0]
2585 self._docket.index_end = self._writinghandles[0].tell() 2585 wh2 = self._writinghandles[1]
2586 self._docket.data_end = self._writinghandles[1].tell() 2586 wh3 = self._writinghandles[2]
2587 self._docket.sidedata_end = self._writinghandles[2].tell() 2587 assert wh1 is not None
2588 assert wh2 is not None
2589 assert wh3 is not None
2590 self._docket.index_end = wh1.tell()
2591 self._docket.data_end = wh2.tell()
2592 self._docket.sidedata_end = wh3.tell()
2588 2593
2589 nodemaputil.setup_persistent_nodemap(transaction, self) 2594 nodemaputil.setup_persistent_nodemap(transaction, self)
2590 2595
2591 def addgroup( 2596 def addgroup(
2592 self, 2597 self,