changeset 45706:b92887ce8db4

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 10 Oct 2020 13:12:11 +0530
parents 61454026fa04
children 035302e6bb38
files mercurial/commit.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commit.py	Sat Oct 10 12:53:35 2020 +0530
+++ b/mercurial/commit.py	Sat Oct 10 13:12:11 2020 +0530
@@ -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)