Mercurial > hg
comparison mercurial/bundle2.py @ 33664:f3407d56a6e8
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 02 Aug 2017 03:08:42 +0530 |
parents | b47fef6d2365 |
children | 5fc4ddfbe626 |
comparison
equal
deleted
inserted
replaced
33619:609606d21765 | 33664:f3407d56a6e8 |
---|---|
297 self.ui = repo.ui | 297 self.ui = repo.ui |
298 self.records = unbundlerecords() | 298 self.records = unbundlerecords() |
299 self.gettransaction = transactiongetter | 299 self.gettransaction = transactiongetter |
300 self.reply = None | 300 self.reply = None |
301 self.captureoutput = captureoutput | 301 self.captureoutput = captureoutput |
302 self.hookargs = {} | |
303 | |
304 def addhookargs(self, hookargs): | |
305 self.hookargs.update(hookargs) | |
302 | 306 |
303 class TransactionUnavailable(RuntimeError): | 307 class TransactionUnavailable(RuntimeError): |
304 pass | 308 pass |
305 | 309 |
306 def _notransaction(): | 310 def _notransaction(): |