开发者

Repository relative paths in Mercurial .hgrc file

I'm trying to create a shared hgrc file with common extensions for Mercurial, so my coworkers can get a consistent experience and find useful tools. Enabling extensions that don't ship with Mercurial, though, is causing issues.

My main repo's hgrc points to a source-controlled, shared .hgrc file:

\Repo.hg\hgrc

%include ..\tools\hg\dev.hgrc

The shared dev.hgrc then enables extensions we keep source-controlled:

\Repo\tools\hg\dev.hgrc

[extensions]
hgshelve=tools\hg\hgshelve\hgshelve.py
fold=tools\hg\hgfo开发者_开发百科ld\fold.py

The problem is those extensions are only found when hg is run from the root Repo directory. Running it from a subdirectory gives errors:

E:\Repo\src>hg
*** failed to import extension hgshelve from tools\hg\hgshelve\hgshelve.py: [Errno 2] No such file or directory
*** failed to import extension fold from tools\hg\hgfold\fold.py: [Errno 2] No such file or directory

I want to refer to the repository's root without relying on anything except the relative path structure.

I've looked in the manual, but don't see any repository relative path options there.


It's not quite what you're looking for, but if your systems are puppet, chef, or package controlled you can easily gin up a package that drops files in /etc/mercurial/hgrc.d/ anything in there is executed for all users on every run. You could put the extension .py files and the hgrc snippets to enable them down there.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜