Hgrc cross platform solution?

I am looking for a solution so that one .hgrc for mercurial works in all my working environments (win / lin / mac), as one vimrc to manage all.

This is due to a problem when I have to specify a path for some extensions, for example hg-git:

in the windows:

[extensions]
hggit = E:\hg-git\hggit

on linux / mac:

[extensions]
hggit = ~/hg-git/hggit

For vimrc, we have a solution to distinguish between different platforms, for example

if has('win32')
  ...
endif

Knowing that mercurial hgrc is a barely normal ini file, I wonder if a similar solution exists for the hgrc file.

Or maybe some other solution?

Update

Thank you for mentioning the use of a “custom environment variable instead of hard coding”, which works for the extension path.

, , . , , , http://www.ogre3d.org/docs/OGREDeveloperGuide/index.html, Windows Mac . ?

+3
3

.hgrc :

~/.hgrc
~/.hgrc-windows
~/.hgrc-linux

~/.hgrc :

%include .hgrc-$OS

$OS Windows linux. , , env, ($ USERNAME Windows, Unix ).

+4

, .hgrc ( .hgrc*, Oben Sonne).

Windows, mercurial.ini , 1 . Powershell script.

, , script (, Python), .hgrc mercurial.ini. , / , . script , .

, , , , . script, , script , , , script.

( , ​​).

+3

Why don't you just use a custom environment variable instead of hard-coding paths?

+1
source

All Articles