Authentication with mercurial and subrepositories

How are folks configuring TeamCity in order to work from a Mercurial repository that includes subrepositories (as configured in the .hgsub file?).

If I run hg clone from the command line, I get prompted for a password once, and all is good. But the initial checkout when run via TeamCity fails with

VCS root: mercurial: https://bitbucket.org/developerfusion/xyz {instance id=23, parent id=1}, due to error: 'cmd /c hg update -C -r 4a08f587bb1f' command failed. stderr: abort: http authorization required  stdout: pulling subrepo src\Common.Library from https://bitbucket.org/xyz/common.library


I've enabled the mercurial_keyring extension in order to save these credentials (so when TeamCity provides authentication details for the root repository, it remembers them for the subrepositories). I've added an [auth] section to mercurial.ini too:

[auth]
bitbucket.schemes = https
bitbucket.prefix = https://bitbucket.org/xyz
bitbucket.username = xyz



What am I missing, or am I going about this in completely the wrong way?

Many thanks!

James
2 comments
Comment actions Permalink

You can specify authentication settings for all related repositories in external %HOME%\mercurial.ini file.
It should be done on all build agents though.

0
Comment actions Permalink

Yeah, thanks Michael - it turns out mercurial_keyring doesn't seem to work from TeamCity. Specifying the password in plain text isn't ideal but does work!

0

Please sign in to leave a comment.