bundle2: call a hook prior to closing the transaction
We call a dedicated hook right before closing the transaction. This will let
people abort unbundling with all the information in hand. This hook is
experimental and will not survive in future versions.
--- a/mercurial/exchange.py Thu Apr 17 17:16:21 2014 -0400
+++ b/mercurial/exchange.py Thu Apr 17 17:21:39 2014 -0400
@@ -728,6 +728,10 @@
tr = repo.transaction('unbundle')
tr.hookargs['bundle2-exp'] = '1'
r = bundle2.processbundle(repo, cg, lambda: tr).reply
+ cl = repo.unfiltered().changelog
+ p = cl.writepending() and repo.root or ""
+ repo.hook('b2x-pretransactionclose', throw=True, source=source,
+ url=url, pending=p, **tr.hookargs)
tr.close()
else:
r = changegroup.addchangegroup(repo, cg, source, url)