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
--- 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)