comparison hgext/mq.py @ 16657:b6081c2c4647

phases: introduce phasecache The original motivation was changectx.phase() had special logic to correctly lookup in repo._phaserev, including invalidating it when necessary. And at other places, repo._phaserev was accessed directly. This led to the discovery that phases state including _phaseroots, _phaserev and _dirtyphase was manipulated in localrepository.py, phases.py, repair.py, etc. phasecache helps encapsulating that. This patch replaces all phase state in localrepo with phasecache and adjust related code except for advance/retractboundary() in phases. These still access to phasecache internals directly. This will be addressed in a followup.
author Patrick Mezard <patrick@mezard.eu>
date Sat, 12 May 2012 00:24:07 +0200
parents 4ae3ba9e4d7a
children 525fdb738975
comparison
equal deleted inserted replaced
16656:4ae3ba9e4d7a 16657:b6081c2c4647
881 return patches 881 return patches
882 882
883 def finish(self, repo, revs): 883 def finish(self, repo, revs):
884 # Manually trigger phase computation to ensure phasedefaults is 884 # Manually trigger phase computation to ensure phasedefaults is
885 # executed before we remove the patches. 885 # executed before we remove the patches.
886 repo._phaserev 886 repo._phasecache
887 patches = self._revpatches(repo, sorted(revs)) 887 patches = self._revpatches(repo, sorted(revs))
888 qfinished = self._cleanup(patches, len(patches)) 888 qfinished = self._cleanup(patches, len(patches))
889 if qfinished and repo.ui.configbool('mq', 'secret', False): 889 if qfinished and repo.ui.configbool('mq', 'secret', False):
890 # only use this logic when the secret option is added 890 # only use this logic when the secret option is added
891 oldqbase = repo[qfinished[0]] 891 oldqbase = repo[qfinished[0]]