D208: bundle2: add the capability to store hookargs on bundle operation object
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Wed Aug 2 00:07:51 UTC 2017
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D208
AFFECTED FILES
mercurial/bundle2.py
CHANGE DETAILS
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -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
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list