diff mercurial/transaction.py @ 23282:6c1351352b6c

transaction: pass the transaction to 'postclose' callback This mirrors the API for 'pending' and 'finalize' callbacks. I do not have immediate usage planned for it, but I'm sure some callback will be happy to access transaction related data.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 08 Nov 2014 16:35:15 +0000
parents f60ed8cf4afc
children b04263c38a92
line wrap: on
line diff
--- a/mercurial/transaction.py	Sat Nov 08 16:31:38 2014 +0000
+++ b/mercurial/transaction.py	Sat Nov 08 16:35:15 2014 +0000
@@ -315,6 +315,8 @@
     def addpostclose(self, category, callback):
         """add a callback to be called after the transaction is closed
 
+        The transaction will be given as callback's first argument.
+
         Category is a unique identifier to allow overwriting an old callback
         with a newer callback.
         """
@@ -350,7 +352,7 @@
         # run post close action
         categories = sorted(self._postclosecallback)
         for cat in categories:
-            self._postclosecallback[cat]()
+            self._postclosecallback[cat](self)
 
     @active
     def abort(self):