Patchwork [2,of,2] config: move mergetools configuration to default configuration

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 16, 2014, 4:56 p.m.
Message ID <7ca9c45848200a39f8b6.1413478612@ssl.google-analytics.com>
Download mbox | patch
Permalink /patch/6332/
State Changes Requested
Headers show

Comments

Mads Kiilerich - Oct. 16, 2014, 4:56 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1413478601 -7200
#      Thu Oct 16 18:56:41 2014 +0200
# Node ID 7ca9c45848200a39f8b6e4d6d083efee48993f6e
# Parent  356c4ef428690d95cf0d98240ff76494ff25efb3
config: move mergetools configuration to default configuration

The merge tool configuration is an essential part of a good initial user
experience.

The installer fixes have been done blindly and might require additional
changes.
Matt Mackall - Oct. 18, 2014, 10:37 p.m.
On Thu, 2014-10-16 at 18:56 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1413478601 -7200
> #      Thu Oct 16 18:56:41 2014 +0200
> # Node ID 7ca9c45848200a39f8b6e4d6d083efee48993f6e
> # Parent  356c4ef428690d95cf0d98240ff76494ff25efb3
> config: move mergetools configuration to default configuration
> 
> The merge tool configuration is an essential part of a good initial user
> experience.
> 
> The installer fixes have been done blindly and might require additional
> changes.

Not clear how this patch works, as neither this patch nor the previous
one actually touch contrib/mergetools.hgrc, or create default-hgrc.d.
Mads Kiilerich - Oct. 19, 2014, 1:16 a.m.
On 10/19/2014 12:37 AM, Matt Mackall wrote:
> On Thu, 2014-10-16 at 18:56 +0200, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1413478601 -7200
>> #      Thu Oct 16 18:56:41 2014 +0200
>> # Node ID 7ca9c45848200a39f8b6e4d6d083efee48993f6e
>> # Parent  356c4ef428690d95cf0d98240ff76494ff25efb3
>> config: move mergetools configuration to default configuration
>>
>> The merge tool configuration is an essential part of a good initial user
>> experience.
>>
>> The installer fixes have been done blindly and might require additional
>> changes.
> Not clear how this patch works, as neither this patch nor the previous
> one actually touch contrib/mergetools.hgrc, or create default-hgrc.d.

It did:

diff --git a/contrib/mergetools.hgrc 
b/mercurial/default-hgrc.d/mergetools.rc
rename from contrib/mergetools.hgrc
rename to mercurial/default-hgrc.d/mergetools.rc

/Mads

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -1,4 +1,5 @@ 
 #!/bin/bash -e
+set -x
 
 BUILDDIR=$(dirname $0)
 ROOTDIR=$(cd $BUILDDIR/..; pwd)
diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec
--- a/contrib/mercurial.spec
+++ b/contrib/mercurial.spec
@@ -126,7 +126,6 @@  install -m 644 contrib/mercurial.el $RPM
 install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/
 
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
-install -m 644 contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -149,7 +148,6 @@  rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh
 %dir %{_sysconfdir}/mercurial
 %dir %{_sysconfdir}/mercurial/hgrc.d
-%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
 %if "%{?withpython}"
 %{_bindir}/%{pythonhg}
 %{hgpyprefix}
diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
--- a/contrib/win32/mercurial.iss
+++ b/contrib/win32/mercurial.iss
@@ -67,7 +67,6 @@  Source: contrib\mq.el; DestDir: {app}/Co
 Source: contrib\hgweb.fcgi; DestDir: {app}/Contrib
 Source: contrib\hgweb.wsgi; DestDir: {app}/Contrib
 Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme
-Source: contrib\mergetools.hgrc; DestDir: {tmp};
 Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
@@ -86,6 +85,7 @@  Source: dist\cacert.pem; Destdir: {app}
 Source: doc\*.html; DestDir: {app}\Docs
 Source: doc\style.css; DestDir: {app}\Docs
 Source: mercurial\help\*.txt; DestDir: {app}\help
+Source: mercurial\default-hgrc.d\*.rc; DestDir: {app}\default-hgrc.d
 Source: mercurial\locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs skipifsourcedoesntexist
 Source: mercurial\templates\*.*; DestDir: {app}\Templates; Flags: recursesubdirs createallsubdirs
 Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt
diff --git a/contrib/wix/mercurial.wxs b/contrib/wix/mercurial.wxs
--- a/contrib/wix/mercurial.wxs
+++ b/contrib/wix/mercurial.wxs
@@ -79,7 +79,7 @@ 
                     ReadOnly='yes' KeyPath='yes'/>
             </Component>
             <Component Id='mergetools.rc' Guid='$(var.mergetools.rc.guid)' Win64='$(var.IsX64)'>
-              <File Id='mergetools.rc' Name='MergeTools.rc' Source='contrib\mergetools.hgrc'
+              <File Id='mergetools.rc' Name='MergeTools.rc' Source='mercurial\default-hgrc.d\mergetools.rc'
                     ReadOnly='yes' KeyPath='yes'/>
             </Component>
             <Component Id='paths.rc' Guid='$(var.paths.rc.guid)' Win64='$(var.IsX64)'>
diff --git a/contrib/mergetools.hgrc b/mercurial/default-hgrc.d/mergetools.rc
rename from contrib/mergetools.hgrc
rename to mercurial/default-hgrc.d/mergetools.rc
diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -88,3 +88,7 @@  Test exit code when no config matches
 
   $ hg config Section.idontexist
   [1]
+
+Default configuration
+
+  $ hg showconfig merge-tools | grep meld