##// END OF EJS Templates
merge: use collections.defaultdict() for mergeresult.commitinfo...
Pulkit Goyal -
r45943:f970cca3 default
parent child Browse files
Show More
@@ -579,7 +579,7 b' class mergeresult(object):'
579 self._filemapping = {}
579 self._filemapping = {}
580 self._diverge = {}
580 self._diverge = {}
581 self._renamedelete = {}
581 self._renamedelete = {}
582 self._commitinfo = {}
582 self._commitinfo = collections.defaultdict(dict)
583 self._actionmapping = collections.defaultdict(dict)
583 self._actionmapping = collections.defaultdict(dict)
584
584
585 def updatevalues(self, diverge, renamedelete, commitinfo):
585 def updatevalues(self, diverge, renamedelete, commitinfo):
@@ -756,7 +756,7 b' def manifestmerge('
756 # information from merge which is needed at commit time
756 # information from merge which is needed at commit time
757 # for example choosing filelog of which parent to commit
757 # for example choosing filelog of which parent to commit
758 # TODO: use specific constants in future for this mapping
758 # TODO: use specific constants in future for this mapping
759 commitinfo = {}
759 commitinfo = collections.defaultdict(dict)
760 if followcopies:
760 if followcopies:
761 branch_copies1, branch_copies2, diverge = copies.mergecopies(
761 branch_copies1, branch_copies2, diverge = copies.mergecopies(
762 repo, wctx, p2, pa
762 repo, wctx, p2, pa
@@ -844,7 +844,7 b' def manifestmerge('
844 b'remote is newer',
844 b'remote is newer',
845 )
845 )
846 if branchmerge:
846 if branchmerge:
847 commitinfo[f] = b'other'
847 commitinfo[f][b'filenode-source'] = b'other'
848 elif nol and n2 == a: # remote only changed 'x'
848 elif nol and n2 == a: # remote only changed 'x'
849 mresult.addfile(
849 mresult.addfile(
850 f,
850 f,
@@ -860,7 +860,7 b' def manifestmerge('
860 b'remote is newer',
860 b'remote is newer',
861 )
861 )
862 if branchmerge:
862 if branchmerge:
863 commitinfo[f] = b'other'
863 commitinfo[f][b'filenode-source'] = b'other'
864 else: # both changed something
864 else: # both changed something
865 mresult.addfile(
865 mresult.addfile(
866 f,
866 f,
@@ -1363,7 +1363,7 b' def applyupdates('
1363 for f, op in pycompat.iteritems(mresult.commitinfo):
1363 for f, op in pycompat.iteritems(mresult.commitinfo):
1364 # the other side of filenode was choosen while merging, store this in
1364 # the other side of filenode was choosen while merging, store this in
1365 # mergestate so that it can be reused on commit
1365 # mergestate so that it can be reused on commit
1366 if op == b'other':
1366 if op[b'filenode-source'] == b'other':
1367 ms.addmergedother(f)
1367 ms.addmergedother(f)
1368
1368
1369 moves = []
1369 moves = []
General Comments 0
You need to be logged in to leave comments. Login now