comparison mercurial/localrepo.py @ 26405:c15d8f84343e stable

localrepo: recreate phasecache if changelog was modified (issue4855) Because _phaserevs and _phasesets cache revision numbers, they must be invalidated if there are new commits or stripped revisions. We could do that by calling _phasecache.invalidate(), but it wasn't simple to be integrated with the filecache mechanism. So for now, phasecache will be recreated after repo.invalidate() if 00changelog.i was modified before.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 29 Sep 2015 21:57:08 +0900
parents 800e090e9c64
children 19d946cf2a1b
comparison
equal deleted inserted replaced
26367:f31ddc9bfa5f 26405:c15d8f84343e
427 for mark, n in self._bookmarks.iteritems(): 427 for mark, n in self._bookmarks.iteritems():
428 if mark.split('@', 1)[0] == name: 428 if mark.split('@', 1)[0] == name:
429 heads.append(n) 429 heads.append(n)
430 return heads 430 return heads
431 431
432 @storecache('phaseroots') 432 # _phaserevs and _phasesets depend on changelog. what we need is to
433 # call _phasecache.invalidate() if '00changelog.i' was changed, but it
434 # can't be easily expressed in filecache mechanism.
435 @storecache('phaseroots', '00changelog.i')
433 def _phasecache(self): 436 def _phasecache(self):
434 return phases.phasecache(self, self._phasedefaults) 437 return phases.phasecache(self, self._phasedefaults)
435 438
436 @storecache('obsstore') 439 @storecache('obsstore')
437 def obsstore(self): 440 def obsstore(self):