comparison tests/test-merge-types.t @ 18338:384df4db6520

merge: merge file flags together with file content The 'x' flag and the 'l' flag are very different. It is usually not a problem to change the 'x' flag of a normal file independent of the content, but one does not simply change the type of a file to 'l' independent of the content. This removes the fmerge function that merged both 'x' and 'l' independent of content early in the merge process. This correctly introduces some conflicts instead of silent incorrect merges. 3-way flag merge will now be done in the resolve process, right next to file content merge. Conflicts can thus be resolved with (slightly inconvenient) resolve commands like 'resolve f --tool internal:other'. It thus brings us closer to be able to re-solve manifest merge after the merge and avoid prompts during merge. This also removes the "conflicting flags for a - (n)one, e(x)ec or sym(l)ink?" prompt that nobody could answer and that made it easy to mix symlink targets and file contents up. Instead it will give a file merge where a sufficiently clever merge tool can help resolving the issue.
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 09 Jan 2013 02:02:45 +0100
parents 557c8522aec0
children 9de9727cea53
comparison
equal deleted inserted replaced
18337:557c8522aec0 18338:384df4db6520
32 $ hg merge --debug 32 $ hg merge --debug
33 searching for copies back to rev 1 33 searching for copies back to rev 1
34 resolving manifests 34 resolving manifests
35 overwrite: False, partial: False 35 overwrite: False, partial: False
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c 36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
37 conflicting flags for a 37 a: versions differ -> m
38 (n)one, e(x)ec or sym(l)ink? n 38 preserving a for resolve of a
39 a: update permissions -> e
40 updating: a 1/1 files (100.00%) 39 updating: a 1/1 files (100.00%)
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 40 picked tool 'internal:merge' for a (binary False symlink True)
42 (branch merge, don't forget to commit) 41 merging a
43 42 my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da
44 $ tellmeabout a 43 warning: internal:merge cannot merge symlinks for a
45 a is a plain file with content: 44 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
46 symlink (no-eol) 45 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
46 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
47 [1]
48
49 $ tellmeabout a
50 a is a symlink:
51 a -> symlink
52 $ hg resolve a --tool internal:other
53 $ tellmeabout a
54 a is an executable file with content:
55 a
56 $ hg st
57 M a
58 ? a.orig
47 59
48 Symlink is other parent, executable is local: 60 Symlink is other parent, executable is local:
49 61
50 $ hg update -C 1 62 $ hg update -C 1
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ hg merge --debug 65 $ hg merge --debug
54 searching for copies back to rev 1 66 searching for copies back to rev 1
55 resolving manifests 67 resolving manifests
56 overwrite: False, partial: False 68 overwrite: False, partial: False
57 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f 69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
58 conflicting flags for a 70 a: versions differ -> m
59 (n)one, e(x)ec or sym(l)ink? n 71 preserving a for resolve of a
60 a: remote is newer -> g
61 updating: a 1/1 files (100.00%) 72 updating: a 1/1 files (100.00%)
62 getting a 73 picked tool 'internal:merge' for a (binary False symlink True)
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 74 merging a
64 (branch merge, don't forget to commit) 75 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
65 76 warning: internal:merge cannot merge symlinks for a
66 $ tellmeabout a 77 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
67 a is a plain file with content: 78 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
68 symlink (no-eol) 79 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
80 [1]
81
82 $ tellmeabout a
83 a is an executable file with content:
84 a
69 85
70 Update to link without local change should get us a symlink (issue3316): 86 Update to link without local change should get us a symlink (issue3316):
71 87
72 $ hg up -C 0 88 $ hg up -C 0
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 $ hg up 90 $ hg up
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 $ hg st 92 $ hg st
93 ? a.orig
77 94
78 Update to link with local change should cause a merge prompt (issue3200): 95 Update to link with local change should cause a merge prompt (issue3200):
79 96
80 $ hg up -Cq 0 97 $ hg up -Cq 0
81 $ echo data > a 98 $ echo data > a
117 $ hg up -qr0 134 $ hg up -qr0
118 $ rm f 135 $ rm f
119 $ ln -s base f 136 $ ln -s base f
120 $ hg ci -qm2 137 $ hg ci -qm2
121 $ hg merge 138 $ hg merge
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 139 merging f
123 (branch merge, don't forget to commit) 140 warning: internal:merge cannot merge symlinks for f
141 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
142 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
143 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
144 [1]
124 $ tellmeabout f 145 $ tellmeabout f
125 f is a symlink: 146 f is a symlink:
126 f -> file 147 f -> base
127 content
128
129 148
130 $ hg up -Cqr1 149 $ hg up -Cqr1
131 $ hg merge 150 $ hg merge
132 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 151 merging f
133 (branch merge, don't forget to commit) 152 warning: internal:merge cannot merge symlinks for f
153 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
154 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
155 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
156 [1]
134 $ tellmeabout f 157 $ tellmeabout f
135 f is a plain file with content: 158 f is a plain file with content:
136 file 159 file
137 content 160 content
138 161
150 $ hg up -qr0 173 $ hg up -qr0
151 $ rm f 174 $ rm f
152 $ ln -s dangling f 175 $ ln -s dangling f
153 $ hg ci -qm2 176 $ hg ci -qm2
154 $ hg merge 177 $ hg merge
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 178 merging f
156 (branch merge, don't forget to commit) 179 warning: internal:merge cannot merge symlinks for f
180 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
181 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
182 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
183 [1]
157 $ tellmeabout f 184 $ tellmeabout f
158 f is a symlink: 185 f is a symlink:
159 f -> dangling 186 f -> dangling
160 187
161 $ hg up -Cqr1 188 $ hg up -Cqr1
162 $ hg merge 189 $ hg merge
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 190 merging f
164 (branch merge, don't forget to commit) 191 warning: internal:merge cannot merge symlinks for f
165 $ tellmeabout f 192 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
166 f is a symlink: 193 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
167 f -> dangling 194 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
195 [1]
196 $ tellmeabout f
197 f is a plain file with content:
198 f
168 199
169 $ cd .. 200 $ cd ..
170 201
171 Test merge with no common ancestor: 202 Test merge with no common ancestor:
172 a: just different 203 a: just different
208 $ ln -s x g 239 $ ln -s x g
209 $ ln -s 2 h 240 $ ln -s 2 h
210 $ hg ci -Aqm2 241 $ hg ci -Aqm2
211 242
212 $ hg merge 243 $ hg merge
213 conflicting flags for e
214 (n)one, e(x)ec or sym(l)ink? n
215 conflicting flags for d
216 (n)one, e(x)ec or sym(l)ink? n
217 merging a 244 merging a
218 warning: conflicts during merge. 245 warning: conflicts during merge.
219 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') 246 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
247 warning: cannot merge flags for b
220 merging b 248 merging b
221 warning: conflicts during merge. 249 warning: conflicts during merge.
222 merging b incomplete! (edit conflicts, then use 'hg resolve --mark') 250 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
223 merging d 251 merging d
224 warning: internal:merge cannot merge symlinks for d 252 warning: internal:merge cannot merge symlinks for d
227 warning: internal:merge cannot merge symlinks for f 255 warning: internal:merge cannot merge symlinks for f
228 merging f incomplete! (edit conflicts, then use 'hg resolve --mark') 256 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
229 merging h 257 merging h
230 warning: internal:merge cannot merge symlinks for h 258 warning: internal:merge cannot merge symlinks for h
231 merging h incomplete! (edit conflicts, then use 'hg resolve --mark') 259 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
232 2 files updated, 0 files merged, 0 files removed, 5 files unresolved 260 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
233 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon 261 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
234 [1] 262 [1]
235 $ hg resolve -l 263 $ hg resolve -l
236 U a 264 U a
237 U b 265 U b
244 2 272 2
245 ======= 273 =======
246 1 274 1
247 >>>>>>> other 275 >>>>>>> other
248 $ tellmeabout b 276 $ tellmeabout b
249 b is an executable file with content: 277 b is a plain file with content:
250 <<<<<<< local 278 <<<<<<< local
251 2 279 2
252 ======= 280 =======
253 1 281 1
254 >>>>>>> other 282 >>>>>>> other
255 $ tellmeabout c 283 $ tellmeabout c
256 c is an executable file with content: 284 c is a plain file with content:
257 x 285 x
258 $ tellmeabout d 286 $ tellmeabout d
259 d is a plain file with content: 287 d is a symlink:
260 2 (no-eol) 288 d -> 2
261 $ tellmeabout e 289 $ tellmeabout e
262 e is a plain file with content: 290 e is a symlink:
263 x (no-eol) 291 e -> x
264 $ tellmeabout f 292 $ tellmeabout f
265 f is a symlink: 293 f is a symlink:
266 f -> 2 294 f -> 2
267 $ tellmeabout g 295 $ tellmeabout g
268 g is a symlink: 296 g is a symlink:
271 h is a symlink: 299 h is a symlink:
272 h -> 2 300 h -> 2
273 301
274 $ hg up -Cqr1 302 $ hg up -Cqr1
275 $ hg merge 303 $ hg merge
276 conflicting flags for e
277 (n)one, e(x)ec or sym(l)ink? n
278 conflicting flags for d
279 (n)one, e(x)ec or sym(l)ink? n
280 merging a 304 merging a
281 warning: conflicts during merge. 305 warning: conflicts during merge.
282 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') 306 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
307 warning: cannot merge flags for b
283 merging b 308 merging b
284 warning: conflicts during merge. 309 warning: conflicts during merge.
285 merging b incomplete! (edit conflicts, then use 'hg resolve --mark') 310 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
286 merging d 311 merging d
287 warning: internal:merge cannot merge symlinks for d 312 warning: internal:merge cannot merge symlinks for d
290 warning: internal:merge cannot merge symlinks for f 315 warning: internal:merge cannot merge symlinks for f
291 merging f incomplete! (edit conflicts, then use 'hg resolve --mark') 316 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
292 merging h 317 merging h
293 warning: internal:merge cannot merge symlinks for h 318 warning: internal:merge cannot merge symlinks for h
294 merging h incomplete! (edit conflicts, then use 'hg resolve --mark') 319 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
295 1 files updated, 0 files merged, 0 files removed, 5 files unresolved 320 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
296 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon 321 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
297 [1] 322 [1]
298 $ tellmeabout a 323 $ tellmeabout a
299 a is a plain file with content: 324 a is a plain file with content:
300 <<<<<<< local 325 <<<<<<< local
308 1 333 1
309 ======= 334 =======
310 2 335 2
311 >>>>>>> other 336 >>>>>>> other
312 $ tellmeabout c 337 $ tellmeabout c
313 c is an executable file with content: 338 c is a plain file with content:
314 x 339 x
315 $ tellmeabout d 340 $ tellmeabout d
316 d is a plain file with content: 341 d is an executable file with content:
317 1 342 1
318 $ tellmeabout e 343 $ tellmeabout e
319 e is a plain file with content: 344 e is an executable file with content:
320 x (no-eol) 345 x (no-eol)
321 $ tellmeabout f 346 $ tellmeabout f
322 f is a plain file with content: 347 f is a plain file with content:
323 1 348 1
324 $ tellmeabout g 349 $ tellmeabout g