test-merge1
104 lines
| 2.0 KiB
| text/plain
|
TextLexer
/ tests / test-merge1
|
r800 | #!/bin/sh | ||
|
r407 | |||
cat <<'EOF' > merge | ||||
#!/bin/sh | ||||
echo merging for `basename $1` | ||||
EOF | ||||
chmod +x merge | ||||
mkdir t | ||||
cd t | ||||
hg init | ||||
echo This is file a1 > a | ||||
hg add a | ||||
|
r1933 | hg commit -m "commit #0" -d "1000000 0" | ||
|
r407 | echo This is file b1 > b | ||
hg add b | ||||
|
r1933 | hg commit -m "commit #1" -d "1000000 0" | ||
|
r407 | |||
hg update 0 | ||||
echo This is file c1 > c | ||||
hg add c | ||||
|
r1933 | hg commit -m "commit #2" -d "1000000 0" | ||
|
r407 | echo This is file b1 > b | ||
|
r1236 | echo %% no merges expected | ||
|
r2283 | env HGMERGE=../merge hg merge 1 | ||
|
r3330 | hg diff --nodates | ||
hg status | ||||
|
r407 | cd ..; /bin/rm -rf t | ||
mkdir t | ||||
cd t | ||||
hg init | ||||
echo This is file a1 > a | ||||
hg add a | ||||
|
r1933 | hg commit -m "commit #0" -d "1000000 0" | ||
|
r407 | echo This is file b1 > b | ||
hg add b | ||||
|
r1933 | hg commit -m "commit #1" -d "1000000 0" | ||
|
r407 | |||
hg update 0 | ||||
echo This is file c1 > c | ||||
hg add c | ||||
|
r1933 | hg commit -m "commit #2" -d "1000000 0" | ||
|
r407 | echo This is file b2 > b | ||
|
r1581 | echo %% merge should fail | ||
|
r2283 | env HGMERGE=../merge hg merge 1 | ||
|
r1236 | echo %% merge of b expected | ||
|
r2283 | env HGMERGE=../merge hg merge -f 1 | ||
|
r3330 | hg diff --nodates | ||
hg status | ||||
|
r407 | cd ..; /bin/rm -rf t | ||
|
r1236 | echo %% | ||
|
r407 | |||
mkdir t | ||||
cd t | ||||
hg init | ||||
echo This is file a1 > a | ||||
hg add a | ||||
|
r1933 | hg commit -m "commit #0" -d "1000000 0" | ||
|
r407 | echo This is file b1 > b | ||
hg add b | ||||
|
r1933 | hg commit -m "commit #1" -d "1000000 0" | ||
|
r407 | echo This is file b22 > b | ||
|
r1933 | hg commit -m "commit #2" -d "1000000 0" | ||
|
r407 | hg update 1 | ||
echo This is file c1 > c | ||||
hg add c | ||||
|
r1933 | hg commit -m "commit #3" -d "1000000 0" | ||
|
r1236 | |||
echo 'Contents of b should be "this is file b1"' | ||||
|
r430 | cat b | ||
|
r1236 | |||
|
r407 | echo This is file b22 > b | ||
|
r1581 | echo %% merge fails | ||
|
r2283 | env HGMERGE=../merge hg merge 2 | ||
|
r1236 | echo %% merge expected! | ||
|
r2283 | env HGMERGE=../merge hg merge -f 2 | ||
|
r3330 | hg diff --nodates | ||
hg status | ||||
|
r407 | cd ..; /bin/rm -rf t | ||
mkdir t | ||||
cd t | ||||
hg init | ||||
echo This is file a1 > a | ||||
hg add a | ||||
|
r1933 | hg commit -m "commit #0" -d "1000000 0" | ||
|
r407 | echo This is file b1 > b | ||
hg add b | ||||
|
r1933 | hg commit -m "commit #1" -d "1000000 0" | ||
|
r407 | echo This is file b22 > b | ||
|
r1933 | hg commit -m "commit #2" -d "1000000 0" | ||
|
r407 | hg update 1 | ||
echo This is file c1 > c | ||||
hg add c | ||||
|
r1933 | hg commit -m "commit #3" -d "1000000 0" | ||
|
r407 | echo This is file b33 > b | ||
|
r1581 | echo %% merge of b should fail | ||
|
r2283 | env HGMERGE=../merge hg merge 2 | ||
|
r1581 | echo %% merge of b expected | ||
|
r2283 | env HGMERGE=../merge hg merge -f 2 | ||
|
r3330 | hg diff --nodates | ||
hg status | ||||
|
r407 | cd ..; /bin/rm -rf t | ||