diff mercurial/changelog.py @ 23280:b01c491af0cf

transaction: pass the transaction to 'pending' callback The callback will likely need to perform some operation related to the transaction (eg: backing files up). So we better pass the current transaction as the callback argument. Otherwise callback that needs it has to rely on horrible weak reference trick. The first foreseen user of this is changelog._writepending. We would like it to register the temporary file it create for cleanup purpose.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 08 Nov 2014 16:27:50 +0000
parents 2d54aa5397cd
children f60ed8cf4afc
line wrap: on
line diff
--- a/mercurial/changelog.py	Wed Nov 05 10:22:17 2014 +0000
+++ b/mercurial/changelog.py	Sat Nov 08 16:27:50 2014 +0000
@@ -270,7 +270,7 @@
         self._nodecache = r._nodecache
         self._chunkcache = r._chunkcache
 
-    def _writepending(self):
+    def _writepending(self, tr):
         "create a file containing the unfinalized state for pretxnchangegroup"
         if self._delaybuf:
             # make a temporary copy of the index