Show More
@@ -321,42 +321,48 b' fn merge_copies_dict<A: Fn(Revision, Rev' | |||
|
321 | 321 | // We cannot get copy information for both p1 and p2 in the |
|
322 | 322 | // same rev. So this is the same value. |
|
323 | 323 | unreachable!(); |
|
324 | } else if src_major.path.is_none() | |
|
325 | && changes.salvaged.contains(dest) | |
|
326 | { | |
|
327 | // If the file is "deleted" in the major side but was | |
|
328 | // salvaged by the merge, we keep the minor side alive | |
|
329 | pick_minor(); | |
|
330 | } else if src_minor.path.is_none() | |
|
331 | && changes.salvaged.contains(dest) | |
|
332 | { | |
|
333 | // If the file is "deleted" in the minor side but was | |
|
334 | // salvaged by the merge, unconditionnaly preserve the | |
|
335 | // major side. | |
|
336 | pick_major(); | |
|
337 | } else if changes.merged.contains(dest) { | |
|
338 | // If the file was actively merged, copy information from | |
|
339 | // each side might conflict. The major side will win such | |
|
340 | // conflict. | |
|
341 | pick_major(); | |
|
342 | } else if oracle.is_ancestor(src_major.rev, src_minor.rev) { | |
|
343 | // If the minor side is strictly newer than the major side, | |
|
344 | // it should be kept. | |
|
345 | pick_minor(); | |
|
346 | } else if src_major.path.is_some() { | |
|
347 | // without any special case, the "major" value win other | |
|
348 | // the "minor" one. | |
|
349 | pick_major(); | |
|
350 | } else if oracle.is_ancestor(src_minor.rev, src_major.rev) { | |
|
351 | // the "major" rev is a direct ancestors of "minor", any | |
|
352 | // different value should overwrite | |
|
353 | pick_major(); | |
|
354 | 324 | } else { |
|
355 | // major version is None (so the file was deleted on that | |
|
356 | // branch) and that branch is independant (neither minor | |
|
357 | // nor major is an ancestors of the other one.) We preserve | |
|
358 | // the new information about the new file. | |
|
359 | pick_minor(); | |
|
325 | if src_major.path.is_none() | |
|
326 | && changes.salvaged.contains(dest) | |
|
327 | { | |
|
328 | // If the file is "deleted" in the major side but was | |
|
329 | // salvaged by the merge, we keep the minor side alive | |
|
330 | pick_minor(); | |
|
331 | } else if src_minor.path.is_none() | |
|
332 | && changes.salvaged.contains(dest) | |
|
333 | { | |
|
334 | // If the file is "deleted" in the minor side but was | |
|
335 | // salvaged by the merge, unconditionnaly preserve the | |
|
336 | // major side. | |
|
337 | pick_major(); | |
|
338 | } else if changes.merged.contains(dest) { | |
|
339 | // If the file was actively merged, copy information | |
|
340 | // from each side might conflict. The major side will | |
|
341 | // win such conflict. | |
|
342 | pick_major(); | |
|
343 | } else if oracle.is_ancestor(src_major.rev, src_minor.rev) | |
|
344 | { | |
|
345 | // If the minor side is strictly newer than the major | |
|
346 | // side, it should be kept. | |
|
347 | pick_minor(); | |
|
348 | } else if src_major.path.is_some() { | |
|
349 | // without any special case, the "major" value win | |
|
350 | // other the "minor" one. | |
|
351 | pick_major(); | |
|
352 | } else if oracle.is_ancestor(src_minor.rev, src_major.rev) | |
|
353 | { | |
|
354 | // the "major" rev is a direct ancestors of "minor", | |
|
355 | // any different value should | |
|
356 | // overwrite | |
|
357 | pick_major(); | |
|
358 | } else { | |
|
359 | // major version is None (so the file was deleted on | |
|
360 | // that branch) and that branch is independant (neither | |
|
361 | // minor nor major is an ancestors of the other one.) | |
|
362 | // We preserve the new | |
|
363 | // information about the new file. | |
|
364 | pick_minor(); | |
|
365 | } | |
|
360 | 366 | } |
|
361 | 367 | } |
|
362 | 368 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now