Mercurial > hg
comparison tests/test-hook.t @ 24740:d283517b260b
transaction: introduce a transaction ID, to be available to all hooks
The transaction ID is built from the object ID and creation time stamp to make
sure it is unique.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 15 Apr 2015 11:11:54 -0400 |
parents | ea0d5c8e047f |
children | 7d0421de8de3 |
comparison
equal
deleted
inserted
replaced
24739:ea0d5c8e047f | 24740:d283517b260b |
---|---|
21 $ hg commit -m a | 21 $ hg commit -m a |
22 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 | 22 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 |
23 pretxnopen hook: HG_TXNNAME=commit | 23 pretxnopen hook: HG_TXNNAME=commit |
24 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a | 24 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a |
25 0:cb9a9f314b8b | 25 0:cb9a9f314b8b |
26 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_XNNAME=commit | 26 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_XNNAME=commit (glob) |
27 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=commit | 27 txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob) |
28 commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 | 28 commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
29 commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 | 29 commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
30 | 30 |
31 $ hg clone . ../b | 31 $ hg clone . ../b |
32 updating to branch default | 32 updating to branch default |
49 $ hg commit -m a1 -d "1 0" | 49 $ hg commit -m a1 -d "1 0" |
50 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 50 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
51 pretxnopen hook: HG_TXNNAME=commit | 51 pretxnopen hook: HG_TXNNAME=commit |
52 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a | 52 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
53 1:ab228980c14d | 53 1:ab228980c14d |
54 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit | 54 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=commit (glob) |
55 txnclose hook: HG_TXNNAME=commit | 55 txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob) |
56 commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 56 commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
57 commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 57 commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
58 $ hg update -C 0 | 58 $ hg update -C 0 |
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
60 $ echo b > b | 60 $ echo b > b |
62 $ hg commit -m b -d '1 0' | 62 $ hg commit -m b -d '1 0' |
63 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 63 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
64 pretxnopen hook: HG_TXNNAME=commit | 64 pretxnopen hook: HG_TXNNAME=commit |
65 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a | 65 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
66 2:ee9deb46ab31 | 66 2:ee9deb46ab31 |
67 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit | 67 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=commit (glob) |
68 txnclose hook: HG_TXNNAME=commit | 68 txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob) |
69 commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 69 commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
70 commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | 70 commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
71 created new head | 71 created new head |
72 $ hg merge 1 | 72 $ hg merge 1 |
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
75 $ hg commit -m merge -d '2 0' | 75 $ hg commit -m merge -d '2 0' |
76 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | 76 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
77 pretxnopen hook: HG_TXNNAME=commit | 77 pretxnopen hook: HG_TXNNAME=commit |
78 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a | 78 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a |
79 3:07f3376c1e65 | 79 3:07f3376c1e65 |
80 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit | 80 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=commit (glob) |
81 txnclose hook: HG_TXNNAME=commit | 81 txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob) |
82 commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | 82 commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
83 commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | 83 commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
84 | 84 |
85 test generic hooks | 85 test generic hooks |
86 | 86 |
95 | 95 |
96 $ cd ../b | 96 $ cd ../b |
97 $ hg pull ../a | 97 $ hg pull ../a |
98 pulling from ../a | 98 pulling from ../a |
99 searching for changes | 99 searching for changes |
100 prechangegroup hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 100 prechangegroup hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
101 adding changesets | 101 adding changesets |
102 adding manifests | 102 adding manifests |
103 adding file changes | 103 adding file changes |
104 added 3 changesets with 2 changes to 2 files | 104 added 3 changesets with 2 changes to 2 files |
105 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 105 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
106 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 106 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
107 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 107 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
108 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 108 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
109 (run 'hg update' to get a working copy) | 109 (run 'hg update' to get a working copy) |
110 | 110 |
111 tag hooks can see env vars | 111 tag hooks can see env vars |
112 | 112 |
113 $ cd ../a | 113 $ cd ../a |
119 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a | 119 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
120 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | 120 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
121 pretxnopen hook: HG_TXNNAME=commit | 121 pretxnopen hook: HG_TXNNAME=commit |
122 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a | 122 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a |
123 4:539e4b31b6dc | 123 4:539e4b31b6dc |
124 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit | 124 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=commit (glob) |
125 tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a | 125 tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
126 txnclose hook: HG_TXNNAME=commit | 126 txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob) |
127 commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | 127 commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
128 commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | 128 commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
129 $ hg tag -l la | 129 $ hg tag -l la |
130 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la | 130 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
131 tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la | 131 tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
216 $ hg push -B foo ../a | 216 $ hg push -B foo ../a |
217 pushing to ../a | 217 pushing to ../a |
218 searching for changes | 218 searching for changes |
219 no changes found | 219 no changes found |
220 pretxnopen hook: HG_TXNNAME=bookmarks | 220 pretxnopen hook: HG_TXNNAME=bookmarks |
221 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_XNNAME=bookmarks | 221 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=bookmarks (glob) |
222 txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNNAME=bookmarks | 222 txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob) |
223 pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 | 223 pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 |
224 exporting bookmark foo | 224 exporting bookmark foo |
225 [1] | 225 [1] |
226 $ cd ../a | 226 $ cd ../a |
227 | 227 |
280 > prechangegroup.forbid = python "$TESTDIR/printenv.py" prechangegroup.forbid 1 | 280 > prechangegroup.forbid = python "$TESTDIR/printenv.py" prechangegroup.forbid 1 |
281 > EOF | 281 > EOF |
282 $ hg pull ../a | 282 $ hg pull ../a |
283 pulling from ../a | 283 pulling from ../a |
284 searching for changes | 284 searching for changes |
285 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 285 prechangegroup.forbid hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
286 abort: prechangegroup.forbid hook exited with status 1 | 286 abort: prechangegroup.forbid hook exited with status 1 |
287 [255] | 287 [255] |
288 | 288 |
289 pretxnchangegroup hook can see incoming changes, can roll back txn, | 289 pretxnchangegroup hook can see incoming changes, can roll back txn, |
290 incoming changes no longer there after | 290 incoming changes no longer there after |
300 adding changesets | 300 adding changesets |
301 adding manifests | 301 adding manifests |
302 adding file changes | 302 adding file changes |
303 added 1 changesets with 1 changes to 1 files | 303 added 1 changesets with 1 changes to 1 files |
304 4:539e4b31b6dc | 304 4:539e4b31b6dc |
305 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a | 305 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) |
306 transaction abort! | 306 transaction abort! |
307 rollback completed | 307 rollback completed |
308 abort: pretxnchangegroup.forbid1 hook exited with status 1 | 308 abort: pretxnchangegroup.forbid1 hook exited with status 1 |
309 [255] | 309 [255] |
310 $ hg -q tip | 310 $ hg -q tip |