Mercurial subrepos and bitbucket accounts
Question
I have a team set up on bitbucket with multiple users, and I'm using the keyring extension for mercurial. I need to set up a subrepo, and in the .hgsub
file I need to provide the url for the subrepo.
If I use https://bitbucket.org/team/subrepo
then the user needs to authenticate each time they try to pull.
If I use https://userX.bitbucket.org/team/subrepo
then each user will need to authenticate with userX's password.
If I use https://team.bitbucket.org/team/subrepo
then each user will need the team's password.
Is there a way I can set it up so that the authentication can be saved using the keyring extension, but still have separate credentials for each user, without using ssh?
Solution
Yes, you can enter your authentication information into your config file. The documentation for this is here.
In the auth
section of each user's config file you can enter the following details:
[auth]
bb.schemes = http https
bb.prefix = bitbucket.org/team
bb.username = userX
The bb
part is just a tag to group the settings together - you can use what you like and you can have more than one set if you have more than one Mercurial server that you use.
The example settings say that all repositories that start http://bitbucket.org/team
or https://bitbucket.org/team
should use the username of userX
. The keyring extension will take care of the password after that.