Show More
@@ -537,6 +537,30 def manifestmerge(repo, wctx, p2, pa, br | |||||
537 |
|
537 | |||
538 | return actions, diverge, renamedelete |
|
538 | return actions, diverge, renamedelete | |
539 |
|
539 | |||
|
540 | def _resolvetrivial(repo, wctx, mctx, ancestor, actions): | |||
|
541 | """Resolves false conflicts where the nodeid changed but the content | |||
|
542 | remained the same.""" | |||
|
543 | ||||
|
544 | cdactions = [] | |||
|
545 | for action in actions['cd']: | |||
|
546 | f = action[0] | |||
|
547 | if f in ancestor and not wctx[f].cmp(ancestor[f]): | |||
|
548 | # local did change but ended up with same content | |||
|
549 | actions['r'].append((f, None, "prompt same")) | |||
|
550 | else: | |||
|
551 | cdactions.append(action) | |||
|
552 | actions['cd'] = cdactions | |||
|
553 | ||||
|
554 | dcactions = [] | |||
|
555 | for action in actions['dc']: | |||
|
556 | f = action[0] | |||
|
557 | if f in ancestor and not mctx[f].cmp(ancestor[f]): | |||
|
558 | # remote did change but ended up with same content | |||
|
559 | pass # don't get = keep local deleted | |||
|
560 | else: | |||
|
561 | dcactions.append(action) | |||
|
562 | actions['dc'] = dcactions | |||
|
563 | ||||
540 | def calculateupdates(repo, wctx, mctx, ancestors, branchmerge, force, partial, |
|
564 | def calculateupdates(repo, wctx, mctx, ancestors, branchmerge, force, partial, | |
541 | acceptremote, followcopies): |
|
565 | acceptremote, followcopies): | |
542 | "Calculate the actions needed to merge mctx into wctx using ancestors" |
|
566 | "Calculate the actions needed to merge mctx into wctx using ancestors" | |
@@ -614,12 +638,11 def calculateupdates(repo, wctx, mctx, a | |||||
614 | continue |
|
638 | continue | |
615 | repo.ui.note(_('end of auction\n\n')) |
|
639 | repo.ui.note(_('end of auction\n\n')) | |
616 |
|
640 | |||
|
641 | _resolvetrivial(repo, wctx, mctx, ancestors[0], actions) | |||
|
642 | ||||
617 | # Prompt and create actions. TODO: Move this towards resolve phase. |
|
643 | # Prompt and create actions. TODO: Move this towards resolve phase. | |
618 | for f, args, msg in sorted(actions['cd']): |
|
644 | for f, args, msg in sorted(actions['cd']): | |
619 | if f in ancestors[0] and not wctx[f].cmp(ancestors[0][f]): |
|
645 | if repo.ui.promptchoice( | |
620 | # local did change but ended up with same content |
|
|||
621 | actions['r'].append((f, None, "prompt same")) |
|
|||
622 | elif repo.ui.promptchoice( |
|
|||
623 | _("local changed %s which remote deleted\n" |
|
646 | _("local changed %s which remote deleted\n" | |
624 | "use (c)hanged version or (d)elete?" |
|
647 | "use (c)hanged version or (d)elete?" | |
625 | "$$ &Changed $$ &Delete") % f, 0): |
|
648 | "$$ &Changed $$ &Delete") % f, 0): | |
@@ -630,10 +653,7 def calculateupdates(repo, wctx, mctx, a | |||||
630 |
|
653 | |||
631 | for f, args, msg in sorted(actions['dc']): |
|
654 | for f, args, msg in sorted(actions['dc']): | |
632 | flags, = args |
|
655 | flags, = args | |
633 | if f in ancestors[0] and not mctx[f].cmp(ancestors[0][f]): |
|
656 | if repo.ui.promptchoice( | |
634 | # remote did change but ended up with same content |
|
|||
635 | pass # don't get = keep local deleted |
|
|||
636 | elif repo.ui.promptchoice( |
|
|||
637 | _("remote changed %s which local deleted\n" |
|
657 | _("remote changed %s which local deleted\n" | |
638 | "use (c)hanged version or leave (d)eleted?" |
|
658 | "use (c)hanged version or leave (d)eleted?" | |
639 | "$$ &Changed $$ &Deleted") % f, 0) == 0: |
|
659 | "$$ &Changed $$ &Deleted") % f, 0) == 0: |
General Comments 0
You need to be logged in to leave comments.
Login now