System-level hgrc files (in /etc/mercurial and <install-root>/etc/mercurial) are obviously platform-dependent, but how I can use platform-dependent hgrc on a per user basis?
The use case is to override a system config on a specific platform. For example, we have hg on linux and solaris with different merge tools. How do I override just the solaris merge tool, when hgrc doesn't allow any control logic (like if os.uname()[0] == 'SunOS')?
.<platform>.hgrc files with whatever you want to override in each one.Set an environment variable in your .bashrc:
export PLATFORM=`python -c 'import os; print os.uname()[0],'`
In your ~/.hgrc file, use %include at the end to include the right file:
%include ~/$PLATFORM.hgrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With