Problems pulling subrepos defined using relative paths from a web server

Angel Ezquerra angel.ezquerra at gmail.com
Thu May 26 13:29:07 UTC 2011


On Thu, May 26, 2011 at 3:14 PM, Angel Ezquerra
<angel.ezquerra at gmail.com> wrote:
> On Thu, May 26, 2011 at 2:50 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> 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.
>
> The example in http://mercurial.selenic.com/wiki/PublishingRepositories is:
>
> [collections]
> /home/user = /home/user
>
> I think our configuration is equivalent.
>
>>> 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.
>
> Actually it is recursive. It just seems to not recurse into
> subfolders. This is (part of) the list of repositories that I get when
> I access the main server page (at http://mercurial:8000):
>
> CORE/SDKs/Core_Services_SDK     Repository on Mercurial
> CORE/TOOLS/CfgBootLdr   Repository on Mercurial
> CORE/TOOLS/RebootMCH    Repository on Mercurial
> DRIVERS/SWC_Platform_Drivers    Repository on Mercurial
> HSPA/3G_DRV/3GDrv       Repository on Mercurial
>
> As you can see there are repos in several different folders at several
> different depths.
>
>
>>> 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.
>
> That does not seem to be the case as I've shown above.
>
>> 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.
>
> I will give that a try, thanks.
>

I gave this a try, using the following configuration on the hgweb.config file:

[paths]
/ = \\mercurial\mercurial\**

I see the same list of repositories, but none of the subrepositories.

However when I tried accessing the subrepo directly, it worked!
Confused, I reverted the hgweb.config file to use collections and sure
enough now I can access the subrepo as well.

So now I am doubly confused. This does not make any sense.

Angel



More information about the Mercurial mailing list