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.
--- 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"""