Problems pulling subrepos defined using relative paths from a web server
Mads Kiilerich
mads at kiilerich.com
Thu May 26 12:50:25 UTC 2011
On 05/26/2011 02:37 PM, Angel Ezquerra wrote:
> 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.
> The contents of the hgweb.config file are:
> [collections]
> \\mercurial\mercurial = \\mercurial\mercurial
That seems strange. AFAIK the right hand side should be URL paths where
backslashes has no use.
> 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).
No, it is not recursive.
> 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.
You can use collections, but with collections you have to enumerate all
the repos you use - including subrepos.
The actual set of subrepos depends on which version you are looking at,
so there is no good way for hgweb to figure out which subrepos it should
serve.
The only good option is probably to use [paths] with ** recursion.
(It would be nice if "hg help hgweb" was more explicit and not only
showed some examples.)
/Mads
More information about the Mercurial
mailing list