Show More
@@ -217,6 +217,7 b' class mercurial_sink(common.converter_si' | |||
|
217 | 217 | """ |
|
218 | 218 | anc = [p1ctx.ancestor(p2ctx)] |
|
219 | 219 | # Calculate what files are coming from p2 |
|
220 | # TODO: mresult.commitinfo might be able to get that info | |
|
220 | 221 | mresult = mergemod.calculateupdates( |
|
221 | 222 | self.repo, |
|
222 | 223 | p1ctx, |
@@ -546,18 +546,21 b' class mergeresult(object):' | |||
|
546 | 546 | It has information about what actions need to be performed on dirstate |
|
547 | 547 | mapping of divergent renames and other such cases. ''' |
|
548 | 548 | |
|
549 | def __init__(self, actions, diverge, renamedelete): | |
|
549 | def __init__(self, actions, diverge, renamedelete, commitinfo): | |
|
550 | 550 | """ |
|
551 | 551 | actions: dict of filename as keys and action related info as values |
|
552 | 552 | diverge: mapping of source name -> list of dest name for |
|
553 | 553 | divergent renames |
|
554 | 554 | renamedelete: mapping of source name -> list of destinations for files |
|
555 | 555 | deleted on one side and renamed on other. |
|
556 | commitinfo: dict containing data which should be used on commit | |
|
557 | contains a filename -> info mapping | |
|
556 | 558 | """ |
|
557 | 559 | |
|
558 | 560 | self._actions = actions |
|
559 | 561 | self._diverge = diverge |
|
560 | 562 | self._renamedelete = renamedelete |
|
563 | self._commitinfo = commitinfo | |
|
561 | 564 | |
|
562 | 565 | @property |
|
563 | 566 | def actions(self): |
@@ -571,6 +574,10 b' class mergeresult(object):' | |||
|
571 | 574 | def renamedelete(self): |
|
572 | 575 | return self._renamedelete |
|
573 | 576 | |
|
577 | @property | |
|
578 | def commitinfo(self): | |
|
579 | return self._commitinfo | |
|
580 | ||
|
574 | 581 | def setactions(self, actions): |
|
575 | 582 | self._actions = actions |
|
576 | 583 | |
@@ -608,6 +615,10 b' def manifestmerge(' | |||
|
608 | 615 | branch_copies1 = copies.branch_copies() |
|
609 | 616 | branch_copies2 = copies.branch_copies() |
|
610 | 617 | diverge = {} |
|
618 | # information from merge which is needed at commit time | |
|
619 | # for example choosing filelog of which parent to commit | |
|
620 | # TODO: use specific constants in future for this mapping | |
|
621 | commitinfo = {} | |
|
611 | 622 | if followcopies: |
|
612 | 623 | branch_copies1, branch_copies2, diverge = copies.mergecopies( |
|
613 | 624 | repo, wctx, p2, pa |
@@ -701,6 +712,8 b' def manifestmerge(' | |||
|
701 | 712 | (fl2, False), |
|
702 | 713 | b'remote is newer', |
|
703 | 714 | ) |
|
715 | if branchmerge: | |
|
716 | commitinfo[f] = b'other' | |
|
704 | 717 | elif nol and n2 == a: # remote only changed 'x' |
|
705 | 718 | actions[f] = ( |
|
706 | 719 | mergestatemod.ACTION_EXEC, |
@@ -715,6 +728,8 b' def manifestmerge(' | |||
|
715 | 728 | (fl1, False), |
|
716 | 729 | b'remote is newer', |
|
717 | 730 | ) |
|
731 | if branchmerge: | |
|
732 | commitinfo[f] = b'other' | |
|
718 | 733 | else: # both changed something |
|
719 | 734 | actions[f] = ( |
|
720 | 735 | mergestatemod.ACTION_MERGE, |
@@ -875,7 +890,7 b' def manifestmerge(' | |||
|
875 | 890 | renamedelete = branch_copies1.renamedelete |
|
876 | 891 | renamedelete.update(branch_copies2.renamedelete) |
|
877 | 892 | |
|
878 | return mergeresult(actions, diverge, renamedelete) | |
|
893 | return mergeresult(actions, diverge, renamedelete, commitinfo) | |
|
879 | 894 | |
|
880 | 895 | |
|
881 | 896 | def _resolvetrivial(repo, wctx, mctx, ancestor, actions): |
@@ -1034,7 +1049,8 b' def calculateupdates(' | |||
|
1034 | 1049 | actions[f] = l[0] |
|
1035 | 1050 | continue |
|
1036 | 1051 | repo.ui.note(_(b'end of auction\n\n')) |
|
1037 | mresult = mergeresult(actions, diverge, renamedelete) | |
|
1052 | # TODO: think about commitinfo when bid merge is used | |
|
1053 | mresult = mergeresult(actions, diverge, renamedelete, {}) | |
|
1038 | 1054 | |
|
1039 | 1055 | if wctx.rev() is None: |
|
1040 | 1056 | fractions = _forgetremoved(wctx, mctx, branchmerge) |
General Comments 0
You need to be logged in to leave comments.
Login now