Patchwork [3,of,9] merge: check new filenode creation config before disabling optimization

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 23, 2020, 8:18 a.m.
Message ID <967306618158321fb936.1600849098@workspace>
Download mbox | patch
Permalink /patch/47249/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 23, 2020, 8:18 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1600074612 -19800
#      Mon Sep 14 14:40:12 2020 +0530
# Node ID 967306618158321fb9367c02fe12d1fe52aacb29
# Parent  2f20d3b618ac474fd9341b86fa4f8e5791b66290
# EXP-Topic merge-newnode
merge: check new filenode creation config before disabling optimization

Let's make sure that the config is also enabled before disabling the `m2-vs-ma`
optimization.

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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -776,7 +776,13 @@  def manifestmerge(
     # - ma is the same as m1 or m2, which we're just going to diff again later
     # - The caller specifically asks for a full diff, which is useful during bid
     #   merge.
-    if pa not in ([wctx, p2] + wctx.parents()) and not forcefulldiff:
+    # - we are tracking salvaged files specifically hence should process all
+    #   files
+    if (
+        pa not in ([wctx, p2] + wctx.parents())
+        and not forcefulldiff
+        and repo.ui.configbool(b'experimental', b'merge-track-salvaged')
+    ):
         # Identify which files are relevant to the merge, so we can limit the
         # total m1-vs-m2 diff to just those files. This has significant
         # performance benefits in large repositories.