commit: pass mergestate into `_process_files` instead of re-reading it
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 10 Oct 2020 13:15:20 +0530
changeset 45707 035302e6bb38
parent 45706 b92887ce8db4
child 45708 60c46cc28bf4
commit: pass mergestate into `_process_files` instead of re-reading it Differential Revision: https://phab.mercurial-scm.org/D9193
mercurial/commit.py
--- a/mercurial/commit.py	Sat Oct 10 13:12:11 2020 +0530
+++ b/mercurial/commit.py	Sat Oct 10 13:15:20 2020 +0530
@@ -131,7 +131,7 @@
         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 @@
     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 @@
     m = mctx.read()
     m1 = m1ctx.read()
     m2 = m2ctx.read()
-    ms = mergestate.mergestate.read(repo)
 
     files = metadata.ChangingFiles()