From patchwork Fri Nov 27 16:12:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9418: copies: clarify the return of _merge_copies_dict From: phabricator X-Patchwork-Id: 47697 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 27 Nov 2020 16:12:03 +0000 Alphare created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I misused that function twice in the past few days, so lets clarify the API. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9418 AFFECTED FILES mercurial/copies.py CHANGE DETAILS To: Alphare, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -408,8 +408,8 @@ minor, major = othercopies, newcopies else: minor, major = newcopies, othercopies - _merge_copies_dict(minor, major, isancestor, changes) - all_copies[c] = minor + copies = _merge_copies_dict(minor, major, isancestor, changes) + all_copies[c] = copies final_copies = {} for dest, (tt, source) in all_copies[targetrev].items(): @@ -428,6 +428,8 @@ - `ismerged(path)`: callable return True if `path` have been merged in the current revision, + + return the resulting dict (in practice, the "minor" object, updated) """ for dest, value in major.items(): other = minor.get(dest) @@ -461,6 +463,7 @@ minor[dest] = value elif isancestor(other_tt, new_tt): minor[dest] = value + return minor def _revinfo_getter_extra(repo):