##// END OF EJS Templates
test: pull through http when testing for race conditions...
Pierre-Yves David -
r25442:9ee395df default
parent child Browse files
Show More
@@ -1,754 +1,770 b''
1 1 #require serve
2 2
3 3 $ cat << EOF >> $HGRCPATH
4 4 > [ui]
5 5 > logtemplate={rev}:{node|short} {desc|firstline}
6 6 > [phases]
7 7 > publish=False
8 8 > [experimental]
9 9 > evolution=createmarkers,exchange
10 10 > # drop me once bundle2 is the default,
11 11 > # added to get test change early.
12 12 > bundle2-exp = True
13 13 > EOF
14 14
15 15 initialize
16 16
17 17 $ hg init a
18 18 $ cd a
19 19 $ echo 'test' > test
20 20 $ hg commit -Am'test'
21 21 adding test
22 22
23 23 set bookmarks
24 24
25 25 $ hg bookmark X
26 26 $ hg bookmark Y
27 27 $ hg bookmark Z
28 28
29 29 import bookmark by name
30 30
31 31 $ hg init ../b
32 32 $ cd ../b
33 33 $ hg book Y
34 34 $ hg book
35 35 * Y -1:000000000000
36 36 $ hg pull ../a
37 37 pulling from ../a
38 38 requesting all changes
39 39 adding changesets
40 40 adding manifests
41 41 adding file changes
42 42 added 1 changesets with 1 changes to 1 files
43 43 adding remote bookmark X
44 44 updating bookmark Y
45 45 adding remote bookmark Z
46 46 (run 'hg update' to get a working copy)
47 47 $ hg bookmarks
48 48 X 0:4e3505fd9583
49 49 * Y 0:4e3505fd9583
50 50 Z 0:4e3505fd9583
51 51 $ hg debugpushkey ../a namespaces
52 52 bookmarks
53 53 namespaces
54 54 obsolete
55 55 phases
56 56 $ hg debugpushkey ../a bookmarks
57 57 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
58 58 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
59 59 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
60 60
61 61 delete the bookmark to re-pull it
62 62
63 63 $ hg book -d X
64 64 $ hg pull -B X ../a
65 65 pulling from ../a
66 66 no changes found
67 67 adding remote bookmark X
68 68
69 69 finally no-op pull
70 70
71 71 $ hg pull -B X ../a
72 72 pulling from ../a
73 73 no changes found
74 74 $ hg bookmark
75 75 X 0:4e3505fd9583
76 76 * Y 0:4e3505fd9583
77 77 Z 0:4e3505fd9583
78 78
79 79 export bookmark by name
80 80
81 81 $ hg bookmark W
82 82 $ hg bookmark foo
83 83 $ hg bookmark foobar
84 84 $ hg push -B W ../a
85 85 pushing to ../a
86 86 searching for changes
87 87 no changes found
88 88 exporting bookmark W
89 89 [1]
90 90 $ hg -R ../a bookmarks
91 91 W -1:000000000000
92 92 X 0:4e3505fd9583
93 93 Y 0:4e3505fd9583
94 94 * Z 0:4e3505fd9583
95 95
96 96 delete a remote bookmark
97 97
98 98 $ hg book -d W
99 99 $ hg push -B W ../a
100 100 pushing to ../a
101 101 searching for changes
102 102 no changes found
103 103 deleting remote bookmark W
104 104 [1]
105 105
106 106 push/pull name that doesn't exist
107 107
108 108 $ hg push -B badname ../a
109 109 pushing to ../a
110 110 searching for changes
111 111 bookmark badname does not exist on the local or remote repository!
112 112 no changes found
113 113 [2]
114 114 $ hg pull -B anotherbadname ../a
115 115 pulling from ../a
116 116 abort: remote bookmark anotherbadname not found!
117 117 [255]
118 118
119 119 divergent bookmarks
120 120
121 121 $ cd ../a
122 122 $ echo c1 > f1
123 123 $ hg ci -Am1
124 124 adding f1
125 125 $ hg book -f @
126 126 $ hg book -f X
127 127 $ hg book
128 128 @ 1:0d2164f0ce0d
129 129 * X 1:0d2164f0ce0d
130 130 Y 0:4e3505fd9583
131 131 Z 1:0d2164f0ce0d
132 132
133 133 $ cd ../b
134 134 $ hg up
135 135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 136 updating bookmark foobar
137 137 $ echo c2 > f2
138 138 $ hg ci -Am2
139 139 adding f2
140 140 $ hg book -if @
141 141 $ hg book -if X
142 142 $ hg book
143 143 @ 1:9b140be10808
144 144 X 1:9b140be10808
145 145 Y 0:4e3505fd9583
146 146 Z 0:4e3505fd9583
147 147 foo -1:000000000000
148 148 * foobar 1:9b140be10808
149 149
150 150 $ hg pull --config paths.foo=../a foo
151 151 pulling from $TESTTMP/a (glob)
152 152 searching for changes
153 153 adding changesets
154 154 adding manifests
155 155 adding file changes
156 156 added 1 changesets with 1 changes to 1 files (+1 heads)
157 157 divergent bookmark @ stored as @foo
158 158 divergent bookmark X stored as X@foo
159 159 updating bookmark Z
160 160 (run 'hg heads' to see heads, 'hg merge' to merge)
161 161 $ hg book
162 162 @ 1:9b140be10808
163 163 @foo 2:0d2164f0ce0d
164 164 X 1:9b140be10808
165 165 X@foo 2:0d2164f0ce0d
166 166 Y 0:4e3505fd9583
167 167 Z 2:0d2164f0ce0d
168 168 foo -1:000000000000
169 169 * foobar 1:9b140be10808
170 170
171 171 (test that too many divergence of bookmark)
172 172
173 173 $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
174 174 $ hg pull ../a
175 175 pulling from ../a
176 176 searching for changes
177 177 no changes found
178 178 warning: failed to assign numbered name to divergent bookmark X
179 179 divergent bookmark @ stored as @1
180 180 $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
181 181 X 1:9b140be10808
182 182 X@foo 2:0d2164f0ce0d
183 183
184 184 (test that remotely diverged bookmarks are reused if they aren't changed)
185 185
186 186 $ hg bookmarks | grep '^ @'
187 187 @ 1:9b140be10808
188 188 @1 2:0d2164f0ce0d
189 189 @foo 2:0d2164f0ce0d
190 190 $ hg pull ../a
191 191 pulling from ../a
192 192 searching for changes
193 193 no changes found
194 194 warning: failed to assign numbered name to divergent bookmark X
195 195 divergent bookmark @ stored as @1
196 196 $ hg bookmarks | grep '^ @'
197 197 @ 1:9b140be10808
198 198 @1 2:0d2164f0ce0d
199 199 @foo 2:0d2164f0ce0d
200 200
201 201 $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
202 202 $ hg bookmarks -d "@1"
203 203
204 204 $ hg push -f ../a
205 205 pushing to ../a
206 206 searching for changes
207 207 adding changesets
208 208 adding manifests
209 209 adding file changes
210 210 added 1 changesets with 1 changes to 1 files (+1 heads)
211 211 $ hg -R ../a book
212 212 @ 1:0d2164f0ce0d
213 213 * X 1:0d2164f0ce0d
214 214 Y 0:4e3505fd9583
215 215 Z 1:0d2164f0ce0d
216 216
217 217 explicit pull should overwrite the local version (issue4439)
218 218
219 219 $ hg pull --config paths.foo=../a foo -B X
220 220 pulling from $TESTTMP/a (glob)
221 221 no changes found
222 222 divergent bookmark @ stored as @foo
223 223 importing bookmark X
224 224
225 225 reinstall state for further testing:
226 226
227 227 $ hg book -fr 9b140be10808 X
228 228
229 229 revsets should not ignore divergent bookmarks
230 230
231 231 $ hg bookmark -fr 1 Z
232 232 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
233 233 0:4e3505fd9583 Y
234 234 1:9b140be10808 @ X Z foobar
235 235 2:0d2164f0ce0d @foo X@foo
236 236 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
237 237 2:0d2164f0ce0d @foo X@foo
238 238 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
239 239 2:0d2164f0ce0d @foo X@foo
240 240
241 241 update a remote bookmark from a non-head to a head
242 242
243 243 $ hg up -q Y
244 244 $ echo c3 > f2
245 245 $ hg ci -Am3
246 246 adding f2
247 247 created new head
248 248 $ hg push ../a
249 249 pushing to ../a
250 250 searching for changes
251 251 adding changesets
252 252 adding manifests
253 253 adding file changes
254 254 added 1 changesets with 1 changes to 1 files (+1 heads)
255 255 updating bookmark Y
256 256 $ hg -R ../a book
257 257 @ 1:0d2164f0ce0d
258 258 * X 1:0d2164f0ce0d
259 259 Y 3:f6fc62dde3c0
260 260 Z 1:0d2164f0ce0d
261 261
262 262 update a bookmark in the middle of a client pulling changes
263 263
264 264 $ cd ..
265 265 $ hg clone -q a pull-race
266 $ hg clone -q pull-race pull-race2
266
267 We want to use http because it is stateless and therefore more susceptible to
268 race conditions
269
270 $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
271 $ cat pull-race.pid >> $DAEMON_PIDS
272
273 $ hg clone -q http://localhost:$HGPORT/ pull-race2
267 274 $ cd pull-race
268 275 $ hg up -q Y
269 276 $ echo c4 > f2
270 277 $ hg ci -Am4
271 278 $ echo c5 > f3
272 279 $ cat <<EOF > .hg/hgrc
273 280 > [hooks]
274 281 > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
275 282 > EOF
276 $ cd ../pull-race2
283
284 (new config needs a server restart)
285
286 $ cd ..
287 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
288 $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
289 $ cat pull-race.pid >> $DAEMON_PIDS
290 $ cd pull-race2
277 291 $ hg -R $TESTTMP/pull-race book
278 292 @ 1:0d2164f0ce0d
279 293 X 1:0d2164f0ce0d
280 294 * Y 4:b0a5eff05604
281 295 Z 1:0d2164f0ce0d
282 296 $ hg pull
283 pulling from $TESTTMP/pull-race (glob)
297 pulling from http://localhost:$HGPORT/
284 298 searching for changes
285 adding f3
286 committed in pull-race
287 299 adding changesets
288 300 adding manifests
289 301 adding file changes
290 302 added 1 changesets with 1 changes to 1 files
291 303 updating bookmark Y
292 304 (run 'hg update' to get a working copy)
293 305 $ hg book
294 306 * @ 1:0d2164f0ce0d
295 307 X 1:0d2164f0ce0d
296 308 Y 4:b0a5eff05604
297 309 Z 1:0d2164f0ce0d
310
311 (done with this section of the test)
312
313 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
298 314 $ cd ../b
299 315
300 316 diverging a remote bookmark fails
301 317
302 318 $ hg up -q 4e3505fd9583
303 319 $ echo c4 > f2
304 320 $ hg ci -Am4
305 321 adding f2
306 322 created new head
307 323 $ echo c5 > f2
308 324 $ hg ci -Am5
309 325 $ hg log -G
310 326 @ 5:c922c0139ca0 5
311 327 |
312 328 o 4:4efff6d98829 4
313 329 |
314 330 | o 3:f6fc62dde3c0 3
315 331 |/
316 332 | o 2:0d2164f0ce0d 1
317 333 |/
318 334 | o 1:9b140be10808 2
319 335 |/
320 336 o 0:4e3505fd9583 test
321 337
322 338
323 339 $ hg book -f Y
324 340
325 341 $ cat <<EOF > ../a/.hg/hgrc
326 342 > [web]
327 343 > push_ssl = false
328 344 > allow_push = *
329 345 > EOF
330 346
331 347 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
332 348 $ cat ../hg2.pid >> $DAEMON_PIDS
333 349
334 350 $ hg push http://localhost:$HGPORT2/
335 351 pushing to http://localhost:$HGPORT2/
336 352 searching for changes
337 353 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
338 354 (merge or see "hg help push" for details about pushing new heads)
339 355 [255]
340 356 $ hg -R ../a book
341 357 @ 1:0d2164f0ce0d
342 358 * X 1:0d2164f0ce0d
343 359 Y 3:f6fc62dde3c0
344 360 Z 1:0d2164f0ce0d
345 361
346 362
347 363 Unrelated marker does not alter the decision
348 364
349 365 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
350 366 $ hg push http://localhost:$HGPORT2/
351 367 pushing to http://localhost:$HGPORT2/
352 368 searching for changes
353 369 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
354 370 (merge or see "hg help push" for details about pushing new heads)
355 371 [255]
356 372 $ hg -R ../a book
357 373 @ 1:0d2164f0ce0d
358 374 * X 1:0d2164f0ce0d
359 375 Y 3:f6fc62dde3c0
360 376 Z 1:0d2164f0ce0d
361 377
362 378 Update to a successor works
363 379
364 380 $ hg id --debug -r 3
365 381 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
366 382 $ hg id --debug -r 4
367 383 4efff6d98829d9c824c621afd6e3f01865f5439f
368 384 $ hg id --debug -r 5
369 385 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
370 386 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
371 387 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
372 388 $ hg push http://localhost:$HGPORT2/
373 389 pushing to http://localhost:$HGPORT2/
374 390 searching for changes
375 391 remote: adding changesets
376 392 remote: adding manifests
377 393 remote: adding file changes
378 394 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
379 395 remote: 2 new obsolescence markers
380 396 updating bookmark Y
381 397 $ hg -R ../a book
382 398 @ 1:0d2164f0ce0d
383 399 * X 1:0d2164f0ce0d
384 400 Y 5:c922c0139ca0
385 401 Z 1:0d2164f0ce0d
386 402
387 403 hgweb
388 404
389 405 $ cat <<EOF > .hg/hgrc
390 406 > [web]
391 407 > push_ssl = false
392 408 > allow_push = *
393 409 > EOF
394 410
395 411 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
396 412 $ cat ../hg.pid >> $DAEMON_PIDS
397 413 $ cd ../a
398 414
399 415 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
400 416 bookmarks
401 417 namespaces
402 418 obsolete
403 419 phases
404 420 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
405 421 @ 9b140be1080824d768c5a4691a564088eede71f9
406 422 X 9b140be1080824d768c5a4691a564088eede71f9
407 423 Y c922c0139ca03858f655e4a2af4dd02796a63969
408 424 Z 9b140be1080824d768c5a4691a564088eede71f9
409 425 foo 0000000000000000000000000000000000000000
410 426 foobar 9b140be1080824d768c5a4691a564088eede71f9
411 427 $ hg out -B http://localhost:$HGPORT/
412 428 comparing with http://localhost:$HGPORT/
413 429 searching for changed bookmarks
414 430 @ 0d2164f0ce0d
415 431 X 0d2164f0ce0d
416 432 Z 0d2164f0ce0d
417 433 foo
418 434 foobar
419 435 $ hg push -B Z http://localhost:$HGPORT/
420 436 pushing to http://localhost:$HGPORT/
421 437 searching for changes
422 438 no changes found
423 439 updating bookmark Z
424 440 [1]
425 441 $ hg book -d Z
426 442 $ hg in -B http://localhost:$HGPORT/
427 443 comparing with http://localhost:$HGPORT/
428 444 searching for changed bookmarks
429 445 @ 9b140be10808
430 446 X 9b140be10808
431 447 Z 0d2164f0ce0d
432 448 foo 000000000000
433 449 foobar 9b140be10808
434 450 $ hg pull -B Z http://localhost:$HGPORT/
435 451 pulling from http://localhost:$HGPORT/
436 452 no changes found
437 453 divergent bookmark @ stored as @1
438 454 divergent bookmark X stored as X@1
439 455 adding remote bookmark Z
440 456 adding remote bookmark foo
441 457 adding remote bookmark foobar
442 458 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
443 459 requesting all changes
444 460 adding changesets
445 461 adding manifests
446 462 adding file changes
447 463 added 5 changesets with 5 changes to 3 files (+2 heads)
448 464 2 new obsolescence markers
449 465 updating to bookmark @
450 466 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 467 $ hg -R cloned-bookmarks bookmarks
452 468 * @ 1:9b140be10808
453 469 X 1:9b140be10808
454 470 Y 4:c922c0139ca0
455 471 Z 2:0d2164f0ce0d
456 472 foo -1:000000000000
457 473 foobar 1:9b140be10808
458 474
459 475 $ cd ..
460 476
461 477 Test to show result of bookmarks comparision
462 478
463 479 $ mkdir bmcomparison
464 480 $ cd bmcomparison
465 481
466 482 $ hg init source
467 483 $ hg -R source debugbuilddag '+2*2*3*4'
468 484 $ hg -R source log -G --template '{rev}:{node|short}'
469 485 o 4:e7bd5218ca15
470 486 |
471 487 | o 3:6100d3090acf
472 488 |/
473 489 | o 2:fa942426a6fd
474 490 |/
475 491 | o 1:66f7d451a68b
476 492 |/
477 493 o 0:1ea73414a91b
478 494
479 495 $ hg -R source bookmarks -r 0 SAME
480 496 $ hg -R source bookmarks -r 0 ADV_ON_REPO1
481 497 $ hg -R source bookmarks -r 0 ADV_ON_REPO2
482 498 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1
483 499 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2
484 500 $ hg -R source bookmarks -r 1 DIVERGED
485 501
486 502 $ hg clone -U source repo1
487 503
488 504 (test that incoming/outgoing exit with 1, if there is no bookmark to
489 505 be excahnged)
490 506
491 507 $ hg -R repo1 incoming -B
492 508 comparing with $TESTTMP/bmcomparison/source
493 509 searching for changed bookmarks
494 510 no changed bookmarks found
495 511 [1]
496 512 $ hg -R repo1 outgoing -B
497 513 comparing with $TESTTMP/bmcomparison/source
498 514 searching for changed bookmarks
499 515 no changed bookmarks found
500 516 [1]
501 517
502 518 $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1
503 519 $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1
504 520 $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1
505 521 $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED
506 522 $ hg -R repo1 -q --config extensions.mq= strip 4
507 523 $ hg -R repo1 log -G --template '{node|short} ({bookmarks})'
508 524 o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED)
509 525 |
510 526 | o fa942426a6fd (ADV_ON_REPO1)
511 527 |/
512 528 | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED)
513 529 |/
514 530 o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME)
515 531
516 532
517 533 $ hg clone -U source repo2
518 534 $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2
519 535 $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2
520 536 $ hg -R repo2 bookmarks -f -r 2 DIVERGED
521 537 $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2
522 538 $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED
523 539 $ hg -R repo2 -q --config extensions.mq= strip 3
524 540 $ hg -R repo2 log -G --template '{node|short} ({bookmarks})'
525 541 o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED)
526 542 |
527 543 | o fa942426a6fd (DIVERGED)
528 544 |/
529 545 | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2)
530 546 |/
531 547 o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME)
532 548
533 549
534 550 (test that difference of bookmarks between repositories are fully shown)
535 551
536 552 $ hg -R repo1 incoming -B repo2 -v
537 553 comparing with repo2
538 554 searching for changed bookmarks
539 555 ADD_ON_REPO2 66f7d451a68b added
540 556 ADV_ON_REPO2 66f7d451a68b advanced
541 557 DIFF_ADV_ON_REPO2 e7bd5218ca15 changed
542 558 DIFF_DIVERGED e7bd5218ca15 changed
543 559 DIVERGED fa942426a6fd diverged
544 560 $ hg -R repo1 outgoing -B repo2 -v
545 561 comparing with repo2
546 562 searching for changed bookmarks
547 563 ADD_ON_REPO1 66f7d451a68b added
548 564 ADD_ON_REPO2 deleted
549 565 ADV_ON_REPO1 fa942426a6fd advanced
550 566 DIFF_ADV_ON_REPO1 6100d3090acf advanced
551 567 DIFF_ADV_ON_REPO2 1ea73414a91b changed
552 568 DIFF_DIVERGED 6100d3090acf changed
553 569 DIVERGED 66f7d451a68b diverged
554 570
555 571 $ hg -R repo2 incoming -B repo1 -v
556 572 comparing with repo1
557 573 searching for changed bookmarks
558 574 ADD_ON_REPO1 66f7d451a68b added
559 575 ADV_ON_REPO1 fa942426a6fd advanced
560 576 DIFF_ADV_ON_REPO1 6100d3090acf changed
561 577 DIFF_DIVERGED 6100d3090acf changed
562 578 DIVERGED 66f7d451a68b diverged
563 579 $ hg -R repo2 outgoing -B repo1 -v
564 580 comparing with repo1
565 581 searching for changed bookmarks
566 582 ADD_ON_REPO1 deleted
567 583 ADD_ON_REPO2 66f7d451a68b added
568 584 ADV_ON_REPO2 66f7d451a68b advanced
569 585 DIFF_ADV_ON_REPO1 1ea73414a91b changed
570 586 DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced
571 587 DIFF_DIVERGED e7bd5218ca15 changed
572 588 DIVERGED fa942426a6fd diverged
573 589
574 590 $ cd ..
575 591
576 592 Pushing a bookmark should only push the changes required by that
577 593 bookmark, not all outgoing changes:
578 594 $ hg clone http://localhost:$HGPORT/ addmarks
579 595 requesting all changes
580 596 adding changesets
581 597 adding manifests
582 598 adding file changes
583 599 added 5 changesets with 5 changes to 3 files (+2 heads)
584 600 2 new obsolescence markers
585 601 updating to bookmark @
586 602 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 603 $ cd addmarks
588 604 $ echo foo > foo
589 605 $ hg add foo
590 606 $ hg commit -m 'add foo'
591 607 $ echo bar > bar
592 608 $ hg add bar
593 609 $ hg commit -m 'add bar'
594 610 $ hg co "tip^"
595 611 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
596 612 (leaving bookmark @)
597 613 $ hg book add-foo
598 614 $ hg book -r tip add-bar
599 615 Note: this push *must* push only a single changeset, as that's the point
600 616 of this test.
601 617 $ hg push -B add-foo --traceback
602 618 pushing to http://localhost:$HGPORT/
603 619 searching for changes
604 620 remote: adding changesets
605 621 remote: adding manifests
606 622 remote: adding file changes
607 623 remote: added 1 changesets with 1 changes to 1 files
608 624 exporting bookmark add-foo
609 625
610 626 pushing a new bookmark on a new head does not require -f if -B is specified
611 627
612 628 $ hg up -q X
613 629 $ hg book W
614 630 $ echo c5 > f2
615 631 $ hg ci -Am5
616 632 created new head
617 633 $ hg push -B W
618 634 pushing to http://localhost:$HGPORT/
619 635 searching for changes
620 636 remote: adding changesets
621 637 remote: adding manifests
622 638 remote: adding file changes
623 639 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
624 640 exporting bookmark W
625 641 $ hg -R ../b id -r W
626 642 cc978a373a53 tip W
627 643
628 644 Check summary output for incoming/outgoing bookmarks
629 645
630 646 $ hg bookmarks -d X
631 647 $ hg bookmarks -d Y
632 648 $ hg summary --remote | grep '^remote:'
633 649 remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob)
634 650
635 651 $ cd ..
636 652
637 653 pushing an unchanged bookmark should result in no changes
638 654
639 655 $ hg init unchanged-a
640 656 $ hg init unchanged-b
641 657 $ cd unchanged-a
642 658 $ echo initial > foo
643 659 $ hg commit -A -m initial
644 660 adding foo
645 661 $ hg bookmark @
646 662 $ hg push -B @ ../unchanged-b
647 663 pushing to ../unchanged-b
648 664 searching for changes
649 665 adding changesets
650 666 adding manifests
651 667 adding file changes
652 668 added 1 changesets with 1 changes to 1 files
653 669 exporting bookmark @
654 670
655 671 $ hg push -B @ ../unchanged-b
656 672 pushing to ../unchanged-b
657 673 searching for changes
658 674 no changes found
659 675 [1]
660 676
661 677
662 678 Check hook preventing push (issue4455)
663 679 ======================================
664 680
665 681 $ hg bookmarks
666 682 * @ 0:55482a6fb4b1
667 683 $ hg log -G
668 684 @ 0:55482a6fb4b1 initial
669 685
670 686 $ hg init ../issue4455-dest
671 687 $ hg push ../issue4455-dest # changesets only
672 688 pushing to ../issue4455-dest
673 689 searching for changes
674 690 adding changesets
675 691 adding manifests
676 692 adding file changes
677 693 added 1 changesets with 1 changes to 1 files
678 694 $ cat >> .hg/hgrc << EOF
679 695 > [paths]
680 696 > local=../issue4455-dest/
681 697 > ssh=ssh://user@dummy/issue4455-dest
682 698 > http=http://localhost:$HGPORT/
683 699 > [ui]
684 700 > ssh=python "$TESTDIR/dummyssh"
685 701 > EOF
686 702 $ cat >> ../issue4455-dest/.hg/hgrc << EOF
687 703 > [hooks]
688 704 > prepushkey=false
689 705 > [web]
690 706 > push_ssl = false
691 707 > allow_push = *
692 708 > EOF
693 709 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
694 710 $ hg -R ../issue4455-dest serve -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log
695 711 $ cat ../issue4455.pid >> $DAEMON_PIDS
696 712
697 713 Local push
698 714 ----------
699 715
700 716 $ hg push -B @ local
701 717 pushing to $TESTTMP/issue4455-dest (glob)
702 718 searching for changes
703 719 no changes found
704 720 pushkey-abort: prepushkey hook exited with status 1
705 721 exporting bookmark @ failed!
706 722 [1]
707 723 $ hg -R ../issue4455-dest/ bookmarks
708 724 no bookmarks set
709 725
710 726 Using ssh
711 727 ---------
712 728
713 729 $ hg push -B @ ssh --config experimental.bundle2-exp=True
714 730 pushing to ssh://user@dummy/issue4455-dest
715 731 searching for changes
716 732 no changes found
717 733 remote: pushkey-abort: prepushkey hook exited with status 1
718 734 exporting bookmark @ failed!
719 735 [1]
720 736 $ hg -R ../issue4455-dest/ bookmarks
721 737 no bookmarks set
722 738
723 739 $ hg push -B @ ssh --config experimental.bundle2-exp=False
724 740 pushing to ssh://user@dummy/issue4455-dest
725 741 searching for changes
726 742 no changes found
727 743 remote: pushkey-abort: prepushkey hook exited with status 1
728 744 exporting bookmark @ failed!
729 745 [1]
730 746 $ hg -R ../issue4455-dest/ bookmarks
731 747 no bookmarks set
732 748
733 749 Using http
734 750 ----------
735 751
736 752 $ hg push -B @ http --config experimental.bundle2-exp=True
737 753 pushing to http://localhost:$HGPORT/
738 754 searching for changes
739 755 no changes found
740 756 remote: pushkey-abort: prepushkey hook exited with status 1
741 757 exporting bookmark @ failed!
742 758 [1]
743 759 $ hg -R ../issue4455-dest/ bookmarks
744 760 no bookmarks set
745 761
746 762 $ hg push -B @ http --config experimental.bundle2-exp=False
747 763 pushing to http://localhost:$HGPORT/
748 764 searching for changes
749 765 no changes found
750 766 remote: pushkey-abort: prepushkey hook exited with status 1
751 767 exporting bookmark @ failed!
752 768 [1]
753 769 $ hg -R ../issue4455-dest/ bookmarks
754 770 no bookmarks set
General Comments 0
You need to be logged in to leave comments. Login now