2005-07-29 18:19:43 +04:00
|
|
|
#!/bin/sh
|
2005-06-22 06:41:57 +04:00
|
|
|
|
2007-03-27 08:41:17 +04:00
|
|
|
cat <<EOF > merge
|
|
|
|
import sys, os
|
2008-10-12 21:11:59 +04:00
|
|
|
|
|
|
|
try:
|
|
|
|
import msvcrt
|
|
|
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
|
|
|
msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
|
2007-03-27 08:41:17 +04:00
|
|
|
print "merging for", os.path.basename(sys.argv[1])
|
2005-06-22 06:41:57 +04:00
|
|
|
EOF
|
2007-03-27 08:41:17 +04:00
|
|
|
HGMERGE="python ../merge"; export HGMERGE
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
mkdir t
|
|
|
|
cd t
|
|
|
|
hg init
|
|
|
|
echo This is file a1 > a
|
|
|
|
hg add a
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #0" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b1 > b
|
|
|
|
hg add b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #1" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
hg update 0
|
|
|
|
echo This is file c1 > c
|
|
|
|
hg add c
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #2" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b1 > b
|
2005-09-14 03:38:27 +04:00
|
|
|
echo %% no merges expected
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge 1
|
2006-10-11 18:35:09 +04:00
|
|
|
hg diff --nodates
|
|
|
|
hg status
|
2006-12-26 16:17:48 +03:00
|
|
|
cd ..; rm -r t
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
mkdir t
|
|
|
|
cd t
|
|
|
|
hg init
|
|
|
|
echo This is file a1 > a
|
|
|
|
hg add a
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #0" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b1 > b
|
|
|
|
hg add b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #1" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
hg update 0
|
|
|
|
echo This is file c1 > c
|
|
|
|
hg add c
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #2" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b2 > b
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge should fail
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge 1
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge of b expected
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge -f 1
|
2006-10-11 18:35:09 +04:00
|
|
|
hg diff --nodates
|
|
|
|
hg status
|
2006-12-26 16:17:48 +03:00
|
|
|
cd ..; rm -r t
|
2005-09-14 03:38:27 +04:00
|
|
|
echo %%
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
mkdir t
|
|
|
|
cd t
|
|
|
|
hg init
|
|
|
|
echo This is file a1 > a
|
|
|
|
hg add a
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #0" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b1 > b
|
|
|
|
hg add b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #1" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b22 > b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #2" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
hg update 1
|
|
|
|
echo This is file c1 > c
|
|
|
|
hg add c
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #3" -d "1000000 0"
|
2005-09-14 03:38:27 +04:00
|
|
|
|
|
|
|
echo 'Contents of b should be "this is file b1"'
|
2005-06-22 09:07:08 +04:00
|
|
|
cat b
|
2005-09-14 03:38:27 +04:00
|
|
|
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b22 > b
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge fails
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge 2
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge expected!
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge -f 2
|
2006-10-11 18:35:09 +04:00
|
|
|
hg diff --nodates
|
|
|
|
hg status
|
2006-12-26 16:17:48 +03:00
|
|
|
cd ..; rm -r t
|
2005-06-22 06:41:57 +04:00
|
|
|
|
|
|
|
mkdir t
|
|
|
|
cd t
|
|
|
|
hg init
|
|
|
|
echo This is file a1 > a
|
|
|
|
hg add a
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #0" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b1 > b
|
|
|
|
hg add b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #1" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b22 > b
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #2" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
hg update 1
|
|
|
|
echo This is file c1 > c
|
|
|
|
hg add c
|
2006-03-13 15:05:41 +03:00
|
|
|
hg commit -m "commit #3" -d "1000000 0"
|
2005-06-22 06:41:57 +04:00
|
|
|
echo This is file b33 > b
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge of b should fail
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge 2
|
2005-12-15 07:19:03 +03:00
|
|
|
echo %% merge of b expected
|
2007-03-27 08:41:17 +04:00
|
|
|
hg merge -f 2
|
2006-10-11 18:35:09 +04:00
|
|
|
hg diff --nodates
|
|
|
|
hg status
|