# HG changeset patch # User Pierre-Yves David # Date 2012-12-27 23:02:40 # Node ID d8e7b3a14957d9f9c341732cc4ec18b708bed5ff # Parent f23dea2b296e0ec2845fc27746dad6341fa2e338 strip: do not update branchcache during strip (issue3745) At this moment, the cache is invalid, and will be thrown away. Later the strip function will call the `localrepo.destroyed` method that will update the branchmap cache. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2395,7 +2395,11 @@ class localrepository(object): tr.close() if changesets > 0: - branchmap.updatecache(self) + if srctype != 'strip': + # During strip, branchcache is invalid but coming call to + # `destroyed` will repair it. + # In other case we can safely update cache on disk. + branchmap.updatecache(self) def runhooks(): # forcefully update the on-disk branch cache self.ui.debug("updating the branch cache\n") diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -507,7 +507,6 @@ amend $ hg -q commit -d '14 1' -m 'prepare amend' $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords - invalidating branch cache (tip differs) overwriting a expanding keywords $ hg -q id 67d8c481a6be