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