##// END OF EJS Templates
bundle2: test hooking using the new transaction-level hook...
Pierre-Yves David -
r24285:8e13cc08 default
parent child Browse files
Show More
@@ -25,10 +25,9 b' enable obsolescence'
25 25 > [phases]
26 26 > publish=False
27 27 > [hooks]
28 > changegroup = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" changegroup"
29 > b2x-pretransactionclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
30 > b2x-transactionclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
31 > b2x-transactionclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
28 > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
29 > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
30 > txnclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" txnclose"
32 31 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
33 32 > EOF
34 33
@@ -39,13 +38,19 b' The extension requires a repo (currently'
39 38 $ touch a
40 39 $ hg add a
41 40 $ hg commit -m 'a'
41 pre-close-tip:3903775176ed draft
42 postclose-tip:3903775176ed draft
43 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=commit
42 44
43 45 $ hg unbundle $TESTDIR/bundles/rebase.hg
44 46 adding changesets
45 47 adding manifests
46 48 adding file changes
47 49 added 8 changesets with 7 changes to 7 files (+3 heads)
48 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=unbundle HG_URL=bundle:*/rebase.hg (glob)
50 pre-close-tip:02de42196ebe draft
51 postclose-tip:02de42196ebe draft
52 txnclose hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNNAME=unbundle
53 bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
49 54 (run 'hg heads' to see heads, 'hg merge' to merge)
50 55
51 56 $ cd ..
@@ -56,11 +61,20 b' Real world exchange'
56 61 Add more obsolescence information
57 62
58 63 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
64 pre-close-tip:02de42196ebe draft
65 postclose-tip:02de42196ebe draft
66 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
59 67 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
68 pre-close-tip:02de42196ebe draft
69 postclose-tip:02de42196ebe draft
70 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
60 71
61 72 clone --pull
62 73
63 74 $ hg -R main phase --public cd010b8cd998
75 pre-close-tip:000000000000 public
76 postclose-tip:02de42196ebe draft
77 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
64 78 $ hg clone main other --pull --rev 9520eea781bc
65 79 adding changesets
66 80 adding manifests
@@ -69,8 +83,8 b' clone --pull'
69 83 1 new obsolescence markers
70 84 pre-close-tip:9520eea781bc draft
71 85 postclose-tip:9520eea781bc draft
72 b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
73 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
86 txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
87 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
74 88 updating to branch default
75 89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 90 $ hg -R other log -G
@@ -84,6 +98,9 b' clone --pull'
84 98 pull
85 99
86 100 $ hg -R main phase --public 9520eea781bc
101 pre-close-tip:000000000000 public
102 postclose-tip:02de42196ebe draft
103 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
87 104 $ hg -R other pull -r 24b6387c8c8c
88 105 pulling from $TESTTMP/main (glob)
89 106 searching for changes
@@ -94,8 +111,8 b' pull'
94 111 1 new obsolescence markers
95 112 pre-close-tip:24b6387c8c8c draft
96 113 postclose-tip:24b6387c8c8c draft
97 b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
98 changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
114 txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
115 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
99 116 (run 'hg heads' to see heads, 'hg merge' to merge)
100 117 $ hg -R other log -G
101 118 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
@@ -111,12 +128,16 b' pull'
111 128 pull empty (with phase movement)
112 129
113 130 $ hg -R main phase --public 24b6387c8c8c
131 pre-close-tip:000000000000 public
132 postclose-tip:02de42196ebe draft
133 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
114 134 $ hg -R other pull -r 24b6387c8c8c
115 135 pulling from $TESTTMP/main (glob)
116 136 no changes found
117 137 pre-close-tip:000000000000 public
118 138 postclose-tip:24b6387c8c8c public
119 b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
139 txnclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
140 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
120 141 $ hg -R other log -G
121 142 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
122 143 |
@@ -135,7 +156,8 b' pull empty'
135 156 no changes found
136 157 pre-close-tip:24b6387c8c8c public
137 158 postclose-tip:24b6387c8c8c public
138 b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
159 txnclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNNAME=pull
160 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
139 161 $ hg -R other log -G
140 162 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
141 163 |
@@ -151,14 +173,29 b' add extra data to test their exchange du'
151 173
152 174 $ hg -R main bookmark --rev eea13746799a book_eea1
153 175 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
176 pre-close-tip:02de42196ebe draft
177 postclose-tip:02de42196ebe draft
178 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
154 179 $ hg -R main bookmark --rev 02de42196ebe book_02de
155 180 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
181 pre-close-tip:02de42196ebe draft book_02de
182 postclose-tip:02de42196ebe draft book_02de
183 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
156 184 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
157 185 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
186 pre-close-tip:02de42196ebe draft book_02de
187 postclose-tip:02de42196ebe draft book_02de
188 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
158 189 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
159 190 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
191 pre-close-tip:02de42196ebe draft book_02de
192 postclose-tip:02de42196ebe draft book_02de
193 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
160 194 $ hg -R main bookmark --rev 32af7686d403 book_32af
161 195 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
196 pre-close-tip:02de42196ebe draft book_02de
197 postclose-tip:02de42196ebe draft book_02de
198 txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
162 199
163 200 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
164 201 $ hg -R other bookmark --rev cd010b8cd998 book_02de
@@ -167,6 +204,9 b' add extra data to test their exchange du'
167 204 $ hg -R other bookmark --rev cd010b8cd998 book_32af
168 205
169 206 $ hg -R main phase --public eea13746799a
207 pre-close-tip:000000000000 public
208 postclose-tip:02de42196ebe draft book_02de
209 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
170 210
171 211 push
172 212 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
@@ -180,8 +220,7 b' push'
180 220 lock: free
181 221 wlock: free
182 222 postclose-tip:eea13746799a public book_eea1
183 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push
184 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=push HG_URL=push
223 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNNAME=unbundle HG_URL=push
185 224 remote: adding changesets
186 225 remote: adding manifests
187 226 remote: adding file changes
@@ -190,7 +229,8 b' push'
190 229 updating bookmark book_eea1
191 230 pre-close-tip:02de42196ebe draft book_02de
192 231 postclose-tip:02de42196ebe draft book_02de
193 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=file:$TESTTMP/other
232 txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
233 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
194 234 $ hg -R other log -G
195 235 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
196 236 |\
@@ -218,8 +258,8 b' pull over ssh'
218 258 updating bookmark book_02de
219 259 pre-close-tip:02de42196ebe draft book_02de
220 260 postclose-tip:02de42196ebe draft book_02de
221 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
222 changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
261 txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
262 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
223 263 (run 'hg heads' to see heads, 'hg merge' to merge)
224 264 $ hg -R other debugobsolete
225 265 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
@@ -243,8 +283,8 b' pull over http'
243 283 updating bookmark book_42cc
244 284 pre-close-tip:42ccdea3bb16 draft book_42cc
245 285 postclose-tip:42ccdea3bb16 draft book_42cc
246 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
247 changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
286 txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
287 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
248 288 (run 'hg heads .' to see heads, 'hg merge' to merge)
249 289 $ cat main-error.log
250 290 $ hg -R other debugobsolete
@@ -270,11 +310,11 b' push over ssh'
270 310 remote: lock: free
271 311 remote: wlock: free
272 312 remote: postclose-tip:5fddd98957c8 draft book_5fdd
273 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
274 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
313 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNNAME=unbundle HG_URL=remote:ssh:127.0.0.1
275 314 pre-close-tip:02de42196ebe draft book_02de
276 315 postclose-tip:02de42196ebe draft book_02de
277 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=ssh://user@dummy/other
316 txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
317 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
278 318 $ hg -R other log -G
279 319 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
280 320 |
@@ -304,6 +344,9 b' push over http'
304 344 $ cat other.pid >> $DAEMON_PIDS
305 345
306 346 $ hg -R main phase --public 32af7686d403
347 pre-close-tip:000000000000 public
348 postclose-tip:02de42196ebe draft book_02de
349 txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
307 350 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
308 351 pushing to http://localhost:$HGPORT2/
309 352 searching for changes
@@ -315,7 +358,8 b' push over http'
315 358 updating bookmark book_32af
316 359 pre-close-tip:02de42196ebe draft book_02de
317 360 postclose-tip:02de42196ebe draft book_02de
318 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=http://localhost:$HGPORT2/
361 txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
362 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
319 363 $ cat other-error.log
320 364
321 365 Check final content.
@@ -400,6 +444,9 b' Setting up'
400 444 $ echo 'I' > I
401 445 $ hg add I
402 446 $ hg ci -m 'I'
447 pre-close-tip:e7ec4e813ba6 draft
448 postclose-tip:e7ec4e813ba6 draft
449 txnclose hook: HG_TXNNAME=commit
403 450 $ hg id
404 451 e7ec4e813ba6 tip
405 452 $ cd ..
@@ -501,7 +548,7 b' Doing the actual push: hook abort'
501 548 > [failpush]
502 549 > reason =
503 550 > [hooks]
504 > b2x-pretransactionclose.failpush = false
551 > pretxnclose.failpush = false
505 552 > EOF
506 553
507 554 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -514,13 +561,13 b' Doing the actual push: hook abort'
514 561 pre-close-tip:e7ec4e813ba6 draft
515 562 transaction abort!
516 563 rollback completed
517 abort: b2x-pretransactionclose.failpush hook exited with status 1
564 abort: pretxnclose.failpush hook exited with status 1
518 565 [255]
519 566
520 567 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
521 568 pushing to ssh://user@dummy/other
522 569 searching for changes
523 abort: b2x-pretransactionclose.failpush hook exited with status 1
570 abort: pretxnclose.failpush hook exited with status 1
524 571 remote: pre-close-tip:e7ec4e813ba6 draft
525 572 remote: transaction abort!
526 573 remote: rollback completed
@@ -529,7 +576,7 b' Doing the actual push: hook abort'
529 576 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
530 577 pushing to http://localhost:$HGPORT2/
531 578 searching for changes
532 abort: b2x-pretransactionclose.failpush hook exited with status 1
579 abort: pretxnclose.failpush hook exited with status 1
533 580 [255]
534 581
535 582 (check that no 'pending' files remain)
General Comments 0
You need to be logged in to leave comments. Login now