[PATCH 0 of 2] The ui.ignore config option, one more time

Isaac Jurado diptongo at gmail.com
Thu Sep 19 14:45:06 CDT 2013


Replying Isaac Jurado:
> This is another attempt to change the behaviour of ui.ignore.*
> configuration option to a more useful one.
>
> The idea is to leave absolute paths as they are, but interpret relative
> paths from the repository root instead of the current working directory.
> Specially since the latter can be emulated with something like:
>
>     [ui]
>     ignore = $PWD/custom-ignore
>

As Matt requested last time this was brought up, I've been quickly
reviewing the behaviour of relative paths in other situations where
external files must be opened in some way.

For all the following cases, absolute paths work fine and
util.expandpath() is used, so the ~ and $ expansions work as expected.
The comments are only for cases where a relative path is used (i.e. the
result of util.expandpath() still being relative):

                     |  relative to     |  documented
  -------------------+------------------+--------------
    %include         |  current config  |  yes
    shell aliases    |  shell rules     |  implied
    command hooks    |  repo root       |  no
    python hooks     |    ????          |  ??
    .hgsub           |  repo root       |  yes
    ui.ignore.*      |  current wd      |  no
    paths.*          |  see NOTE        |  no
    extensions.*     |  current wd      |  no
    merge-tools      |  $PATH lookup    |  yes
    email.method     |  shell rules     |  yes
    auth.{key,cert}  |  current wd      |  no
    web.cacerts      |  repo root       |  no


NOTE: the relative paths in the "[paths]" sections have different
semantics depending on which rc-file are defined:

  .hg/hgrc: relative to the repository root
  the rest (~/.hgrc /etc/...): relative to the user's home directory

I have probably missed some more, I haven't checked the extensions yet.
Please feel free to expand and/or correct the possible mistakes I've
made.

After this small investigation, I'm not sure if the ui.ignore option is
worth fixing.

Regards.

-- 
Isaac Jurado

"The noblest pleasure is the joy of understanding."
                                  Leonardo da Vinci


More information about the Mercurial-devel mailing list