Comments
Patch
@@ -1080,19 +1080,22 @@ class localrepository(object):
tr.hookargs['txnid'] = txnid
# note: writing the fncache only during finalize mean that the file is
# outdated when running hooks. As fncache is used for streaming clone,
# this is not expected to break anything that happen during the hooks.
tr.addfinalize('flush-fncache', self.store.write)
def txnclosehook(tr2):
"""To be run if transaction is successful, will schedule a hook run
"""
+ # Don't reference tr2 in hook() or we'll create a cycle.
+ hookargs = tr2.hookargs
+
def hook():
reporef().hook('txnclose', throw=False, txnname=desc,
- **tr2.hookargs)
+ **hookargs)
reporef()._afterlock(hook)
tr.addfinalize('txnclose-hook', txnclosehook)
def txnaborthook(tr2):
"""To be run if transaction is aborted
"""
reporef().hook('txnabort', throw=False, txnname=desc,
**tr2.hookargs)
tr.addabort('txnabort-hook', txnaborthook)