Changing existing subrepo mappings from absolute to relative paths

Martin Geisler mg at lazybytes.net
Thu Dec 15 02:27:56 CST 2011


Angel Ezquerra <angel.ezquerra at gmail.com> writes:

> Hi,
>
> I am in the process of changing the subrepo mappings used in one of
> our projects from using absolute paths into using relative paths.
>
> The original .hgsub file looked as follows:
>
> HSPA_MODULES/COMMON = \\mercurial\Mercurial\HSPA\FPGA\COMMON
>
> Note that the actual .hgsub file has more than one subrepo mapping,
> but I've only left one in the example to make this discussion simpler.
>
> I started by chaning the .hgsub file into:
>
> HSPA_MODULES/COMMON = HSPA_MODULES/COMMON
>
> After committing the change on a local clone (let's call it A), I
> tried to create a new local clone (let's call it B). I was hoping that
> mercurial would clone the subrepo from the local clone A. Instead I go
> the message: "cloning subrepo HSPA_MODULES/COMMON from
> \\mercurial\Mercurial\HSPA\FPGA\COMMON".
>
> I was kind of expecting this to happen since the old revisions refer
> to \\mercurial\Mercurial\HSPA\FPGA\COMMON. Nevertheless it would have
> made more sense (IMHO) for mercurial to get the subrepo sources from
> the most recent version of the .hgsub file (or at least try those
> first).
>
> My next attempt was to create an .hg/supaths file with the following
> contents:
>
> [subpaths]
> \\mercurial\Mercurial\HSPA\FPGA\COMMON = HSPA_MODULES/COMMON

Ah, the .hg/subpaths file is not read by normal Mercurial. It was a file
read by an early version of the subpaths extension I put on Bitbucket.
That extension is now called projrc and can set more than just subpaths
settings.

So you need to do the remapping in a config file actually read by
Mercurial -- like the .hg/hgrc file.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial/attachments/20111215/9489f2dc/attachment.pgp>


More information about the Mercurial mailing list