Problem building repository with subrepositories

Hi guys I've noted that using mercurial repository with subrepository on it gives me an error if I do the follow steps:

1- Make a change in my code, not the subrepository.

2- Push it to the base repository.

3- Try to Build it.

Unexpected error reported from server: Unable to queue a build because Respository : Project is in an error state

The follow error is reported:

Cannot get new changesets for ERx: Running C:\Program Files\TortoiseHg\hg.exe failed with return code -1 and error output abort: error: getaddrinfo failed
(Args were : pull -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 https://dmgarcia:pass@hqsoftwares.codebasehq.com/project/project.hg --config ui.username=Continua)

But if after that I enter in continua repository settings, edit, validate, save it and build it again the build runs fine..

Regards,

Diego Garcia


Do you have a proxy you access the net through? If so then this might help :

http://www.markhneedham.com/blog/2009/05/13/mercurial-pulling-from-behind-a-proxy/

Hi Vincent,

I dont think its related to proxy as I dont have one in my company ....

It seens to be something related to the continua not finding the changeset of the subrepository or mixing the changeset from main repository with the subrepository.

Ah I missed the subrepository bit. I don’t believe we have done anything with subrepositories, so they may not be supported at the moment. Is the path to your subrepo relative to your main repo is it an absolute path. I’ve had had a quick look, they should work, however subrepos with absolute paths probably won’t. We’ll do some testing in this area, we may need to makes some changes, especially with regards to populating the workspace from the repositories.

Yep its relative, here is my .hgsub content Libs = https://hqsoftwares.codebasehq.com/framework/framework.hg

Its very strange because the first time I run the build went fine, after it finish it sucessfully I try to build it again without change anything and that error happen … maybe something is not cleaned up ? or after it build the .hgsubstate has been changed and next build it breaks …

I think that its something related to this …

This looks like a candidate for the cause :

http://stackoverflow.com/questions/5177054/mercurial-workflow-with-subrepositories-and-offline-clones

Hi Diego, 

I set up a mercurial repository and subrepository on codebasehq and did some testing today, but could not get this to fail. 

Check the full error details by opening a command prompt and running 

hg pull -v --debug -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 https://dmgarcia:pass@hqsoftwares.codebasehq.com/project/project.hg --config ui.username=Continua

Also check that the .hg/hgrc file in both the repository and sub repository folders under C:\Temp\ContinuaCI\Rc\a7882681 have the correct server paths e.g. 

[paths]
default = https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg


Can you also ensure that you have the latest version of Tortoise / Mercurial installed?









Hi Dave,

I’ve runned the command in prompt and no error was found, here is the log:

Microsoft Windows [versão 6.1.7601]
Copyright © 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Windows\system32>hg pull -v --debug -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 h
ttps://dmgarcia:@*@hqsoftwares.codebasehq.com/project/project.hg --config ui.user
name=Continua
using https://hqsoftwares.codebasehq.com/project/project.hg
http auth: user dmgarcia, password *********
sending capabilities command
hqsoftwares.codebasehq.com certificate successfully verified
http auth: user dmgarcia, password *********
hqsoftwares.codebasehq.com certificate successfully verified
pulling from https://dmgarcia:
@hqsoftwares.codebasehq.com/project/project.hg
sending heads command
http auth: user dmgarcia, password *********
hqsoftwares.codebasehq.com certificate successfully verified
searching for changes
no changes found
checking for updated bookmarks

C:\Windows\system32>

So after that I’ve looked for the paths and its fine, take a look on it:

path for main project:
[paths]
default = https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg

path for libs project
[paths]
default = https://hqsoftwares.codebasehq.com/framework/framework.hg

The most strange is that in the first time continua do it fine … just the second one that it do the problem.

Maybe the log of the error should be more detailed so we can analise it…

I will try to update my tortoise and mercurial to see if it is something related to this, but I dont think it is.

Regards,
Diego Garcia.

I found that the problem was really happening um hg update that wasnt passing the user and password to the command, so I’ve config my global hg file to pass it and everything works fine.

I think you guys could look at the code and fixit to pass the user and password when performing an update with subrepositories

Thanks for the info, we’ll look into it. I believe we only call update on a local copy of a hg repo and don’t pass the credentials, but I suspect they may be required for subrepos.

Yep I think you are right !

Hi Diego

It looks like we were calling hg update when it was no longer needed (due to recent changes). We also were not specifying --subrepos on the archive command so the subrepos were not getting exported on the agents properly. Hopefully we’ll have a new build ready tomorrow.

Nice news will be waiting for test it again !

Build 1281 is available now with the fix for this issue. Note that only subrepos that use the same credentials as the main repo will work at this time. Handling individual credentials for subrepos is difficult, not something we want to be looking at this close to release.

Just came back to the office, thats nice Vincent thanks.

I dont think this will be a problem now because every external repository (that is not ours) has the login and pass setup inside the .hgsub file so this doesnt seens to be a problem.