Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 18396:dd3fd3353e23
destroyed: update `unserved` branchcache instead
Before this changesets the `destroyed` function updated the branchcache for
unfiltered repository. As seen in a previous changeset, Read only repo does
not cares about the unfiltered repo. We now update it for `unserved`.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 15 Jan 2013 23:33:07 +0100 |
parents | 904b7109938e |
children | ecf4f79cc600 |
comparison
equal
deleted
inserted
replaced
18395:904b7109938e | 18396:dd3fd3353e23 |
---|---|
1384 to be flushed when the current lock is released. Because a call to | 1384 to be flushed when the current lock is released. Because a call to |
1385 destroyed is imminent, the repo will be invalidated causing those | 1385 destroyed is imminent, the repo will be invalidated causing those |
1386 changes to stay in memory (waiting for the next unlock), or vanish | 1386 changes to stay in memory (waiting for the next unlock), or vanish |
1387 completely. | 1387 completely. |
1388 ''' | 1388 ''' |
1389 # It simplifies the logic around updating the branchheads cache if we | |
1390 # only have to consider the effect of the stripped revisions and not | |
1391 # revisions missing because the cache is out-of-date. | |
1392 branchmap.updatecache(self) | |
1393 | |
1394 # When using the same lock to commit and strip, the phasecache is left | 1389 # When using the same lock to commit and strip, the phasecache is left |
1395 # dirty after committing. Then when we strip, the repo is invalidated, | 1390 # dirty after committing. Then when we strip, the repo is invalidated, |
1396 # causing those changes to disappear. | 1391 # causing those changes to disappear. |
1397 if '_phasecache' in vars(self): | 1392 if '_phasecache' in vars(self): |
1398 self._phasecache.write() | 1393 self._phasecache.write() |
1419 # the removed nodes now and write the updated cache. | 1414 # the removed nodes now and write the updated cache. |
1420 if '_phasecache' in self._filecache: | 1415 if '_phasecache' in self._filecache: |
1421 self._phasecache.filterunknown(self) | 1416 self._phasecache.filterunknown(self) |
1422 self._phasecache.write() | 1417 self._phasecache.write() |
1423 | 1418 |
1424 # update branchcache information likely invalidated by the strip. | 1419 # update the 'served' branch cache to help read only server process |
1425 # We rely on branchcache collaboration for this call to be fast | 1420 # Thanks to branchcach collaboration this is done from the nearest |
1426 branchmap.updatecache(self) | 1421 # filtered subset and it is expected to be fast. |
1422 branchmap.updatecache(self.filtered('served')) | |
1427 | 1423 |
1428 # Ensure the persistent tag cache is updated. Doing it now | 1424 # Ensure the persistent tag cache is updated. Doing it now |
1429 # means that the tag cache only has to worry about destroyed | 1425 # means that the tag cache only has to worry about destroyed |
1430 # heads immediately after a strip/rollback. That in turn | 1426 # heads immediately after a strip/rollback. That in turn |
1431 # guarantees that "cachetip == currenttip" (comparing both rev | 1427 # guarantees that "cachetip == currenttip" (comparing both rev |