Patchwork [01,of,15] commitctx: explicitly pass `manifest` to _commit_manifest

login
register
mail settings
Submitter Pierre-Yves David
Date July 29, 2020, 4:57 p.m.
Message ID <0ff421a458680435f7a3.1596041851@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/46922/
State Accepted
Headers show

Comments

Pierre-Yves David - July 29, 2020, 4:57 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1596030013 -7200
#      Wed Jul 29 15:40:13 2020 +0200
# Node ID 0ff421a458680435f7a39c770cfa5823961cd314
# Parent  13814622b3b1a46308375a9fb4c6641fa495528f
# EXP-Topic files-change
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 0ff421a45868
commitctx: explicitly pass `manifest` to _commit_manifest

As pointed out by Yuya Nishihara.
Pulkit Goyal - July 31, 2020, 11:53 a.m.
On Wed, Jul 29, 2020 at 10:44 PM Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1596030013 -7200
> #      Wed Jul 29 15:40:13 2020 +0200
> # Node ID 0ff421a458680435f7a39c770cfa5823961cd314
> # Parent  13814622b3b1a46308375a9fb4c6641fa495528f
> # EXP-Topic files-change
> # Available At https://foss.heptapod.net/octobus/mercurial-devel/
> #              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 0ff421a45868
> commitctx: explicitly pass `manifest` to _commit_manifest
>
> As pointed out by Yuya Nishihara.

Queued 1 to 5, many thanks!

Patch

diff --git a/mercurial/commit.py b/mercurial/commit.py
--- a/mercurial/commit.py
+++ b/mercurial/commit.py
@@ -206,7 +206,7 @@  def _process_files(tr, ctx, error=False)
     touched.extend(removed)
 
     files = touched
-    mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop)
+    mn = _commit_manifest(tr, linkrev, ctx, mctx, m, files, added, drop)
 
     return mn, files, filesadded, removed
 
@@ -347,7 +347,7 @@  def _filecommit(
     return fnode, touched
 
 
-def _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop):
+def _commit_manifest(tr, linkrev, ctx, mctx, manifest, files, added, drop):
     """make a new manifest entry (or reuse a new one)
 
     given an initialised manifest context and precomputed list of
@@ -370,8 +370,6 @@  def _commit_manifest(tr, linkrev, ctx, m
 
     m1 = m1ctx.read()
 
-    manifest = mctx.read()
-
     if not files:
         # if no "files" actually changed in terms of the changelog,
         # try hard to detect unmodified manifest entry so that the