mercurial/localrepo.py
changeset 18137 d8e7b3a14957
parent 18131 f0eeb9b3444a
child 18162 df1b37c8ae67
--- a/mercurial/localrepo.py	Wed Dec 26 15:04:07 2012 -0800
+++ b/mercurial/localrepo.py	Fri Dec 28 00:02:40 2012 +0100
@@ -2395,7 +2395,11 @@
             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")