From patchwork Sat Oct 10 08:41:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9192: commit: move salvaged calculation a bit earlier in the function From: phabricator X-Patchwork-Id: 47429 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 10 Oct 2020 08:41:06 +0000 pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This helps us initialize mergestate before and now we can pass it into `_process_files()` instead of re-reading it there. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9192 AFFECTED FILES mercurial/commit.py CHANGE DETAILS To: pulkit, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/commit.py b/mercurial/commit.py --- a/mercurial/commit.py +++ b/mercurial/commit.py @@ -114,6 +114,8 @@ p1 = ctx.p1() writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) + ms = mergestate.mergestate.read(repo) + salvaged = _get_salvaged(repo, ms, ctx) if ctx.manifestnode(): # reuse an existing manifest revision @@ -140,8 +142,6 @@ files.update_copies_from_p1(ctx.p1copies()) files.update_copies_from_p2(ctx.p2copies()) - ms = mergestate.mergestate.read(repo) - salvaged = _get_salvaged(ctx.repo(), ms, ctx) for s in salvaged: files.mark_salvaged(s)