# HG changeset patch # User mpm@selenic.com # Date 1115276271 28800 # Node ID 9f64ee81719922f857c4bff34af2b9ab68b16fc4 # Parent febfb35d2a3e2b0df980b379e44cc2214d0a93ff Add some tests to the repo diff --git a/tests/fish-merge b/tests/fish-merge new file mode 100644 --- /dev/null +++ b/tests/fish-merge @@ -0,0 +1,86 @@ +set -e +set -x + +# skip commit logs +export HGMERGE=tkmerge +export EDITOR=true + +rm -rf m m1 m2 +mkdir m +cd m + +echo "m this that" +echo "this" > a +echo "that" > b +hg init +hg addremove +hg commit +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd .. +echo "m2 this that " +mkdir m2 +cd m2 +hg branch ../m +hg checkout +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m +echo "m this1 that " +echo "this1" > a +hg commit +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd .. +echo "m1 this1 that " +mkdir m1 +cd m1 +hg branch ../m +hg checkout +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m1 +echo "m1 this1 that1" +echo "that1" > b +hg commit +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m2 +echo "m2 this that2" +echo "that2" > b +hg commit +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m1 +echo "m1:m2 this1 that1 that2" +hg merge ../m2 # b should conflict, a should be fine +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m2 +echo "m2 this2 that2" +echo "this2" > a +hg commit +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +cd ../m2 +echo "m2:m this12 that2" +hg merge ../m # a should conflict, b should be fine +echo "a:" `hg dump a` "b:" `hg dump b` +echo + +# now here's the interesting bit +# if we choose ancestor by file, no conflicts +# otherwise we've got two equally close ancestors, each with a conflict +# if we go back to the root, we'll have both conflicts again +echo "m2:m1 this12 that12" +hg merge ../m1 # should be clean +echo "a:" `hg dump a` "b:" `hg dump b` +echo diff --git a/tests/manifest-bug b/tests/manifest-bug new file mode 100644 --- /dev/null +++ b/tests/manifest-bug @@ -0,0 +1,42 @@ +#!/bin/sh -x + +set +e + +BASE=foo.base +BR1=foo.br1 +BR2=foo.br2 +BR2_1=foo.br2_1 + +mkdir $BASE +cd $BASE +hg init +echo test > file +hg add file +EDITOR="echo 'initial commit' > " hg commit +cd .. + +mkdir $BR1 +cd $BR1 +hg branch ../$BASE +hg checkout +echo test > file1 +hg addremove +EDITOR="echo side commit >" hg commit +cd .. + +mkdir $BR2 +cd $BR2 +hg branch ../$BASE +hg checkout +echo yet more >> file2 +hg addremove +EDITOR="echo second update >" hg commit +cd .. + +mkdir $BR2_1 +cd $BR2_1 +hg branch ../$BR2 +hg checkout +EDITOR="echo commit merge >" hg merge ../$BR1 + +hg checkout diff --git a/tests/simple-merge b/tests/simple-merge new file mode 100644 --- /dev/null +++ b/tests/simple-merge @@ -0,0 +1,22 @@ +set -ex +export EDITOR=true +rm -rf test branch + +mkdir test +cd test +echo foo>foo +hg init +hg addremove +hg commit +hg verify +cd .. + +cp -a test branch +cd branch +echo bar>>foo +hg commit + +cd ../test +hg merge ../branch +hg verify +