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