# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-10-10 07:42:11 # Node ID b92887ce8db42f89ecd56fb09edd622446efdb47 # Parent 61454026fa04fc43ce05475fe5535d124c7a9f9c commit: move salvaged calculation a bit earlier in the function This helps us initialize mergestate before and now we can pass it into `_process_files()` instead of re-reading it there. Differential Revision: https://phab.mercurial-scm.org/D9192 diff --git a/mercurial/commit.py b/mercurial/commit.py --- a/mercurial/commit.py +++ b/mercurial/commit.py @@ -114,6 +114,8 @@ def _prepare_files(tr, ctx, error=False, 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 @@ def _prepare_files(tr, ctx, error=False, 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)