Patchwork [1,of,9,V3] configitems: add a new config option to control new filenode functionality

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 28, 2020, 6:29 a.m.
Message ID <a8107f2bdcebc9171d26.1601274553@workspace>
Download mbox | patch
Permalink /patch/47299/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 28, 2020, 6:29 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1600074083 -19800
#      Mon Sep 14 14:31:23 2020 +0530
# Node ID a8107f2bdcebc9171d262764e74ac378e97f3da2
# Parent  f9a3edf2dee4f11117699967c226b882a98957e0
# EXP-Topic merge-newnode-final
configitems: add a new config option to control new filenode functionality

This series is adding functionality where we can force create a new filenode for
some files on a merge-commit. This is meant to represent an explicit choice made
by user and hence distingusing the file in the merged commit with the file in
parent by creating a new filenode instead of using the parent one.

This introduces a experimental config option under which this functionality
will be hidden.

A new testcase is added in tests/test-merge-criss-cross.t to test the new
functionality while making the option does not break other scenarios.

Differential Revision: https://phab.mercurial-scm.org/D9026
Yuya Nishihara - Sept. 28, 2020, 10:54 a.m.
On Mon, 28 Sep 2020 11:59:13 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1600074083 -19800
> #      Mon Sep 14 14:31:23 2020 +0530
> # Node ID a8107f2bdcebc9171d262764e74ac378e97f3da2
> # Parent  f9a3edf2dee4f11117699967c226b882a98957e0
> # EXP-Topic merge-newnode-final
> configitems: add a new config option to control new filenode functionality

Queued, thanks.

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -590,6 +590,11 @@  coreconfigitem(
 coreconfigitem(
     b'experimental', b'maxdeltachainspan', default=-1,
 )
+# tracks files which were undeleted (merge might delete them but we explicitly
+# kept/undeleted them) and creates new filenodes for them
+coreconfigitem(
+    b'experimental', b'merge-track-salvaged', default=False,
+)
 coreconfigitem(
     b'experimental', b'mergetempdirprefix', default=None,
 )
diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -1,3 +1,15 @@ 
+#testcases old newfilenode
+
+#if newfilenode
+Enable the config option
+------------------------
+
+  $ cat >> $HGRCPATH <<EOF
+  > [experimental]
+  > merge-track-salvaged = True
+  > EOF
+#endif
+
 Criss cross merging
 
   $ hg init criss-cross