##// END OF EJS Templates
test-merge1: avoid a shell script
Alexis S. L. Carvalho -
r4294:ccfe423d default
parent child Browse files
Show More
@@ -1,103 +1,103
1 #!/bin/sh
1 #!/bin/sh
2
2
3 cat <<'EOF' > merge
3 cat <<EOF > merge
4 #!/bin/sh
4 import sys, os
5 echo merging for `basename $1`
5 print "merging for", os.path.basename(sys.argv[1])
6 EOF
6 EOF
7 chmod +x merge
7 HGMERGE="python ../merge"; export HGMERGE
8
8
9 mkdir t
9 mkdir t
10 cd t
10 cd t
11 hg init
11 hg init
12 echo This is file a1 > a
12 echo This is file a1 > a
13 hg add a
13 hg add a
14 hg commit -m "commit #0" -d "1000000 0"
14 hg commit -m "commit #0" -d "1000000 0"
15 echo This is file b1 > b
15 echo This is file b1 > b
16 hg add b
16 hg add b
17 hg commit -m "commit #1" -d "1000000 0"
17 hg commit -m "commit #1" -d "1000000 0"
18
18
19 hg update 0
19 hg update 0
20 echo This is file c1 > c
20 echo This is file c1 > c
21 hg add c
21 hg add c
22 hg commit -m "commit #2" -d "1000000 0"
22 hg commit -m "commit #2" -d "1000000 0"
23 echo This is file b1 > b
23 echo This is file b1 > b
24 echo %% no merges expected
24 echo %% no merges expected
25 env HGMERGE=../merge hg merge 1
25 hg merge 1
26 hg diff --nodates
26 hg diff --nodates
27 hg status
27 hg status
28 cd ..; rm -r t
28 cd ..; rm -r t
29
29
30 mkdir t
30 mkdir t
31 cd t
31 cd t
32 hg init
32 hg init
33 echo This is file a1 > a
33 echo This is file a1 > a
34 hg add a
34 hg add a
35 hg commit -m "commit #0" -d "1000000 0"
35 hg commit -m "commit #0" -d "1000000 0"
36 echo This is file b1 > b
36 echo This is file b1 > b
37 hg add b
37 hg add b
38 hg commit -m "commit #1" -d "1000000 0"
38 hg commit -m "commit #1" -d "1000000 0"
39
39
40 hg update 0
40 hg update 0
41 echo This is file c1 > c
41 echo This is file c1 > c
42 hg add c
42 hg add c
43 hg commit -m "commit #2" -d "1000000 0"
43 hg commit -m "commit #2" -d "1000000 0"
44 echo This is file b2 > b
44 echo This is file b2 > b
45 echo %% merge should fail
45 echo %% merge should fail
46 env HGMERGE=../merge hg merge 1
46 hg merge 1
47 echo %% merge of b expected
47 echo %% merge of b expected
48 env HGMERGE=../merge hg merge -f 1
48 hg merge -f 1
49 hg diff --nodates
49 hg diff --nodates
50 hg status
50 hg status
51 cd ..; rm -r t
51 cd ..; rm -r t
52 echo %%
52 echo %%
53
53
54 mkdir t
54 mkdir t
55 cd t
55 cd t
56 hg init
56 hg init
57 echo This is file a1 > a
57 echo This is file a1 > a
58 hg add a
58 hg add a
59 hg commit -m "commit #0" -d "1000000 0"
59 hg commit -m "commit #0" -d "1000000 0"
60 echo This is file b1 > b
60 echo This is file b1 > b
61 hg add b
61 hg add b
62 hg commit -m "commit #1" -d "1000000 0"
62 hg commit -m "commit #1" -d "1000000 0"
63 echo This is file b22 > b
63 echo This is file b22 > b
64 hg commit -m "commit #2" -d "1000000 0"
64 hg commit -m "commit #2" -d "1000000 0"
65 hg update 1
65 hg update 1
66 echo This is file c1 > c
66 echo This is file c1 > c
67 hg add c
67 hg add c
68 hg commit -m "commit #3" -d "1000000 0"
68 hg commit -m "commit #3" -d "1000000 0"
69
69
70 echo 'Contents of b should be "this is file b1"'
70 echo 'Contents of b should be "this is file b1"'
71 cat b
71 cat b
72
72
73 echo This is file b22 > b
73 echo This is file b22 > b
74 echo %% merge fails
74 echo %% merge fails
75 env HGMERGE=../merge hg merge 2
75 hg merge 2
76 echo %% merge expected!
76 echo %% merge expected!
77 env HGMERGE=../merge hg merge -f 2
77 hg merge -f 2
78 hg diff --nodates
78 hg diff --nodates
79 hg status
79 hg status
80 cd ..; rm -r t
80 cd ..; rm -r t
81
81
82 mkdir t
82 mkdir t
83 cd t
83 cd t
84 hg init
84 hg init
85 echo This is file a1 > a
85 echo This is file a1 > a
86 hg add a
86 hg add a
87 hg commit -m "commit #0" -d "1000000 0"
87 hg commit -m "commit #0" -d "1000000 0"
88 echo This is file b1 > b
88 echo This is file b1 > b
89 hg add b
89 hg add b
90 hg commit -m "commit #1" -d "1000000 0"
90 hg commit -m "commit #1" -d "1000000 0"
91 echo This is file b22 > b
91 echo This is file b22 > b
92 hg commit -m "commit #2" -d "1000000 0"
92 hg commit -m "commit #2" -d "1000000 0"
93 hg update 1
93 hg update 1
94 echo This is file c1 > c
94 echo This is file c1 > c
95 hg add c
95 hg add c
96 hg commit -m "commit #3" -d "1000000 0"
96 hg commit -m "commit #3" -d "1000000 0"
97 echo This is file b33 > b
97 echo This is file b33 > b
98 echo %% merge of b should fail
98 echo %% merge of b should fail
99 env HGMERGE=../merge hg merge 2
99 hg merge 2
100 echo %% merge of b expected
100 echo %% merge of b expected
101 env HGMERGE=../merge hg merge -f 2
101 hg merge -f 2
102 hg diff --nodates
102 hg diff --nodates
103 hg status
103 hg status
General Comments 0
You need to be logged in to leave comments. Login now