Patchwork [3,of,4] osx: install /etc/mercurial/hgrc.d/mergetools.rc and sample.rc

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

Comments

Mads Kiilerich - Aug. 30, 2014, 12:51 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1409402149 -7200
#      Sat Aug 30 14:35:49 2014 +0200
# Node ID 9fdbd8dc7fd50cc10d3784826e6f7a5b19cff771
# Parent  3fe97f7dc300e16d338efc923f5f66a0bf960b99
osx: install /etc/mercurial/hgrc.d/mergetools.rc and sample.rc

Give a better use experience by default.
Matt Mackall - Aug. 31, 2014, 10:41 a.m.
On Sat, 2014-08-30 at 14:51 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1409402149 -7200
> #      Sat Aug 30 14:35:49 2014 +0200
> # Node ID 9fdbd8dc7fd50cc10d3784826e6f7a5b19cff771
> # Parent  3fe97f7dc300e16d338efc923f5f66a0bf960b99
> osx: install /etc/mercurial/hgrc.d/mergetools.rc and sample.rc
> 
> Give a better use experience by default.

This is a bit problematic in that we don't do this normally when running
setup.py and leave this to 'packagers'. Having people running pip or
whatever start clobbering these files is probably bad.

On the other hand, it's okay for the packages to install these files if
it's appropriate in that environment, because Debian partly
manages /etc. However, they also make an effort to never overwrite these
files if they've been customized, because they're "owned" by the user.
And I suspect setup.py's support for doing that right is negligible?
Augie Fackler - Aug. 31, 2014, 1:36 p.m.
On Aug 31, 2014, at 12:41 PM, Matt Mackall <mpm@selenic.com> wrote:

> On Sat, 2014-08-30 at 14:51 +0200, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1409402149 -7200
>> #      Sat Aug 30 14:35:49 2014 +0200
>> # Node ID 9fdbd8dc7fd50cc10d3784826e6f7a5b19cff771
>> # Parent  3fe97f7dc300e16d338efc923f5f66a0bf960b99
>> osx: install /etc/mercurial/hgrc.d/mergetools.rc and sample.rc
>> 
>> Give a better use experience by default.
> 
> This is a bit problematic in that we don't do this normally when running
> setup.py and leave this to 'packagers'. Having people running pip or
> whatever start clobbering these files is probably bad.
> 
> On the other hand, it's okay for the packages to install these files if
> it's appropriate in that environment, because Debian partly
> manages /etc. However, they also make an effort to never overwrite these
> files if they've been customized, because they're "owned" by the user.
> And I suspect setup.py's support for doing that right is negligible?

I'm going to drop this out of crew for the moment, as it breaks

(cd tests && python run-tests.py test-help.t)

on OS X. But I do think this is something we should endeavor to do for our OS X packages.

> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -495,6 +495,11 @@  for root in ('templates',):
             packagedata['mercurial'].append(f)
 
 datafiles = []
+if sys.platform == 'darwin':
+    datafiles.append(
+        ('/etc/mercurial/hgrc.d', ['contrib/mergetools.rc',
+                                   'contrib/sample.rc']))
+
 setupversion = version
 extra = {}