bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey'
authorBoris Feld <boris.feld@octobus.net>
Mon, 15 Jan 2018 10:44:49 +0000
changeset 35655 2f54a3e228ff
parent 35654 59c842a3d1e1
child 35656 c9eb92fb87b7
bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey' This was a silly copy paste mistake. Spotted by Mitchell Plamann from Jane Street.
mercurial/bundle2.py
tests/test-bundle2-exchange.t
tests/test-hook.t
--- a/mercurial/bundle2.py	Mon Jan 15 19:44:18 2018 +0800
+++ b/mercurial/bundle2.py	Mon Jan 15 10:44:49 2018 +0000
@@ -2022,7 +2022,7 @@
         if pushkeycompat:
             def runhook():
                 for hookargs in allhooks:
-                    op.repo.hook('prepushkey', **hookargs)
+                    op.repo.hook('pushkey', **hookargs)
             op.repo._afterlock(runhook)
 
     elif bookmarksmode == 'records':
--- a/tests/test-bundle2-exchange.t	Mon Jan 15 19:44:18 2018 +0800
+++ b/tests/test-bundle2-exchange.t	Mon Jan 15 10:44:49 2018 +0000
@@ -253,6 +253,9 @@
   remote: added 1 changesets with 0 changes to 0 files (-1 heads)
   remote: 1 new obsolescence markers
   remote: pre-close-tip:eea13746799a public book_eea1
+  remote: pushkey: lock state after "bookmark"
+  remote: lock:  free
+  remote: wlock: free
   remote: postclose-tip:eea13746799a public book_eea1
   remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other
   updating bookmark book_eea1
@@ -336,6 +339,9 @@
   remote: added 1 changesets with 1 changes to 1 files
   remote: 1 new obsolescence markers
   remote: pre-close-tip:5fddd98957c8 draft book_5fdd
+  remote: pushkey: lock state after "bookmark"
+  remote: lock:  free
+  remote: wlock: free
   remote: postclose-tip:5fddd98957c8 draft book_5fdd
   remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP
   updating bookmark book_5fdd
@@ -384,6 +390,9 @@
   remote: added 1 changesets with 1 changes to 1 files
   remote: 1 new obsolescence markers
   remote: pre-close-tip:32af7686d403 public book_32af
+  remote: pushkey: lock state after "bookmark"
+  remote: lock:  free
+  remote: wlock: free
   remote: postclose-tip:32af7686d403 public book_32af
   remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: (glob)
   updating bookmark book_32af
--- a/tests/test-hook.t	Mon Jan 15 19:44:18 2018 +0800
+++ b/tests/test-hook.t	Mon Jan 15 10:44:49 2018 +0000
@@ -244,6 +244,7 @@
   no changes found
   pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
   pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
+  pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmark HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
   txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
   exporting bookmark foo
   [1]