[PATCH 0 of 1] Add .hginclude support (like .hgignore, except specifies what to include).

Mitch Frazier mitch at fmr.name
Wed Nov 2 19:58:46 UTC 2005


Eric Hopper wrote:
> On Wed, Nov 02, 2005 at 05:26:59PM +0100, Benoit Boissinot wrote:
>>> and then only add files you want, unfortunately this doesn't work as you
>>> get python exceptions when you try to run may hg commands.
>> That's what i wanted to say, this should work and i think this is the
>> proper way to do it.  If it tracebacks, this is a bug and we should
>> try to fix it.
>>
>> I think it is much simpler to ignore everything and add what we want
>> to track with "hg add" without caring about another config file.
> 
> I agree.  I think having a .hginclude file is an unnecessary
> complication.  I've always hated systems that have 'allow' and 'deny'
> lists and some weird method of combining the two that always seems to
> yield unexpected results in some situation.

I would agree that having two config files is a pain, but just having
.hgignore capability makes certain things more difficult.  If you have a
directory with hundreds of items in it and you only want to include a
few of them its much easier to say "ignore everything except X, Y, and
Z" than it is to say "ignore A, B, C, D, ..., W".  Certainly, patterns
reduce the size of the job but its still more verbose.

My preferred solution would be to eliminate .hgignore and .hginclude and
create an .hgfiles configuration.  Then augment the syntax to allow both
ignore and include specifications.  Perhaps something like:

  ignore:
  syntax: glob
  *.o
  *.ko

  include:
  syntax: glob
  text.ko

or maybe:

  ignore: glob
  *.o
  *.ko
  ignore: glob: *.abc

  include: glob
  text.ko

I did the .hginclude because it was an easier fix :).



More information about the Mercurial mailing list