comparison mercurial/localrepo.py @ 35309:d13526333835

phases: drop the list with phase of each rev, always comput phase sets Change the C implementation of phasecache.loadphaserevs to provide only the sets for draft and secret phase as well as the number of revisions seen. Change the pure Python implementation of the same functino to compute the sets instead of the list of phases for each revision. Change phasecache.phase to check the phase sets and assume public if the revision is in neither draft nor secret set. This is computationally slightly more expensive. Change phasecache.getrevset for public() based queries to compute the set of non-matching revisions and return the result as filtered fullreposet. A shortcut is taken when no draft or secret revision exists. Bump the module version for the changed interface contract. Overall, this saves around 16 Bytes per revision whenever the phasecache is used, for the test case in issue5691 it is around 3MB. getrevset() for a large repository is around 13% slower here, that seems an acceptable trade off. Performance impact for phase() should be similar. Differential Revision: https://phab.mercurial-scm.org/D1606
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 06 Dec 2017 15:46:41 +0100
parents 137a08d82232
children 3ad582b2895c
comparison
equal deleted inserted replaced
35308:137a08d82232 35309:d13526333835
686 686
687 @property 687 @property
688 def _activebookmark(self): 688 def _activebookmark(self):
689 return self._bookmarks.active 689 return self._bookmarks.active
690 690
691 # _phaserevs and _phasesets depend on changelog. what we need is to 691 # _phasesets depend on changelog. what we need is to call
692 # call _phasecache.invalidate() if '00changelog.i' was changed, but it 692 # _phasecache.invalidate() if '00changelog.i' was changed, but it
693 # can't be easily expressed in filecache mechanism. 693 # can't be easily expressed in filecache mechanism.
694 @storecache('phaseroots', '00changelog.i') 694 @storecache('phaseroots', '00changelog.i')
695 def _phasecache(self): 695 def _phasecache(self):
696 return phases.phasecache(self, self._phasedefaults) 696 return phases.phasecache(self, self._phasedefaults)
697 697