Mercurial > hg
changeset 51810:07086b3ad502
typing: declare the `_phasesets` member of `phasecache` to be `Optional`
Something in this area got flagged while making the repository class visible to
pytype (instead of being typed as `Any`). A None assignment to something not
optional is wrong, and when I tried setting it to `{}` to keep it non-Optional,
some tests failed. There are checks for the attr being None elsewhere, so this
seems to have just been an oversight.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 17 Aug 2024 17:38:35 -0400 |
parents | 45270e286bdc |
children | 673b07a1db08 |
files | mercurial/phases.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/phases.py Fri Aug 16 18:11:52 2024 -0400 +++ b/mercurial/phases.py Sat Aug 17 17:38:35 2024 -0400 @@ -387,7 +387,7 @@ self._phaseroots: Phaseroots = loaded[0] self.dirty: bool = loaded[1] self._loadedrevslen = 0 - self._phasesets: PhaseSets = None + self._phasesets: Optional[PhaseSets] = None def hasnonpublicphases(self, repo: "localrepo.localrepository") -> bool: """detect if there are revisions with non-public phase"""