##// END OF EJS Templates
test-bundle2-exchange: create temp script in $TESTTMP, not $TESTDIR...
Martin von Zweigbergk -
r23759:cdfc4726 default
parent child Browse files
Show More
@@ -1,543 +1,543 b''
1 1 Test exchange of common information using bundle2
2 2
3 3
4 4 $ getmainid() {
5 5 > hg -R main log --template '{node}\n' --rev "$1"
6 6 > }
7 7
8 8 enable obsolescence
9 9
10 $ cat > $TESTDIR/bundle2-pushkey-hook.sh << EOF
10 $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF
11 11 > echo pushkey: lock state after \"\$HG_NAMESPACE\"
12 12 > hg debuglock
13 13 > EOF
14 14
15 15 $ cat >> $HGRCPATH << EOF
16 16 > [experimental]
17 17 > evolution=createmarkers,exchange
18 18 > bundle2-exp=True
19 19 > [ui]
20 20 > ssh=python "$TESTDIR/dummyssh"
21 21 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
22 22 > [web]
23 23 > push_ssl = false
24 24 > allow_push = *
25 25 > [phases]
26 26 > publish=False
27 27 > [hooks]
28 28 > changegroup = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" changegroup"
29 29 > b2x-pretransactionclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
30 30 > b2x-transactionclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
31 31 > b2x-transactionclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
32 > pushkey= sh "$TESTDIR/bundle2-pushkey-hook.sh"
32 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
33 33 > EOF
34 34
35 35 The extension requires a repo (currently unused)
36 36
37 37 $ hg init main
38 38 $ cd main
39 39 $ touch a
40 40 $ hg add a
41 41 $ hg commit -m 'a'
42 42
43 43 $ hg unbundle $TESTDIR/bundles/rebase.hg
44 44 adding changesets
45 45 adding manifests
46 46 adding file changes
47 47 added 8 changesets with 7 changes to 7 files (+3 heads)
48 48 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=unbundle HG_URL=bundle:*/rebase.hg (glob)
49 49 (run 'hg heads' to see heads, 'hg merge' to merge)
50 50
51 51 $ cd ..
52 52
53 53 Real world exchange
54 54 =====================
55 55
56 56 Add more obsolescence information
57 57
58 58 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
59 59 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
60 60
61 61 clone --pull
62 62
63 63 $ hg -R main phase --public cd010b8cd998
64 64 $ hg clone main other --pull --rev 9520eea781bc
65 65 adding changesets
66 66 adding manifests
67 67 adding file changes
68 68 added 2 changesets with 2 changes to 2 files
69 69 1 new obsolescence markers
70 70 pre-close-tip:9520eea781bc draft
71 71 postclose-tip:9520eea781bc draft
72 72 b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
73 73 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
74 74 updating to branch default
75 75 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76 $ hg -R other log -G
77 77 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
78 78 |
79 79 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
80 80
81 81 $ hg -R other debugobsolete
82 82 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
83 83
84 84 pull
85 85
86 86 $ hg -R main phase --public 9520eea781bc
87 87 $ hg -R other pull -r 24b6387c8c8c
88 88 pulling from $TESTTMP/main (glob)
89 89 searching for changes
90 90 adding changesets
91 91 adding manifests
92 92 adding file changes
93 93 added 1 changesets with 1 changes to 1 files (+1 heads)
94 94 1 new obsolescence markers
95 95 pre-close-tip:24b6387c8c8c draft
96 96 postclose-tip:24b6387c8c8c draft
97 97 b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
98 98 changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
99 99 (run 'hg heads' to see heads, 'hg merge' to merge)
100 100 $ hg -R other log -G
101 101 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
102 102 |
103 103 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
104 104 |/
105 105 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
106 106
107 107 $ hg -R other debugobsolete
108 108 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
109 109 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
110 110
111 111 pull empty (with phase movement)
112 112
113 113 $ hg -R main phase --public 24b6387c8c8c
114 114 $ hg -R other pull -r 24b6387c8c8c
115 115 pulling from $TESTTMP/main (glob)
116 116 no changes found
117 117 pre-close-tip:000000000000 public
118 118 postclose-tip:24b6387c8c8c public
119 119 b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
120 120 $ hg -R other log -G
121 121 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
122 122 |
123 123 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
124 124 |/
125 125 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
126 126
127 127 $ hg -R other debugobsolete
128 128 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
129 129 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
130 130
131 131 pull empty
132 132
133 133 $ hg -R other pull -r 24b6387c8c8c
134 134 pulling from $TESTTMP/main (glob)
135 135 no changes found
136 136 pre-close-tip:24b6387c8c8c public
137 137 postclose-tip:24b6387c8c8c public
138 138 b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
139 139 $ hg -R other log -G
140 140 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
141 141 |
142 142 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
143 143 |/
144 144 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
145 145
146 146 $ hg -R other debugobsolete
147 147 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
148 148 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
149 149
150 150 add extra data to test their exchange during push
151 151
152 152 $ hg -R main bookmark --rev eea13746799a book_eea1
153 153 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
154 154 $ hg -R main bookmark --rev 02de42196ebe book_02de
155 155 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
156 156 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
157 157 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
158 158 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
159 159 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
160 160 $ hg -R main bookmark --rev 32af7686d403 book_32af
161 161 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
162 162
163 163 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
164 164 $ hg -R other bookmark --rev cd010b8cd998 book_02de
165 165 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
166 166 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
167 167 $ hg -R other bookmark --rev cd010b8cd998 book_32af
168 168
169 169 $ hg -R main phase --public eea13746799a
170 170
171 171 push
172 172 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
173 173 pushing to other
174 174 searching for changes
175 175 pre-close-tip:eea13746799a public book_eea1
176 176 pushkey: lock state after "phases"
177 177 lock: free
178 178 wlock: free
179 179 pushkey: lock state after "bookmarks"
180 180 lock: free
181 181 wlock: free
182 182 postclose-tip:eea13746799a public book_eea1
183 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 184 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=push HG_URL=push
185 185 remote: adding changesets
186 186 remote: adding manifests
187 187 remote: adding file changes
188 188 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
189 189 remote: 1 new obsolescence markers
190 190 updating bookmark book_eea1
191 191 pre-close-tip:02de42196ebe draft book_02de
192 192 postclose-tip:02de42196ebe draft book_02de
193 193 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=file:$TESTTMP/other
194 194 $ hg -R other log -G
195 195 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
196 196 |\
197 197 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
198 198 | |
199 199 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
200 200 |/
201 201 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
202 202
203 203 $ hg -R other debugobsolete
204 204 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
205 205 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
206 206 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
207 207
208 208 pull over ssh
209 209
210 210 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
211 211 pulling from ssh://user@dummy/main
212 212 searching for changes
213 213 adding changesets
214 214 adding manifests
215 215 adding file changes
216 216 added 1 changesets with 1 changes to 1 files (+1 heads)
217 217 1 new obsolescence markers
218 218 updating bookmark book_02de
219 219 pre-close-tip:02de42196ebe draft book_02de
220 220 postclose-tip:02de42196ebe draft book_02de
221 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 222 changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
223 223 (run 'hg heads' to see heads, 'hg merge' to merge)
224 224 $ hg -R other debugobsolete
225 225 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
226 226 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
227 227 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
228 228 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
229 229
230 230 pull over http
231 231
232 232 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
233 233 $ cat main.pid >> $DAEMON_PIDS
234 234
235 235 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
236 236 pulling from http://localhost:$HGPORT/
237 237 searching for changes
238 238 adding changesets
239 239 adding manifests
240 240 adding file changes
241 241 added 1 changesets with 1 changes to 1 files (+1 heads)
242 242 1 new obsolescence markers
243 243 updating bookmark book_42cc
244 244 pre-close-tip:42ccdea3bb16 draft book_42cc
245 245 postclose-tip:42ccdea3bb16 draft book_42cc
246 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 247 changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
248 248 (run 'hg heads .' to see heads, 'hg merge' to merge)
249 249 $ cat main-error.log
250 250 $ hg -R other debugobsolete
251 251 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
252 252 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
253 253 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
254 254 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
255 255 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
256 256
257 257 push over ssh
258 258
259 259 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
260 260 pushing to ssh://user@dummy/other
261 261 searching for changes
262 262 remote: adding changesets
263 263 remote: adding manifests
264 264 remote: adding file changes
265 265 remote: added 1 changesets with 1 changes to 1 files
266 266 remote: 1 new obsolescence markers
267 267 updating bookmark book_5fdd
268 268 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
269 269 remote: pushkey: lock state after "bookmarks"
270 270 remote: lock: free
271 271 remote: wlock: free
272 272 remote: postclose-tip:5fddd98957c8 draft book_5fdd
273 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 274 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
275 275 pre-close-tip:02de42196ebe draft book_02de
276 276 postclose-tip:02de42196ebe draft book_02de
277 277 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=ssh://user@dummy/other
278 278 $ hg -R other log -G
279 279 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
280 280 |
281 281 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
282 282 |
283 283 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
284 284 | |
285 285 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
286 286 | |/|
287 287 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
288 288 |/ /
289 289 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
290 290 |/
291 291 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
292 292
293 293 $ hg -R other debugobsolete
294 294 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
295 295 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
296 296 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
297 297 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
298 298 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
299 299 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
300 300
301 301 push over http
302 302
303 303 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
304 304 $ cat other.pid >> $DAEMON_PIDS
305 305
306 306 $ hg -R main phase --public 32af7686d403
307 307 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
308 308 pushing to http://localhost:$HGPORT2/
309 309 searching for changes
310 310 remote: adding changesets
311 311 remote: adding manifests
312 312 remote: adding file changes
313 313 remote: added 1 changesets with 1 changes to 1 files
314 314 remote: 1 new obsolescence markers
315 315 updating bookmark book_32af
316 316 pre-close-tip:02de42196ebe draft book_02de
317 317 postclose-tip:02de42196ebe draft book_02de
318 318 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=http://localhost:$HGPORT2/
319 319 $ cat other-error.log
320 320
321 321 Check final content.
322 322
323 323 $ hg -R other log -G
324 324 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
325 325 |
326 326 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
327 327 |
328 328 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
329 329 |
330 330 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
331 331 | |
332 332 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
333 333 | |/|
334 334 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
335 335 |/ /
336 336 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
337 337 |/
338 338 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
339 339
340 340 $ hg -R other debugobsolete
341 341 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
342 342 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
343 343 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
344 344 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
345 345 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
346 346 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
347 347 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
348 348
349 349 (check that no 'pending' files remain)
350 350
351 351 $ ls -1 other/.hg/bookmarks*
352 352 other/.hg/bookmarks
353 353 $ ls -1 other/.hg/store/phaseroots*
354 354 other/.hg/store/phaseroots
355 355 $ ls -1 other/.hg/store/00changelog.i*
356 356 other/.hg/store/00changelog.i
357 357
358 358 Error Handling
359 359 ==============
360 360
361 361 Check that errors are properly returned to the client during push.
362 362
363 363 Setting up
364 364
365 365 $ cat > failpush.py << EOF
366 366 > """A small extension that makes push fails when using bundle2
367 367 >
368 368 > used to test error handling in bundle2
369 369 > """
370 370 >
371 371 > from mercurial import util
372 372 > from mercurial import bundle2
373 373 > from mercurial import exchange
374 374 > from mercurial import extensions
375 375 >
376 376 > def _pushbundle2failpart(pushop, bundler):
377 377 > reason = pushop.ui.config('failpush', 'reason', None)
378 378 > part = None
379 379 > if reason == 'abort':
380 380 > bundler.newpart('test:abort')
381 381 > if reason == 'unknown':
382 382 > bundler.newpart('test:unknown')
383 383 > if reason == 'race':
384 384 > # 20 Bytes of crap
385 385 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
386 386 >
387 387 > @bundle2.parthandler("test:abort")
388 388 > def handleabort(op, part):
389 389 > raise util.Abort('Abandon ship!', hint="don't panic")
390 390 >
391 391 > def uisetup(ui):
392 392 > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart
393 393 > exchange.b2partsgenorder.insert(0, 'failpart')
394 394 >
395 395 > EOF
396 396
397 397 $ cd main
398 398 $ hg up tip
399 399 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
400 400 $ echo 'I' > I
401 401 $ hg add I
402 402 $ hg ci -m 'I'
403 403 $ hg id
404 404 e7ec4e813ba6 tip
405 405 $ cd ..
406 406
407 407 $ cat << EOF >> $HGRCPATH
408 408 > [extensions]
409 409 > failpush=$TESTTMP/failpush.py
410 410 > EOF
411 411
412 412 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
413 413 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
414 414 $ cat other.pid >> $DAEMON_PIDS
415 415
416 416 Doing the actual push: Abort error
417 417
418 418 $ cat << EOF >> $HGRCPATH
419 419 > [failpush]
420 420 > reason = abort
421 421 > EOF
422 422
423 423 $ hg -R main push other -r e7ec4e813ba6
424 424 pushing to other
425 425 searching for changes
426 426 abort: Abandon ship!
427 427 (don't panic)
428 428 [255]
429 429
430 430 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
431 431 pushing to ssh://user@dummy/other
432 432 searching for changes
433 433 abort: Abandon ship!
434 434 (don't panic)
435 435 [255]
436 436
437 437 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
438 438 pushing to http://localhost:$HGPORT2/
439 439 searching for changes
440 440 abort: Abandon ship!
441 441 (don't panic)
442 442 [255]
443 443
444 444
445 445 Doing the actual push: unknown mandatory parts
446 446
447 447 $ cat << EOF >> $HGRCPATH
448 448 > [failpush]
449 449 > reason = unknown
450 450 > EOF
451 451
452 452 $ hg -R main push other -r e7ec4e813ba6
453 453 pushing to other
454 454 searching for changes
455 455 abort: missing support for test:unknown
456 456 [255]
457 457
458 458 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
459 459 pushing to ssh://user@dummy/other
460 460 searching for changes
461 461 abort: missing support for test:unknown
462 462 [255]
463 463
464 464 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
465 465 pushing to http://localhost:$HGPORT2/
466 466 searching for changes
467 467 abort: missing support for test:unknown
468 468 [255]
469 469
470 470 Doing the actual push: race
471 471
472 472 $ cat << EOF >> $HGRCPATH
473 473 > [failpush]
474 474 > reason = race
475 475 > EOF
476 476
477 477 $ hg -R main push other -r e7ec4e813ba6
478 478 pushing to other
479 479 searching for changes
480 480 abort: push failed:
481 481 'repository changed while pushing - please try again'
482 482 [255]
483 483
484 484 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
485 485 pushing to ssh://user@dummy/other
486 486 searching for changes
487 487 abort: push failed:
488 488 'repository changed while pushing - please try again'
489 489 [255]
490 490
491 491 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
492 492 pushing to http://localhost:$HGPORT2/
493 493 searching for changes
494 494 abort: push failed:
495 495 'repository changed while pushing - please try again'
496 496 [255]
497 497
498 498 Doing the actual push: hook abort
499 499
500 500 $ cat << EOF >> $HGRCPATH
501 501 > [failpush]
502 502 > reason =
503 503 > [hooks]
504 504 > b2x-pretransactionclose.failpush = false
505 505 > EOF
506 506
507 507 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
508 508 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
509 509 $ cat other.pid >> $DAEMON_PIDS
510 510
511 511 $ hg -R main push other -r e7ec4e813ba6
512 512 pushing to other
513 513 searching for changes
514 514 pre-close-tip:e7ec4e813ba6 draft
515 515 transaction abort!
516 516 rollback completed
517 517 abort: b2x-pretransactionclose.failpush hook exited with status 1
518 518 [255]
519 519
520 520 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
521 521 pushing to ssh://user@dummy/other
522 522 searching for changes
523 523 abort: b2x-pretransactionclose.failpush hook exited with status 1
524 524 remote: pre-close-tip:e7ec4e813ba6 draft
525 525 remote: transaction abort!
526 526 remote: rollback completed
527 527 [255]
528 528
529 529 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
530 530 pushing to http://localhost:$HGPORT2/
531 531 searching for changes
532 532 abort: b2x-pretransactionclose.failpush hook exited with status 1
533 533 [255]
534 534
535 535 (check that no 'pending' files remain)
536 536
537 537 $ ls -1 other/.hg/bookmarks*
538 538 other/.hg/bookmarks
539 539 $ ls -1 other/.hg/store/phaseroots*
540 540 other/.hg/store/phaseroots
541 541 $ ls -1 other/.hg/store/00changelog.i*
542 542 other/.hg/store/00changelog.i
543 543
General Comments 0
You need to be logged in to leave comments. Login now