D9415: copies: fast path no-op merge
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Fri Nov 27 16:11:47 UTC 2020
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
If the two sides of the merge are the same (they come an unaltered common
ancestors) we don't need any merging.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D9415
AFFECTED FILES
mercurial/copies.py
CHANGE DETAILS
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -391,6 +391,9 @@
othercopies = all_copies.get(c)
if othercopies is None:
all_copies[c] = newcopies
+ elif newcopies is othercopies:
+ # nothing to merge:
+ pass
else:
# we are the second parent to work on c, we need to merge our
# work with the other.
To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list