开发者

Can I include sub-config files in my mercurial .hgrc?

开发者 https://www.devze.com 2023-01-21 02:41 出处:网络
I want to keep my main .hgrc in revision control, because I have a fair amount of customization it in, but I want to have different a开发者_运维问答uthor names depending on which machine I\'m using (w

I want to keep my main .hgrc in revision control, because I have a fair amount of customization it in, but I want to have different a开发者_运维问答uthor names depending on which machine I'm using (work, home, &c.).

The way I'd do this in a bash script is to source a host-local bash script that is ignored by Mercurial, but I'm not sure how to do this in the config file format Mercurial uses.


You can do this using the not-often-used but been-there-awhile include syntax.

Put your machine specific stuff in your ~/.hgrc and then include a constant-across-all-systems boilerplate config file. Example:

[ui]
username=You <you@somewhere>

%include .hgrc-boilerplate

Track the .hgrc-boilerplate file in revision control.

See the hgrc man page for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消