Multi-user access for Mercurial sub-repositories
-
24-06-2021 - |
Question
What is the right way to organize ssh access to sub-repositories in mercurial? Consider the following situation:
master
|--.hgsub
|--slave1
|--slave2
And .hgsub:
slave1 = ssh://user@host://var/local/repos/slave1
slave1 = ssh://user@host://var/local/repos/slave2
The problem is that .hgsub
is the part of the repository thus it is not possible (or is it?) to store various usernames in the ssh addresses of the repos. And I really want to avoid using a "global" user to access the repositories just because of this.
Solution
You have basically two choices:
- If your subrepositories live in the same server as the container, use relative paths. This is the most convenient solution.
- Otherwise, you can have each user define a subpath rule. Look for the subpath word in this document.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow