# HG changeset patch # User Pierre-Yves David # Date 1429031261 14400 # Node ID ea0d5c8e047f97565a9e32a677996620c4e56e90 # Parent 457e26da029b5ca35f792827ac53063655346959 transaction: actually use tr.hookargs in pretxnclose The 'tr.hookargs' is a dictionary containing all the arguments to be passed to hooks. It is actually used for hooks now... diff -r 457e26da029b -r ea0d5c8e047f mercurial/localrepo.py --- a/mercurial/localrepo.py Sat Apr 11 13:58:36 2015 -0400 +++ b/mercurial/localrepo.py Tue Apr 14 13:07:41 2015 -0400 @@ -956,7 +956,7 @@ """will run pre-closing hooks""" pending = lambda: tr.writepending() and self.root or "" reporef().hook('pretxnclose', throw=True, pending=pending, - xnname=desc) + xnname=desc, **tr.hookargs) tr = transaction.transaction(rp, self.sopener, vfsmap, "journal", diff -r 457e26da029b -r ea0d5c8e047f tests/test-hook.t --- a/tests/test-hook.t Sat Apr 11 13:58:36 2015 -0400 +++ b/tests/test-hook.t Tue Apr 14 13:07:41 2015 -0400 @@ -23,7 +23,7 @@ pretxnopen hook: HG_TXNNAME=commit pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a 0:cb9a9f314b8b - pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit + pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_XNNAME=commit txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=commit commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 @@ -218,7 +218,7 @@ searching for changes no changes found pretxnopen hook: HG_TXNNAME=bookmarks - pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=bookmarks + pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_XNNAME=bookmarks txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNNAME=bookmarks pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 exporting bookmark foo