--- a/mercurial/phases.py Sun Jan 05 22:26:16 2025 -0500
+++ b/mercurial/phases.py Mon Jan 06 00:30:55 2025 -0500
@@ -190,19 +190,19 @@
no_bundle_phases = all_internal_phases
-def supportinternal(repo: "localrepo.localrepository") -> bool:
+def supportinternal(repo: localrepo.localrepository) -> bool:
"""True if the internal phase can be used on a repository"""
return requirements.INTERNAL_PHASE_REQUIREMENT in repo.requirements
-def supportarchived(repo: "localrepo.localrepository") -> bool:
+def supportarchived(repo: localrepo.localrepository) -> bool:
"""True if the archived phase can be used on a repository"""
return requirements.ARCHIVED_PHASE_REQUIREMENT in repo.requirements
def _readroots(
- repo: "localrepo.localrepository",
- phasedefaults: Optional["Phasedefaults"] = None,
+ repo: localrepo.localrepository,
+ phasedefaults: Optional[Phasedefaults] = None,
) -> Tuple[Phaseroots, bool]:
"""Read phase roots from disk
@@ -394,8 +394,8 @@
@overload
def __init__(
self,
- repo: "localrepo.localrepository",
- phasedefaults: Optional["Phasedefaults"],
+ repo: localrepo.localrepository,
+ phasedefaults: Optional[Phasedefaults],
_load: bool = True,
) -> None:
pass
@@ -414,16 +414,14 @@
self._loadedrevslen = 0
self._phasesets: Optional[PhaseSets] = None
- def hasnonpublicphases(self, repo: "localrepo.localrepository") -> bool:
+ def hasnonpublicphases(self, repo: localrepo.localrepository) -> bool:
"""detect if there are revisions with non-public phase"""
# XXX deprecate the unused repo argument
return any(
revs for phase, revs in self._phaseroots.items() if phase != public
)
- def nonpublicphaseroots(
- self, repo: "localrepo.localrepository"
- ) -> Set[int]:
+ def nonpublicphaseroots(self, repo: localrepo.localrepository) -> Set[int]:
"""returns the roots of all non-public phases
The roots are not minimized, so if the secret revisions are
@@ -441,7 +439,7 @@
def get_raw_set(
self,
- repo: "localrepo.localrepository",
+ repo: localrepo.localrepository,
phase: int,
) -> Set[int]:
"""return the set of revision in that phase
@@ -462,7 +460,7 @@
def getrevset(
self,
- repo: "localrepo.localrepository",
+ repo: localrepo.localrepository,
phases: Iterable[int],
subset: Optional[Any] = None,
) -> Any:
@@ -562,7 +560,7 @@
self._phasesets[phase] = ps
self._loadedrevslen = len(cl)
- def _ensure_phase_sets(self, repo: "localrepo.localrepository") -> None:
+ def _ensure_phase_sets(self, repo: localrepo.localrepository) -> None:
"""ensure phase information is loaded in the object"""
assert repo.filtername is None
update = -1
@@ -634,7 +632,7 @@
self._loadedrevslen = 0
self._phasesets = None
- def phase(self, repo: "localrepo.localrepository", rev: int) -> int:
+ def phase(self, repo: localrepo.localrepository, rev: int) -> int:
# We need a repo argument here to be able to build _phasesets
# if necessary. The repository instance is not stored in
# phasecache to avoid reference cycles. The changelog instance
@@ -1056,7 +1054,7 @@
repo._phasecache.replace(phcache)
-def listphases(repo: "localrepo.localrepository") -> Dict[bytes, bytes]:
+def listphases(repo: localrepo.localrepository) -> Dict[bytes, bytes]:
"""List phases root for serialization over pushkey"""
# Use ordered dictionary so behavior is deterministic.
keys = util.sortdict()
@@ -1089,7 +1087,7 @@
def pushphase(
- repo: "localrepo.localrepository",
+ repo: localrepo.localrepository,
nhex: bytes,
oldphasestr: bytes,
newphasestr: bytes,
@@ -1249,7 +1247,7 @@
return sorted(new_heads)
-def newcommitphase(ui: "uimod.ui") -> int:
+def newcommitphase(ui: uimod.ui) -> int:
"""helper to get the target phase of new commit
Handle all possible values for the phases.new-commit options.
@@ -1264,7 +1262,7 @@
)
-def hassecret(repo: "localrepo.localrepository") -> bool:
+def hassecret(repo: localrepo.localrepository) -> bool:
"""utility function that check if a repo have any secret changeset."""
return bool(repo._phasecache._phaseroots[secret])