TC 6.0.3 and Mercurial Subrepo's

Greetings all,
I have product/solution that uses a sub-repo from mercurial but before the pulling, mercurial requires you enter a username/password twice, once for the main repo and many more times for the sub-repos. TC chokes up and doesn't know to enter the login information a second time. Now I've read that one solution is to add a second VCS root with checkout rule to pull the sub repo over to the build folder and a build step but I would have to remove the .hgsub file. I would like to it work both ways where the developer can pull a main repo and get all the subs and have TC pull the main and get all the subs.

Any ideas and anyone a mercurial buff that knows how to chain the password prompt in mercurial to use the first login credentials entered.

Thanks.

9 comments
Comment actions Permalink

I would suggest to specify these credentials in external hgrc config.
Note that in case of agent-side checkout it should be done at each involved build agent.

We have TW-15591 issue for this problem, you can watch for updates.

Thanks
Michael

0
Comment actions Permalink

Hey Michael,
I'm still having trouble getting TC to use the authentication file. I have the TC Build Agent Service set to logon with an admin account and remotely connected to the server using that admin account, I placed a .hgrc file into the account's folder C:\Documents and Settings\<User>\.hgrc. I'm able to open a command prompt and successfully clone a mercurial repository without entering credentials: hg clone http://address.com/hg/product product, so the .hgrc file is working but when TC build runs, i still get "Authorization Required". Also in the TC VCS settings I removed the credentials as they shouldnt be needed but even with them in it still fails.

Have any ideas?

PS. The server is Windows 2003 Server and I have updated to TC 6.5.1.

Thanks,
Adam

0
Comment actions Permalink

It sounds strange.
Try to add a command-line build step with hg showconfig command. It will show whether the agent actually access these settings.

Michael

0
Comment actions Permalink

Hey Michael,
From adding a command line to the build on a test project (doesn't work on original project since it can not get pass the VCS part) I get in the full log...

[13:43:55]: [Step 2/2] "hg" is not present in directory D:\build\TestProject
[13:43:55]: [Step 2/2] Starting: C:\WINDOWS\system32\cmd.exe /c hg showconfig
[13:43:55]: [Step 2/2] in directory: D:\build\TestProject
[13:43:55]: [Step 2/2] auth.builduser.prefix=server.companyname.com/hg/
[13:43:55]: [Step 2/2] auth.builduser.username=<username is here>
[13:43:55]: [Step 2/2] auth.builduser.password=<password is here>
[13:43:55]: [Step 2/2] auth.builduser.schemes=http https
[13:43:55]: [Step 2/2] merge-tools.kdiff3.args=--auto --L1 base --L2 local --L3 other $base $local $other -o $output
...
This works no different then opening a command prompt on the server, however the VCS seems to be executing hg commands in a differen't command environment?

Thanks,
Adam

0
Comment actions Permalink

Sorry for late response.

Do you have authorization errors in TeamCity UI or during the build?
Is checkout mode changed to "automatically on agent"?

0
Comment actions Permalink

Adam, does it work if you specify the credentials in the global config file as opposed to the user specific one? (just to rule out any other weirdness)

<install-dir>\Mercurial.ini

0
Comment actions Permalink

Hey Michael,
I get authorization errors during the build. For the VCS configuration the username and password is cleared so the credentials should be coming from the mercurial.ini file. I do have "automatically on agent" selected. James post below works.

0
Comment actions Permalink

Hi James,
It does work when I create a mercurial.ini with [auth] section and place that file into the mercurial program files folder. Don't know why user account is not working.
But this can be good enough solution for now.

Thanks!

0
Comment actions Permalink

Thank you for sharing the solution!

0

Please sign in to leave a comment.