简体   繁体   中英

How to rewrite Mercurial pull URL to not point to HOME

I have a Linux server that will be hosting multiple mercurial repositories over SSH. All the repositories lie in the folder HG_HOME/repos, where HG_HOME ist the home directory of the hg user.

The following command for pull works:

ssh://hg@my.server/repos/REPO_NAME

For ease of use, I would however like to use:

ssh://hg@my.server/REPO_NAME

Is this possible? If yes, where do I configure it?

The version used is 4.0

The following is not an exact solution, but the schemes extension (which comes with Mercurial) may be a usable alternative. It allows you to create your own URL schemes, for example:

[extensions]
schemes=
[schemes]
my = ssh://hg@my.server/repos/

This allows you to then use the my URL scheme, eg:

hg pull my://REPO_NAME

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM