[PATCH 1 of 2] subrepo: look for local pull source first

Martin Geisler mg at lazybytes.net
Fri Mar 25 18:18:54 CDT 2011

Didly <didlybom at gmail.com> writes:

> When I started using suprepos the most surprising thing for me was
> that the pull source for the subrepos was not the default pull source
> specified in the subrepo .hgrc file, but instead that it was set in
> stone in the .hgsub file.

Well the .hgsub file also gives you some flexibility to move things
around: if you change servers, then you update the .hgsub file
accordingly to enable new clones.

> The result of this (weird, IMHO) design is that as you just said
> pulling from within a subrepo my use a completely different source
> that would be use when pulling that same subrepository through a pull
> operation on its parent repository! This is I think a big gotcha of
> the current suprepo implementation.
> I always wondered why isn't it possible have an .hgsub file in which
> no pull source is set. In that case mercurial could do what Martin is
> suggesting, i.e. use the subrepo default pull source.

It is sort of possible: use trivial paths of the 'sub = sub' form. That
makes Mercurial pull from the repository in-place.

You are right that my patch will make it try that first, and then
fallback on the URL in the .hgsub file -- that way you can make the
initial clone where you might have to rely on 'sub = ../sub' style
paths, and then you can make further clones from that local clone.

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-devel/attachments/20110326/17844b74/attachment.pgp>

More information about the Mercurial-devel mailing list