Mercurial > public > mercurial-scm > hg
comparison mercurial/phases.py @ 51582:c11d21faa73c
phases: introduce a performant efficient way to access revision in a set
This will be useful in the next changesets.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 05 Apr 2024 22:47:44 +0200 |
parents | 22cc679a7312 |
children | 493034cc3265 |
comparison
equal
deleted
inserted
replaced
51581:5b99b64328f2 | 51582:c11d21faa73c |
---|---|
411 revs | 411 revs |
412 for phase, revs in self._phaseroots.items() | 412 for phase, revs in self._phaseroots.items() |
413 if phase != public | 413 if phase != public |
414 ] | 414 ] |
415 ) | 415 ) |
416 | |
417 def get_raw_set( | |
418 self, | |
419 repo: "localrepo.localrepository", | |
420 phase: int, | |
421 ) -> Set[int]: | |
422 """return the set of revision in that phase | |
423 | |
424 The returned set is not filtered and might contains revision filtered | |
425 for the passed repoview. | |
426 | |
427 The returned set might be the internal one and MUST NOT be mutated to | |
428 avoid side effect. | |
429 """ | |
430 if phase == public: | |
431 raise error.ProgrammingError("cannot get_set for public phase") | |
432 self._ensure_phase_sets(repo.unfiltered()) | |
433 revs = self._phasesets.get(phase) | |
434 if revs is None: | |
435 return set() | |
436 return revs | |
416 | 437 |
417 def getrevset( | 438 def getrevset( |
418 self, | 439 self, |
419 repo: "localrepo.localrepository", | 440 repo: "localrepo.localrepository", |
420 phases: Iterable[int], | 441 phases: Iterable[int], |