##// END OF EJS Templates
merge: make mergeresult constructor initialize empty object...
Pulkit Goyal -
r45838:fe2040ab default
parent child Browse files
Show More
@@ -546,7 +546,7 b' class mergeresult(object):'
546 It has information about what actions need to be performed on dirstate
546 It has information about what actions need to be performed on dirstate
547 mapping of divergent renames and other such cases. '''
547 mapping of divergent renames and other such cases. '''
548
548
549 def __init__(self, actions, diverge, renamedelete, commitinfo):
549 def __init__(self):
550 """
550 """
551 actions: dict of filename as keys and action related info as values
551 actions: dict of filename as keys and action related info as values
552 diverge: mapping of source name -> list of dest name for
552 diverge: mapping of source name -> list of dest name for
@@ -556,7 +556,12 b' class mergeresult(object):'
556 commitinfo: dict containing data which should be used on commit
556 commitinfo: dict containing data which should be used on commit
557 contains a filename -> info mapping
557 contains a filename -> info mapping
558 """
558 """
559 self._actions = {}
560 self._diverge = {}
561 self._renamedelete = {}
562 self._commitinfo = {}
559
563
564 def updatevalues(self, actions, diverge, renamedelete, commitinfo):
560 self._actions = actions
565 self._actions = actions
561 self._diverge = diverge
566 self._diverge = diverge
562 self._renamedelete = renamedelete
567 self._renamedelete = renamedelete
@@ -914,7 +919,9 b' def manifestmerge('
914 renamedelete = branch_copies1.renamedelete
919 renamedelete = branch_copies1.renamedelete
915 renamedelete.update(branch_copies2.renamedelete)
920 renamedelete.update(branch_copies2.renamedelete)
916
921
917 return mergeresult(actions, diverge, renamedelete, commitinfo)
922 mresult = mergeresult()
923 mresult.updatevalues(actions, diverge, renamedelete, commitinfo)
924 return mresult
918
925
919
926
920 def _resolvetrivial(repo, wctx, mctx, ancestor, actions):
927 def _resolvetrivial(repo, wctx, mctx, ancestor, actions):
@@ -965,6 +972,7 b' def calculateupdates('
965 # Avoid cycle.
972 # Avoid cycle.
966 from . import sparse
973 from . import sparse
967
974
975 mresult = None
968 if len(ancestors) == 1: # default
976 if len(ancestors) == 1: # default
969 mresult = manifestmerge(
977 mresult = manifestmerge(
970 repo,
978 repo,
@@ -1075,7 +1083,8 b' def calculateupdates('
1075 continue
1083 continue
1076 repo.ui.note(_(b'end of auction\n\n'))
1084 repo.ui.note(_(b'end of auction\n\n'))
1077 # TODO: think about commitinfo when bid merge is used
1085 # TODO: think about commitinfo when bid merge is used
1078 mresult = mergeresult(actions, diverge, renamedelete, {})
1086 mresult = mergeresult()
1087 mresult.updatevalues(actions, diverge, renamedelete, {})
1079
1088
1080 if wctx.rev() is None:
1089 if wctx.rev() is None:
1081 fractions = _forgetremoved(wctx, mctx, branchmerge)
1090 fractions = _forgetremoved(wctx, mctx, branchmerge)
General Comments 0
You need to be logged in to leave comments. Login now