# HG changeset patch # User Matt Harbison # Date 1723930715 14400 # Node ID 07086b3ad50256744fb71150ae741d7b1e00468f # Parent 45270e286bdc7c638d1e89eceb6b6ad34a67d0bd 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. diff -r 45270e286bdc -r 07086b3ad502 mercurial/phases.py --- 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"""