Patchwork [4,of,5] commit: pass mergestate into `_process_files` instead of re-reading it

login
register
mail settings
Submitter Pulkit Goyal
Date Oct. 13, 2020, 7:33 a.m.
Message ID <104b104df7d9515967b8.1602574410@workspace>
Download mbox | patch
Permalink /patch/47440/
State Accepted
Headers show

Comments

Pulkit Goyal - Oct. 13, 2020, 7:33 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1602315920 -19800
#      Sat Oct 10 13:15:20 2020 +0530
# Node ID 104b104df7d9515967b87135977f434fb3560431
# Parent  236c4ba9f9b8603347026975a4fcb97da75ade8f
# EXP-Topic merge-newnode-final
commit: pass mergestate into `_process_files` instead of re-reading it

Differential Revision: https://phab.mercurial-scm.org/D9193

Patch

diff --git a/mercurial/commit.py b/mercurial/commit.py
--- a/mercurial/commit.py
+++ b/mercurial/commit.py
@@ -131,7 +131,7 @@  def _prepare_files(tr, ctx, error=False,
         mn = p1.manifestnode()
         files = metadata.ChangingFiles()
     else:
-        mn, files = _process_files(tr, ctx, error=error)
+        mn, files = _process_files(tr, ctx, ms, error=error)
 
     if origctx and origctx.manifestnode() == mn:
         origfiles = origctx.files()
@@ -165,7 +165,7 @@  def _get_salvaged(repo, ms, ctx):
     return salvaged
 
 
-def _process_files(tr, ctx, error=False):
+def _process_files(tr, ctx, ms, error=False):
     repo = ctx.repo()
     p1 = ctx.p1()
     p2 = ctx.p2()
@@ -179,7 +179,6 @@  def _process_files(tr, ctx, error=False)
     m = mctx.read()
     m1 = m1ctx.read()
     m2 = m2ctx.read()
-    ms = mergestate.mergestate.read(repo)
 
     files = metadata.ChangingFiles()