Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 51399:8f2ea3fa50fd
phases: explicitly filter stripped revision at strip time
Explicit is better than implicit. The current logic is bit subtle and fragile.
It also get in the way of using something else than node-id as internal storage.
We replace it with a more explicit filtering while striping.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 20 Feb 2024 14:21:18 +0100 |
parents | 58d39c7865e5 |
children | 04111ef08fb0 |
comparison
equal
deleted
inserted
replaced
51398:e2dfa403452d | 51399:8f2ea3fa50fd |
---|---|
3369 def destroyed(self): | 3369 def destroyed(self): |
3370 """Inform the repository that nodes have been destroyed. | 3370 """Inform the repository that nodes have been destroyed. |
3371 Intended for use by strip and rollback, so there's a common | 3371 Intended for use by strip and rollback, so there's a common |
3372 place for anything that has to be done after destroying history. | 3372 place for anything that has to be done after destroying history. |
3373 """ | 3373 """ |
3374 # When one tries to: | |
3375 # 1) destroy nodes thus calling this method (e.g. strip) | |
3376 # 2) use phasecache somewhere (e.g. commit) | |
3377 # | |
3378 # then 2) will fail because the phasecache contains nodes that were | |
3379 # removed. We can either remove phasecache from the filecache, | |
3380 # causing it to reload next time it is accessed, or simply filter | |
3381 # the removed nodes now and write the updated cache. | |
3382 self._phasecache.filterunknown(self) | |
3383 self._phasecache.write() | |
3384 | |
3385 # refresh all repository caches | 3374 # refresh all repository caches |
3386 self.updatecaches() | 3375 self.updatecaches() |
3387 | 3376 |
3388 # Ensure the persistent tag cache is updated. Doing it now | 3377 # Ensure the persistent tag cache is updated. Doing it now |
3389 # means that the tag cache only has to worry about destroyed | 3378 # means that the tag cache only has to worry about destroyed |