Changing existing subrepo mappings from absolute to relative paths

Martin Geisler mg at lazybytes.net
Thu Dec 15 14:28:05 UTC 2011


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

> On Wed, Dec 14, 2011 at 7:03 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> On 12/14/2011 12:48 PM, Angel Ezquerra wrote:
>>>
>>> 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).
>>
>>
>> Was the new .hgsub committed to the tip of the default branch? 'hg clone -u
>> branchname A B' might do the right thing.
>
> Mads,
>
> thank you for your reply. I did not commit the new .hgsub to the tip
> of the default branch. The developers working on that particular repo
> "abandonned" the default branch a while ago, and kept working on
> another branch called "UNIVERSAL" and that is where I changed the
> .hgsub file.
>
> I did a dummy merge with the default branch (since de tip of default
> was an ancestor of the UNIVERSAL branch) and tried again and now the
> clone uses the new .hgsub mappings!
>
> I was not aware of the rule that subrepo mappings are always taken
> from the tip of the default branch. Is that the case?

Hmm, yes and no... The .hgsub file is read from the changeset you're
"dealing" with. So I guess you see it being read from the default branch
since that's what clone updates to by default.

Does it change if you use 'hg clone -b UNIVERSAL' instead?

-- 
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://lists.mercurial-scm.org/pipermail/mercurial/attachments/20111215/42de7484/attachment.asc>


More information about the Mercurial mailing list