Patchwork [1,of,4] contrib: rename sample config files from .hgrc to the correct .rc extension

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 30, 2014, 12:51 p.m.
Message ID <04876a023f7467c87fd9.1409403066@localhost.localdomain>
Download mbox | patch
Permalink /patch/5632/
State Deferred
Headers show

Comments

Mads Kiilerich - Aug. 30, 2014, 12:51 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1409401920 -7200
#      Sat Aug 30 14:32:00 2014 +0200
# Node ID 04876a023f7467c87fd992148bf676be50dfdf57
# Parent  926bc0d3b595caf37c5d70833a347eb43285de2f
contrib: rename sample config files from .hgrc to the correct .rc extension

Calling them by the right name is more convenient.

An alternative would be to expand hg to also look for hgrc.d/*.hgrc .
Matt Mackall - Aug. 30, 2014, 1:11 p.m.
On Sat, 2014-08-30 at 14:51 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1409401920 -7200
> #      Sat Aug 30 14:32:00 2014 +0200
> # Node ID 04876a023f7467c87fd992148bf676be50dfdf57
> # Parent  926bc0d3b595caf37c5d70833a347eb43285de2f
> contrib: rename sample config files from .hgrc to the correct .rc extension

We decided on Friday to kill sample.hgrc. I'd rather not rename
mergetools.
Mads Kiilerich - Aug. 30, 2014, 1:38 p.m.
On 08/30/2014 03:11 PM, Matt Mackall wrote:
> On Sat, 2014-08-30 at 14:51 +0200, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1409401920 -7200
>> #      Sat Aug 30 14:32:00 2014 +0200
>> # Node ID 04876a023f7467c87fd992148bf676be50dfdf57
>> # Parent  926bc0d3b595caf37c5d70833a347eb43285de2f
>> contrib: rename sample config files from .hgrc to the correct .rc extension
> We decided on Friday to kill sample.hgrc. I'd rather not rename
> mergetools.

Do you agree that the intended (and almost only) use of mergetools.hgrc 
is to put it in /etc/mercurial/hgrc.d/mergetools.rc ? So much that it 
would be incorrect packaging if a package provides a Mercurial without 
decent default configuration of default merge tools?

AFAICS there is no simple way to rename files when creating installers 
with setup.py (such as for OS X later in this bomb raid). Is it really 
worth it to create a custom setup.py distutils Command just for renaming 
the file while installing it?

/Mads

Patch

diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec
--- a/contrib/mercurial.spec
+++ b/contrib/mercurial.spec
@@ -47,7 +47,7 @@  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
+install -m 644 contrib/mergetools.rc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -56,7 +56,7 @@  rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,-)
 %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi
 %doc %attr(644,root,root) %{_mandir}/man?/hg*
-%doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
+%doc %attr(644,root,root) contrib/*.svg contrib/sample.rc
 %dir %{_datadir}/zsh/
 %dir %{_datadir}/zsh/site-functions/
 %{_datadir}/zsh/site-functions/_mercurial
diff --git a/contrib/mergetools.hgrc b/contrib/mergetools.rc
rename from contrib/mergetools.hgrc
rename to contrib/mergetools.rc
diff --git a/contrib/sample.hgrc b/contrib/sample.rc
rename from contrib/sample.hgrc
rename to contrib/sample.rc
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,7 @@  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\mergetools.rc; 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')
@@ -135,7 +135,7 @@  procedure ConcatenateFiles();
 var
   MergeConfigs: TArrayOfString;
 begin
-  if LoadStringsFromFile(ExpandConstant('{tmp}\mergetools.hgrc'),MergeConfigs) then begin
+  if LoadStringsFromFile(ExpandConstant('{tmp}\mergetools.rc'),MergeConfigs) then begin
     SaveStringsToFile(ExpandConstant(CurrentFileName),MergeConfigs,True);
   end;
 end;
diff --git a/contrib/wix/contrib.wxs b/contrib/wix/contrib.wxs
--- a/contrib/wix/contrib.wxs
+++ b/contrib/wix/contrib.wxs
@@ -21,7 +21,7 @@ 
           <File Name="hgweb.wsgi" />
           <File Name="logo-droplets.svg" />
           <File Name="mercurial.el" />
-          <File Name="sample.hgrc" />
+          <File Name="sample.rc" />
           <File Name="tcsh_completion" />
           <File Name="tcsh_completion_build.sh" />
           <File Name="xml.rnc" />
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='contrib\mergetools.rc'
                     ReadOnly='yes' KeyPath='yes'/>
             </Component>
             <Component Id='paths.rc' Guid='$(var.paths.rc.guid)' Win64='$(var.IsX64)'>