##// END OF EJS Templates
test: use more elaborated content in ``test-conflict.t``...
Pierre-Yves David -
r21920:1d04d3fe default
parent child Browse files
Show More
@@ -1,126 +1,185 b''
1 $ hg init
1 $ hg init
2 $ echo "nothing" > a
2 $ cat << EOF > a
3 > Small Mathematical Series.
4 > One
5 > Two
6 > Three
7 > Four
8 > Five
9 > Hop we are done.
10 > EOF
3 $ hg add a
11 $ hg add a
4 $ hg commit -m ancestor
12 $ hg commit -m ancestor
5 $ echo "something" > a
13 $ cat << EOF > a
14 > Small Mathematical Series.
15 > 1
16 > 2
17 > 3
18 > 4
19 > 5
20 > Hop we are done.
21 > EOF
6 $ hg commit -m branch1
22 $ hg commit -m branch1
7 $ hg co 0
23 $ hg co 0
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 $ echo "something else" > a
25 $ cat << EOF > a
26 > Small Mathematical Series.
27 > 1
28 > 2
29 > 3
30 > 6
31 > 8
32 > Hop we are done.
33 > EOF
10 $ hg commit -m branch2
34 $ hg commit -m branch2
11 created new head
35 created new head
12
36
13 $ hg merge 1
37 $ hg merge 1
14 merging a
38 merging a
15 warning: conflicts during merge.
39 warning: conflicts during merge.
16 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
40 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
17 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
41 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
18 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
42 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
19 [1]
43 [1]
20
44
21 $ hg id
45 $ hg id
22 32e80765d7fe+75234512624c+ tip
46 618808747361+c0c68e4fe667+ tip
23
47
24 $ cat a
48 $ cat a
25 <<<<<<< local: 32e80765d7fe - test: branch2
49 Small Mathematical Series.
26 something else
50 1
51 2
52 3
53 <<<<<<< local: 618808747361 - test: branch2
54 6
55 8
27 =======
56 =======
28 something
57 4
29 >>>>>>> other: 75234512624c - test: branch1
58 5
59 >>>>>>> other: c0c68e4fe667 - test: branch1
60 Hop we are done.
30
61
31 $ hg status
62 $ hg status
32 M a
63 M a
33 ? a.orig
64 ? a.orig
34
65
35 Verify custom conflict markers
66 Verify custom conflict markers
36
67
37 $ hg up -q --clean .
68 $ hg up -q --clean .
38 $ printf "\n[ui]\nmergemarkertemplate={author} {rev}\n" >> .hg/hgrc
69 $ printf "\n[ui]\nmergemarkertemplate={author} {rev}\n" >> .hg/hgrc
39
70
40 $ hg merge 1
71 $ hg merge 1
41 merging a
72 merging a
42 warning: conflicts during merge.
73 warning: conflicts during merge.
43 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
74 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
75 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
76 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
46 [1]
77 [1]
47
78
48 $ cat a
79 $ cat a
80 Small Mathematical Series.
81 1
82 2
83 3
49 <<<<<<< local: test 2
84 <<<<<<< local: test 2
50 something else
85 6
86 8
51 =======
87 =======
52 something
88 4
89 5
53 >>>>>>> other: test 1
90 >>>>>>> other: test 1
91 Hop we are done.
54
92
55 Verify line splitting of custom conflict marker which causes multiple lines
93 Verify line splitting of custom conflict marker which causes multiple lines
56
94
57 $ hg up -q --clean .
95 $ hg up -q --clean .
58 $ cat >> .hg/hgrc <<EOF
96 $ cat >> .hg/hgrc <<EOF
59 > [ui]
97 > [ui]
60 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
98 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
61 > EOF
99 > EOF
62
100
63 $ hg -q merge 1
101 $ hg -q merge 1
64 warning: conflicts during merge.
102 warning: conflicts during merge.
65 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
103 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
66 [1]
104 [1]
67
105
68 $ cat a
106 $ cat a
107 Small Mathematical Series.
108 1
109 2
110 3
69 <<<<<<< local: test 2
111 <<<<<<< local: test 2
70 something else
112 6
113 8
71 =======
114 =======
72 something
115 4
116 5
73 >>>>>>> other: test 1
117 >>>>>>> other: test 1
118 Hop we are done.
74
119
75 Verify line trimming of custom conflict marker using multi-byte characters
120 Verify line trimming of custom conflict marker using multi-byte characters
76
121
77 $ hg up -q --clean .
122 $ hg up -q --clean .
78 $ python <<EOF
123 $ python <<EOF
79 > fp = open('logfile', 'w')
124 > fp = open('logfile', 'w')
80 > fp.write('12345678901234567890123456789012345678901234567890' +
125 > fp.write('12345678901234567890123456789012345678901234567890' +
81 > '1234567890') # there are 5 more columns for 80 columns
126 > '1234567890') # there are 5 more columns for 80 columns
82 >
127 >
83 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
128 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
84 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
129 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
85 >
130 >
86 > fp.close()
131 > fp.close()
87 > EOF
132 > EOF
88 $ hg add logfile
133 $ hg add logfile
89 $ hg --encoding utf-8 commit --logfile logfile
134 $ hg --encoding utf-8 commit --logfile logfile
90
135
91 $ cat >> .hg/hgrc <<EOF
136 $ cat >> .hg/hgrc <<EOF
92 > [ui]
137 > [ui]
93 > mergemarkertemplate={desc|firstline}
138 > mergemarkertemplate={desc|firstline}
94 > EOF
139 > EOF
95
140
96 $ hg -q --encoding utf-8 merge 1
141 $ hg -q --encoding utf-8 merge 1
97 warning: conflicts during merge.
142 warning: conflicts during merge.
98 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
143 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
99 [1]
144 [1]
100
145
101 $ cat a
146 $ cat a
147 Small Mathematical Series.
148 1
149 2
150 3
102 <<<<<<< local: 123456789012345678901234567890123456789012345678901234567890\xe3\x81\x82... (esc)
151 <<<<<<< local: 123456789012345678901234567890123456789012345678901234567890\xe3\x81\x82... (esc)
103 something else
152 6
153 8
104 =======
154 =======
105 something
155 4
156 5
106 >>>>>>> other: branch1
157 >>>>>>> other: branch1
158 Hop we are done.
107
159
108 Verify basic conflict markers
160 Verify basic conflict markers
109
161
110 $ hg up -q --clean 2
162 $ hg up -q --clean 2
111 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
163 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
112
164
113 $ hg merge 1
165 $ hg merge 1
114 merging a
166 merging a
115 warning: conflicts during merge.
167 warning: conflicts during merge.
116 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
168 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
117 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
169 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
118 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
170 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
119 [1]
171 [1]
120
172
121 $ cat a
173 $ cat a
174 Small Mathematical Series.
175 1
176 2
177 3
122 <<<<<<< local
178 <<<<<<< local
123 something else
179 6
180 8
124 =======
181 =======
125 something
182 4
183 5
126 >>>>>>> other
184 >>>>>>> other
185 Hop we are done.
General Comments 0
You need to be logged in to leave comments. Login now