# HG changeset patch # User Peter Arrenbrecht # Date 1271266554 -7200 # Node ID 29a83fb8c067eb4ff0856e9fd2bdef7eaaa0647a # Parent 816bac2f94521eef3d9dd4dc51eab0ed6972b738 prepush: add more test cases diff -r 816bac2f9452 -r 29a83fb8c067 tests/test-push-warn --- a/tests/test-push-warn Wed Apr 14 19:11:35 2010 +0200 +++ b/tests/test-push-warn Wed Apr 14 19:35:54 2010 +0200 @@ -264,4 +264,40 @@ hg push inner cd .. +echo % check prepush with new branch head and new child of former branch head +echo % but child is on different branch +hg init p +cd p +hg branch A +echo a0 >a +hg ci -Ama0 +echo a1 >a +hg ci -ma1 +hg up null +hg branch B +echo b0 >b +hg ci -Amb0 +echo b1 >b +hg ci -mb1 + +hg clone . inner + +hg up A +hg branch -f B +echo a3 >a +hg ci -ma3 +hg up 3 +hg branch -f A +echo b3 >b +hg ci -mb3 + +echo %% glog of local +hg glog --template "{rev}: {branches} {desc}\n" +echo %% glog of remote +hg glog -R inner --template "{rev}: {branches} {desc}\n" +echo %% outgoing +hg out inner --template "{rev}: {branches} {desc}\n" +hg push inner +cd .. + exit 0 diff -r 816bac2f9452 -r 29a83fb8c067 tests/test-push-warn.out --- a/tests/test-push-warn.out Wed Apr 14 19:11:35 2010 +0200 +++ b/tests/test-push-warn.out Wed Apr 14 19:35:54 2010 +0200 @@ -258,3 +258,48 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files +% check prepush with new branch head and new child of former branch head +% but child is on different branch +marked working directory as branch A +adding a +0 files updated, 0 files merged, 1 files removed, 0 files unresolved +marked working directory as branch B +adding b +created new head +updating to branch B +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +1 files updated, 0 files merged, 1 files removed, 0 files unresolved +marked working directory as branch B +1 files updated, 0 files merged, 1 files removed, 0 files unresolved +marked working directory as branch A +%% glog of local +@ 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 +@ 3: B b1 +| +o 2: B b0 + +o 1: A a1 +| +o 0: A a0 + +%% outgoing +comparing with inner +searching for changes +4: B a3 +5: A b3 +pushing to inner +searching for changes +abort: push creates new remote heads on branch 'A'! +(did you forget to merge? use push -f to force)