Load multiple .hgrc files - ie, some with machine-specific settings?

前端 未结 4 1454
北恋
北恋 2021-01-11 15:42

I\'d like to keep two ~/.hgrc files: ~/.hgrc and ~/.hgrc.local – one with \"standard\" settings (eg, username), the other with machine-specific settings (eg, se

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-11 16:44

    I solve this problem for all my "dot files" in a similar way. On login my shell checks a list of files (hgrc, vimrc, ....) and checks if any of them is older than ${that_name}.global or ${that_name}.local. If it is - cat ${that_name}.{global,local} > ${that_name}. Simple and works great so far. While there's a "better" way (using %include) sometimes processing the config files manually has advantages - for example it will work with mercurial pre-1.3.

提交回复
热议问题