mercurial/phases.py
changeset 51417 e0d329491709
parent 51416 0c04074f5414
child 51418 c9c017b34464
equal deleted inserted replaced
51416:0c04074f5414 51417:e0d329491709
   411         phases: Iterable[int],
   411         phases: Iterable[int],
   412         subset: Optional[Any] = None,
   412         subset: Optional[Any] = None,
   413     ) -> Any:
   413     ) -> Any:
   414         # TODO: finish typing this
   414         # TODO: finish typing this
   415         """return a smartset for the given phases"""
   415         """return a smartset for the given phases"""
   416         self._ensure_phase_sets(repo)  # ensure phase's sets are loaded
   416         self._ensure_phase_sets(repo.unfiltered())
   417         phases = set(phases)
   417         phases = set(phases)
   418         publicphase = public in phases
   418         publicphase = public in phases
   419 
   419 
   420         if publicphase:
   420         if publicphase:
   421             # In this case, phases keeps all the *other* phases.
   421             # In this case, phases keeps all the *other* phases.
   534         if rev < nullrev:
   534         if rev < nullrev:
   535             raise ValueError(_(b'cannot lookup negative revision'))
   535             raise ValueError(_(b'cannot lookup negative revision'))
   536         # double check self._loadedrevslen to avoid an extra method call as
   536         # double check self._loadedrevslen to avoid an extra method call as
   537         # python is slow for that.
   537         # python is slow for that.
   538         if rev >= self._loadedrevslen:
   538         if rev >= self._loadedrevslen:
   539             self._ensure_phase_sets(repo)
   539             self._ensure_phase_sets(repo.unfiltered())
   540         for phase in trackedphases:
   540         for phase in trackedphases:
   541             if rev in self._phasesets[phase]:
   541             if rev in self._phasesets[phase]:
   542                 return phase
   542                 return phase
   543         return public
   543         return public
   544 
   544