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: {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

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:

bitbucket.schemes = https
bitbucket.prefix =
bitbucket.username = xyz

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

Many thanks!

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.

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!


Please sign in to leave a comment.