--- a/mercurial/localrepo.py Sun Oct 08 17:50:46 2017 +0200
+++ b/mercurial/localrepo.py Sun Oct 08 17:23:18 2017 +0200
@@ -1243,6 +1243,14 @@
repo.hook('pretxnclose-bookmark', throw=True,
txnname=desc,
**pycompat.strkwargs(args))
+ if hook.hashook(repo.ui, 'pretxnclose-phase'):
+ cl = repo.unfiltered().changelog
+ for rev, (old, new) in tr.changes['phases'].items():
+ args = tr.hookargs.copy()
+ node = hex(cl.node(rev))
+ args.update(phases.preparehookargs(node, old, new))
+ repo.hook('pretxnclose-phase', throw=True, txnname=desc,
+ **pycompat.strkwargs(args))
repo.hook('pretxnclose', throw=True,
txnname=desc, **pycompat.strkwargs(tr.hookargs))