mercurial/branchmap.py
changeset 24377 656f93ce66d5
parent 24376 203a078da052
child 24378 9347c15d8136
--- a/mercurial/branchmap.py	Tue Feb 10 20:04:47 2015 -0800
+++ b/mercurial/branchmap.py	Tue Feb 10 20:06:12 2015 -0800
@@ -414,7 +414,11 @@
         self._rbcrevs[rbcrevidx:rbcrevidx + _rbcrecsize] = rec
         self._rbcrevslen = min(self._rbcrevslen, rev)
 
-    def write(self):
+        tr = self._repo.currenttransaction()
+        if tr:
+            tr.addfinalize('write-revbranchcache', self.write)
+
+    def write(self, tr=None):
         """Save branch cache if it is dirty."""
         repo = self._repo
         if self._rbcnamescount < len(self._names):