Problems pulling subrepos defined using relative paths from a web server

Angel Ezquerra angel.ezquerra at gmail.com
Thu May 26 07:37:58 CDT 2011


On Thu, May 26, 2011 at 2:18 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
> On 05/26/2011 02:03 PM, Angel Ezquerra wrote:
>>
>> Hi,
>>
>> I just hit an unexpected problem while using trivially defined
>> subrepos (i.e. of the sort defined with a line such as "subrepo_path =
>> subrepo_path" in the .hgsub file).
>> This problem happens when you try to update to a revision that
>> requires you to pull changes from the subrepo. The problem only
>> happens if you pull from an http source.
>>
>> Let's say that you have a subrepo defined as:
>> include/mysub = include/mysub
>>
>> Let's also say that the pull source for your top repo is
>> http://myserver:8000/myrepo
>>
>> Then you try to update to a revision that requires mercurial to pull
>> new revisions for the subrepo. Mercurial says:
>>
>>    pulling subrepo include\mysub from
>> http://mercurial:8000/myrepo/include/mysub
>>    HTTP Error: 404 (Not Found)
>>    [command returned code 255 Thu May 26 13:05:32 2011]
>
> How has your web server been configured?
>
> Please make sure that you can browse and clone
> http://mercurial:8000/myrepo/include/mysub directly - otherwise it will also
> not work as subrepo.
>
> You might want to use something like
>  [paths]
>  / = **
> in your hgweb config.

[Reposting to mercurial at selecing.com as suggested by Mads]

Thank you Mads,

The contents of the hgweb.config file are:
[collections]
\\mercurial\mercurial = \\mercurial\mercurial

So I'm using collections rather than paths.

The repo http://mercurial:8000/myrepo/include/mysub cannot be accessed.

Supposedly the configuration above should tell hg serve to publish
_any_ folder contained within \\mercurial\mercurial or any of its
folders (recursively). However while it does pickup all mercurial
repos in there (including those that are inside folders), it does not
pickup any subrepos.

I've gone through the Publishing Repositories section of the wiki and
I don't see anything there that might suggest that this is the
expected behavior. If it is then you cannot use collections if you use
subrepos.

Cheers,

Angel


>> In our case the repo in http://mercurial:8000/myrepo is also shared as
>> \\mercurial\mercurial\myrepo. Changing the pull source to
>> "\\mercurial\mercurial\myrepo" and pulling works.
>>
>> So what happened? The include/mysub folder does exist within
>> http://mercurial:8000/myrepo. However the mercurial web server does
>> not publish it!
>> Initially I thought that I had to restart the server for it to pick up
>> the new folder (since this subrepo has been recently created), but
>> that is not the case. Even after a restart hg web does not publish the
>> subrepo. Note that we have configure hg serve to publish all subrepos
>> inside the \\mercurial\mercurial folder.
>>
>> Is there something I'm missing? It seems that this problem is serious
>> enough to make relative subrepo definitions (which is the recommended
>> method to define subrepos) unusable when working with repos published
>> through hg serve!
>>
>> Angel
>>
>> P.S.- I don't know if I should have sent this to mercurial at selenic.com
>> instead. Sorry if this is the wrong mailing list.
>
> Yes, that would have been more appropriate - please make sure to remove
> -devel when you reply to this mail.
>
> /Mads
>


More information about the Mercurial-devel mailing list