[PATCH 1 of 2] subrepo: look for local pull source first
Didly
didlybom at gmail.com
Fri Mar 25 23:56:36 UTC 2011
On Sat, Mar 26, 2011 at 12:18 AM, Martin Geisler <mg at lazybytes.net> wrote:
> 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.
>
>From my own experience using subrepos, I think that the "sub = sub" model is
what most people should use in most cases. However that is not totally clear
(IMHO) when you start using subrepos. The fact that you _have_ to specify a
pull source is in itself confusing and leads you to wonder whether you
should use absolute paths, etc.
It'd be great if rather than using "sub = sub" in your .hgsub file you could
also simply use "sub" (without a source), meaning the same as "sub = sub".
You could then tell people that to add a subrepo they simply must add its
relative path to the .hgsub file and that would be it. Advanced users could
always discover the "advanced" subrepo feature that lets you select a surepo
source on the .hgsub file if they ever needed it.
Angel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20110326/c948f7d4/attachment.html>
More information about the Mercurial-devel
mailing list