transaction: add a notion of hook arguments
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 17:04:59 -0400
changeset 21150 0d05915b688d
parent 21149 c0d96bceadc2
child 21151 240d340fe152
transaction: add a notion of hook arguments It is now possible to register parameters to be used when invoking hooks in this transaction. This will cope with the fact that bundle2 adds multiple data types in a single transaction. Do not expect any wide and consistent usages of this in the next release. This will be used by bundle2 experiments first. It will be made better for the release after.
mercurial/transaction.py
--- a/mercurial/transaction.py	Thu Apr 17 16:54:15 2014 -0400
+++ b/mercurial/transaction.py	Thu Apr 17 17:04:59 2014 -0400
@@ -86,6 +86,8 @@
         self.backupmap = {}
         self.journal = journal
         self._queue = []
+        # a dict of arguments to be passed to hooks
+        self.hookargs = {}
 
         self.backupjournal = "%s.backupfiles" % journal
         self.file = opener.open(self.journal, "w")