1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
|
$ hg init a
$ cd a
$ echo foo > t1
$ hg add t1
$ hg commit -m "1"
$ cd ..
$ hg clone a b
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd a
$ echo foo > t2
$ hg add t2
$ hg commit -m "2"
$ cd ../b
$ echo foo > t3
$ hg add t3
$ hg commit -m "3"
Specifying a revset that evaluates to null will abort
$ hg push -r '0 & 1' ../a
pushing to ../a
abort: specified revisions evaluate to an empty set
(use different revision arguments)
[10]
$ hg push ../a
pushing to ../a
searching for changes
remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
abort: push creates new remote head 1e108cc5548c
(pull and merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push --debug ../a
pushing to ../a
query 1; heads
searching for changes
taking quick initial sample
query 2; still undecided: 1, sample size is: 1
2 total queries in *.????s (glob)
listing keys for "phases"
checking for updated bookmarks
listing keys for "bookmarks"
listing keys for "bookmarks"
remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
new remote heads on branch 'default':
1e108cc5548c
abort: push creates new remote head 1e108cc5548c
(pull and merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg pull ../a
pulling from ../a
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 1c9246a22a0a
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg push ../a
pushing to ../a
searching for changes
abort: push creates new remote head 1e108cc5548c
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -m "4"
$ hg push ../a
pushing to ../a
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 1 changes to 1 files
$ cd ..
$ hg init c
$ cd c
$ for i in 0 1 2; do
> echo $i >> foo
> hg ci -Am $i
> done
adding foo
$ cd ..
$ hg clone c d
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd d
$ for i in 0 1; do
> hg co -C $i
> echo d-$i >> foo
> hg ci -m d-$i
> done
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
created new head
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
created new head
$ HGMERGE=true hg merge 3
merging foo
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m c-d
$ hg push ../c
pushing to ../c
searching for changes
abort: push creates new remote head 6346d66eb9f5
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push -r 2 ../c
pushing to ../c
searching for changes
no changes found
[1]
$ hg push -r 3 ../c
pushing to ../c
searching for changes
abort: push creates new remote head a5dda829a167
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push -v -r 3 -r 4 ../c
pushing to ../c
searching for changes
new remote heads on branch 'default':
a5dda829a167
ee8fbc7a0295
abort: push creates new remote head a5dda829a167
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push -v -f -r 3 -r 4 ../c
pushing to ../c
searching for changes
2 changesets found
uncompressed size of bundle content:
352 (changelog)
326 (manifests)
25\d foo (re)
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files (+2 heads)
$ hg push -r 5 ../c
pushing to ../c
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (-1 heads)
$ hg in ../c
comparing with ../c
searching for changes
no changes found
[1]
Issue450: push -r warns about remote head creation even if no heads
will be created
$ hg init ../e
$ hg push -r 0 ../e
pushing to ../e
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ hg push -r 1 ../e
pushing to ../e
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ cd ..
Issue736: named branches are not considered for detection of
unmerged heads in "hg push"
$ hg init f
$ cd f
$ hg -q branch a
$ echo 0 > foo
$ hg -q ci -Am 0
$ echo 1 > foo
$ hg -q ci -m 1
$ hg -q up 0
$ echo 2 > foo
$ hg -q ci -m 2
$ hg -q up 0
$ hg -q branch b
$ echo 3 > foo
$ hg -q ci -m 3
$ cd ..
$ hg -q clone f g
$ cd g
Push on existing branch and new branch:
$ hg -q up 1
$ echo 4 > foo
$ hg -q ci -m 4
$ hg -q up 0
$ echo 5 > foo
$ hg -q branch c
$ hg -q ci -m 5
$ hg push ../f
pushing to ../f
searching for changes
abort: push creates new remote branches: c
(use 'hg push --new-branch' to create new remote branches)
[20]
$ hg push -r 4 -r 5 ../f
pushing to ../f
searching for changes
abort: push creates new remote branches: c
(use 'hg push --new-branch' to create new remote branches)
[20]
Multiple new branches:
$ hg -q branch d
$ echo 6 > foo
$ hg -q ci -m 6
$ hg push ../f
pushing to ../f
searching for changes
abort: push creates new remote branches: c, d
(use 'hg push --new-branch' to create new remote branches)
[20]
$ hg push -r 4 -r 6 ../f
pushing to ../f
searching for changes
abort: push creates new remote branches: c, d
(use 'hg push --new-branch' to create new remote branches)
[20]
$ cd ../g
Fail on multiple head push:
$ hg -q up 1
$ echo 7 > foo
$ hg -q ci -m 7
$ hg push -r 4 -r 7 ../f
pushing to ../f
searching for changes
abort: push creates new remote head 0b715ef6ff8f on branch 'a'
(merge or see 'hg help push' for details about pushing new heads)
[20]
Push replacement head on existing branches:
$ hg -q up 3
$ echo 8 > foo
$ hg -q ci -m 8
$ hg push -r 7 -r 8 ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Merge of branch a to other branch b followed by unrelated push
on branch a:
$ hg -q up 7
$ HGMERGE=true hg -q merge 8
$ hg -q ci -m 9
$ hg -q up 8
$ echo 10 > foo
$ hg -q ci -m 10
$ hg push -r 9 ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (-1 heads)
$ hg push -r 10 ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
Cheating the counting algorithm:
$ hg -q up 9
$ HGMERGE=true hg -q merge 2
$ hg -q ci -m 11
$ hg -q up 1
$ echo 12 > foo
$ hg -q ci -m 12
$ hg push -r 11 -r 12 ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Failed push of new named branch:
$ echo 12 > foo
$ hg -q ci -m 12a
[1]
$ hg -q up 11
$ echo 13 > foo
$ hg -q branch e
$ hg -q ci -m 13d
$ hg push -r 12 -r 13 ../f
pushing to ../f
searching for changes
abort: push creates new remote branches: e
(use 'hg push --new-branch' to create new remote branches)
[20]
Using --new-branch to push new named branch:
$ hg push --new-branch -r 12 -r 13 ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Pushing multi headed new branch:
$ echo 14 > foo
$ hg -q branch f
$ hg -q ci -m 14
$ echo 15 > foo
$ hg -q ci -m 15
$ hg -q up 14
$ echo 16 > foo
$ hg -q ci -m 16
$ hg push --branch f --new-branch ../f
pushing to ../f
searching for changes
abort: push creates new branch 'f' with multiple heads
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push --branch f --new-branch --force ../f
pushing to ../f
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files (+1 heads)
Checking prepush logic does not allow silently pushing
multiple new heads but also doesn't report too many heads:
$ cd ..
$ hg init h
$ echo init > h/init
$ hg -R h ci -Am init
adding init
$ echo a > h/a
$ hg -R h ci -Am a
adding a
$ hg clone h i
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R h up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo b > h/b
$ hg -R h ci -Am b
adding b
created new head
$ hg -R i up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo c > i/c
$ hg -R i ci -Am c
adding c
created new head
$ for i in `"$PYTHON" $TESTDIR/seq.py 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
$ hg -R i push h
pushing to h
searching for changes
remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
abort: push creates new remote head 97bd0c84d346
(pull and merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg -R h up -q 0; echo x > h/b; hg -R h ci -qAmx
$ hg -R i push h
pushing to h
searching for changes
remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others
abort: push creates new remote head 97bd0c84d346
(pull and merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg -R i push h -v
pushing to h
searching for changes
remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
new remote heads on branch 'default':
97bd0c84d346
abort: push creates new remote head 97bd0c84d346
(pull and merge or see 'hg help push' for details about pushing new heads)
[20]
Check prepush logic with merged branches:
$ hg init j
$ hg -R j branch a
marked working directory as branch a
(branches are permanent and global, did you want a bookmark?)
$ echo init > j/foo
$ hg -R j ci -Am init
adding foo
$ hg clone j k
updating to branch a
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo a1 > j/foo
$ hg -R j ci -m a1
$ hg -R k branch b
marked working directory as branch b
$ echo b > k/foo
$ hg -R k ci -m b
$ hg -R k up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R k merge b
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg -R k ci -m merge
$ hg -R k push -r a j
pushing to j
searching for changes
abort: push creates new remote branches: b
(use 'hg push --new-branch' to create new remote branches)
[20]
Prepush -r should not allow you to sneak in new heads:
$ hg init l
$ cd l
$ echo a >> foo
$ hg -q add foo
$ hg -q branch a
$ hg -q ci -ma
$ hg -q up null
$ echo a >> foo
$ hg -q add foo
$ hg -q branch b
$ hg -q ci -mb
$ cd ..
$ hg -q clone l m -u a
$ cd m
$ hg -q merge b
$ hg -q ci -mmb
$ hg -q up 0
$ echo a >> foo
$ hg -q ci -ma2
$ hg -q up 2
$ echo a >> foo
$ hg -q branch -f b
$ hg -q ci -mb2
$ hg -q merge 3
$ hg -q ci -mma
$ hg push ../l -b b
pushing to ../l
searching for changes
abort: push creates new remote head 451211cc22b0 on branch 'a'
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ cd ..
Check prepush with new branch head on former topo non-head:
$ hg init n
$ cd n
$ hg branch A
marked working directory as branch A
(branches are permanent and global, did you want a bookmark?)
$ echo a >a
$ hg ci -Ama
adding a
$ hg branch B
marked working directory as branch B
$ echo b >b
$ hg ci -Amb
adding b
b is now branch head of B, and a topological head
a is now branch head of A, but not a topological head
$ hg clone . inner
updating to branch B
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd inner
$ hg up B
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo b1 >b1
$ hg ci -Amb1
adding b1
in the clone b1 is now the head of B
$ cd ..
$ hg up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo a2 >a2
$ hg ci -Ama2
adding a2
a2 is now the new branch head of A, and a new topological head
it replaces a former inner branch head, so it should at most warn about
A, not B
glog of local:
$ hg log -G --template "{rev}: {branches} {desc}\n"
@ 2: A a2
|
| o 1: B b
|/
o 0: A a
glog of remote:
$ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
@ 2: B b1
|
o 1: B b
|
o 0: A a
outgoing:
$ hg out inner --template "{rev}: {branches} {desc}\n"
comparing with inner
searching for changes
2: A a2
$ hg push inner
pushing to inner
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
$ cd ..
Check prepush with new branch head on former topo head:
$ hg init o
$ cd o
$ hg branch A
marked working directory as branch A
(branches are permanent and global, did you want a bookmark?)
$ echo a >a
$ hg ci -Ama
adding a
$ hg branch B
marked working directory as branch B
$ echo b >b
$ hg ci -Amb
adding b
b is now branch head of B, and a topological head
$ hg up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo a1 >a1
$ hg ci -Ama1
adding a1
a1 is now branch head of A, and a topological head
$ hg clone . inner
updating to branch A
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd inner
$ hg up B
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo b1 >b1
$ hg ci -Amb1
adding b1
in the clone b1 is now the head of B
$ cd ..
$ echo a2 >a2
$ hg ci -Ama2
adding a2
a2 is now the new branch head of A, and a topological head
it replaces a former topological and branch head, so this should not warn
glog of local:
$ hg log -G --template "{rev}: {branches} {desc}\n"
@ 3: A a2
|
o 2: A a1
|
| o 1: B b
|/
o 0: A a
glog of remote:
$ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
@ 3: B b1
|
| o 2: A a1
| |
o | 1: B b
|/
o 0: A a
outgoing:
$ hg out inner --template "{rev}: {branches} {desc}\n"
comparing with inner
searching for changes
3: A a2
$ hg push inner
pushing to inner
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ cd ..
Check prepush with new branch head and new child of former branch head
but child is on different branch:
$ hg init p
$ cd p
$ hg branch A
marked working directory as branch A
(branches are permanent and global, did you want a bookmark?)
$ echo a0 >a
$ hg ci -Ama0
adding a
$ echo a1 >a
$ hg ci -ma1
$ hg up null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg branch B
marked working directory as branch B
$ echo b0 >b
$ hg ci -Amb0
adding b
$ echo b1 >b
$ hg ci -mb1
$ hg clone . inner
updating to branch B
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg up A
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg branch -f B
marked working directory as branch B
$ echo a3 >a
$ hg ci -ma3
created new head
$ hg up 3
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg branch -f A
marked working directory as branch A
$ echo b3 >b
$ hg ci -mb3
created new head
glog of local:
$ hg log -G --template "{rev}: {branches} {desc}\n"
@ 5: A b3
|
| o 4: B a3
| |
o | 3: B b1
| |
o | 2: B b0
/
o 1: A a1
|
o 0: A a0
glog of remote:
$ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
@ 3: B b1
|
o 2: B b0
o 1: A a1
|
o 0: A a0
outgoing:
$ hg out inner --template "{rev}: {branches} {desc}\n"
comparing with inner
searching for changes
4: B a3
5: A b3
$ hg push inner
pushing to inner
searching for changes
abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg push inner -r4 -r5
pushing to inner
searching for changes
abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ hg in inner
comparing with inner
searching for changes
no changes found
[1]
Test fail hook
$ hg push inner --config hooks.fail-push="echo running fail-push hook"
pushing to inner
searching for changes
running fail-push hook
abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'
(merge or see 'hg help push' for details about pushing new heads)
[20]
$ cd ..
Test regarding pushing of closed branch/branches(Issue6080)
$ hg init x
$ cd x
$ hg -q branch a
$ echo 0 > foo
$ hg -q ci -Am 0
$ hg -q up 0
$ cd ..
$ hg -q clone x z
$ cd z
When there is a single closed branch
$ hg -q branch foo
$ echo 0 > foo
$ hg -q ci -Am 0
$ hg ci --close-branch -m 'closing branch foo'
$ hg -q up 0
$ hg push ../x
pushing to ../x
searching for changes
abort: push creates new remote branches: foo (1 closed)
(use 'hg push --new-branch' to create new remote branches)
[20]
When there is more than one closed branches
$ hg -q branch bar
$ echo 0 > bar
$ hg -q ci -Am 0
$ hg ci --close-branch -m 'closing branch bar'
$ hg -q up 0
$ hg push ../x
pushing to ../x
searching for changes
abort: push creates new remote branches: bar, foo (2 closed)
(use 'hg push --new-branch' to create new remote branches)
[20]
When there are more than one new branches and not all are closed
$ hg -q branch bar1
$ echo 0 > bar1
$ hg -q ci -Am 0
$ hg -q up 0
$ hg push ../x
pushing to ../x
searching for changes
abort: push creates new remote branches: bar, bar1, foo (2 closed)
(use 'hg push --new-branch' to create new remote branches)
[20]
$ cd ..
|