[Updated] D8921: merge: use collections.defaultdict() for mergeresult.commitinfo
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Sat Aug 22 23:33:06 UTC 2020
Closed by commit rHGf970cca30989: merge: use collections.defaultdict() for mergeresult.commitinfo (authored by pulkit).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8921?vs=22393&id=22424
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8921/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8921
AFFECTED FILES
mercurial/merge.py
CHANGE DETAILS
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -579,7 +579,7 @@
self._filemapping = {}
self._diverge = {}
self._renamedelete = {}
- self._commitinfo = {}
+ self._commitinfo = collections.defaultdict(dict)
self._actionmapping = collections.defaultdict(dict)
def updatevalues(self, diverge, renamedelete, commitinfo):
@@ -756,7 +756,7 @@
# information from merge which is needed at commit time
# for example choosing filelog of which parent to commit
# TODO: use specific constants in future for this mapping
- commitinfo = {}
+ commitinfo = collections.defaultdict(dict)
if followcopies:
branch_copies1, branch_copies2, diverge = copies.mergecopies(
repo, wctx, p2, pa
@@ -844,7 +844,7 @@
b'remote is newer',
)
if branchmerge:
- commitinfo[f] = b'other'
+ commitinfo[f][b'filenode-source'] = b'other'
elif nol and n2 == a: # remote only changed 'x'
mresult.addfile(
f,
@@ -860,7 +860,7 @@
b'remote is newer',
)
if branchmerge:
- commitinfo[f] = b'other'
+ commitinfo[f][b'filenode-source'] = b'other'
else: # both changed something
mresult.addfile(
f,
@@ -1363,7 +1363,7 @@
for f, op in pycompat.iteritems(mresult.commitinfo):
# the other side of filenode was choosen while merging, store this in
# mergestate so that it can be reused on commit
- if op == b'other':
+ if op[b'filenode-source'] == b'other':
ms.addmergedother(f)
moves = []
To: pulkit, #hg-reviewers, marmoute, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200822/8236ef63/attachment-0002.html>
More information about the Mercurial-patches
mailing list