# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1501623522 -19800 # Node ID f3407d56a6e8fa9d4f56ee745b0369490a714f1c # Parent 609606d217659e0a6c1cf6f907b6512be5340e57 bundle2: add the capability to store hookargs on bundle operation object There are extensions like pushrebase, pushvars which run hooks on a server before taking the lock. Since the lock is not taken, transaction is not there, so the hookargs can't be stored on the transaction. Adding hooksargs to bundle operation object will help in running hooks before taking the lock. This is a part of moving fb's extension bundle2hooks to core. Differential Revision: https://phab.mercurial-scm.org/D208 diff -r 609606d21765 -r f3407d56a6e8 mercurial/bundle2.py --- a/mercurial/bundle2.py Thu Jul 20 01:30:41 2017 -0700 +++ b/mercurial/bundle2.py Wed Aug 02 03:08:42 2017 +0530 @@ -299,6 +299,10 @@ self.gettransaction = transactiongetter self.reply = None self.captureoutput = captureoutput + self.hookargs = {} + + def addhookargs(self, hookargs): + self.hookargs.update(hookargs) class TransactionUnavailable(RuntimeError): pass