[Updated] [+ ] D8616: merge: chain copies with existing copies in working copy
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Jun 10 17:54:36 UTC 2020
martinvonz updated this revision to Diff 21605.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8616?vs=21564&id=21605
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8616/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8616
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
@@ -1887,9 +1887,12 @@
)
wantfiledata = updatedirstate and not branchmerge
- copies = {}
+ resulting_copies = {}
if not overwrite:
- copies = _extract_copies(actions, branchmerge)
+ existing_copies = wc.p2copies()
+ existing_copies.update(wc.p1copies())
+ new_copies = _extract_copies(actions, branchmerge)
+ resulting_copies = copies.chain(existing_copies, new_copies)
stats, getfiledata = applyupdates(
repo, actions, wc, p2, overwrite, wantfiledata, labels=labels
@@ -1908,7 +1911,14 @@
if not branchmerge:
repo.dirstate.setbranch(p2.branch())
- for dst, src in copies.items():
+ # This replicates copies.filter() but is modified to work with merges
+ for dst, src in resulting_copies.items():
+ if dst == src:
+ continue
+ if dst not in wc:
+ continue
+ if not (src in wc.p1() or src in wc.p2()):
+ continue
wc[dst].markcopied(src)
# If we're updating to a location, clean up any stale temporary includes
To: martinvonz, #hg-reviewers
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200610/430890b1/attachment-0002.html>
More information about the Mercurial-patches
mailing list