Referencing config file path in hgrc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Referencing config file path in hgrc

Marcus Harnisch
Hi all

Is there any way to reference the current config file location from within the config file?
Example: I'd like to maintain a .hgignore file next to my ~/.hgrc. Is there any way to do that without an explicit '~/' prefix? Is it possible to make paths relative to the respective config file they occur in?
Could we get that feature? Not sure how I'd handle this in the context of %included files, though. I'd have to think about that.

Thank you,
Marcus


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: Referencing config file path in hgrc

Gregory Szorc
On Wed, Sep 20, 2017 at 9:49 PM, Marcus Harnisch <[hidden email]> wrote:
Hi all

Is there any way to reference the current config file location from within the config file?

This is not a current feature.
 
Example: I'd like to maintain a .hgignore file next to my ~/.hgrc. Is there any way to do that without an explicit '~/' prefix? Is it possible to make paths relative to the respective config file they occur in?
Could we get that feature? Not sure how I'd handle this in the context of %included files, though. I'd have to think about that.

It might be possible to add this feature. However, it feels a bit brittle and even a bit dangerous from a security perspective. I can see the user value though. The config parser does currently track where each config option/value came from, so it doesn't seem too difficult to implement. The big question is "should we?"

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: Referencing config file path in hgrc

Marcus Harnisch
On Mon, Sep 25, 2017 at 1:01 PM, Gregory Szorc <[hidden email]> wrote:
It might be possible to add this feature. However, it feels a bit brittle and even a bit dangerous from a security perspective.
OTOH, the current way to interpret a relative path is relative to the current working directory of the hg process. Not exactly reassuring. This is something that should perhaps be looked at independently.

I can see the user value though. The config parser does currently track where each config option/value came from, so it doesn't seem too difficult to implement. The big question is "should we?"
Dunno.

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial