cloning subrepos doesnt set default in hgrc
Johannes Totz
jtotz at imperial.ac.uk
Mon Feb 8 10:48:07 CST 2010
Saint Germain wrote:
>
> On Fri, 5 Feb 2010 23:37:02 +0100, Saint Germain <saintger at gmail.com>
> wrote :
>> > >> >>> Cloning a repo that has subrepos does not set the default
>> > >> >>> path inside the subrepo's hgrc.
>> > >> >>> It would be nice if it did though! E.g. set its value to what
>> > >> >>> is specified in .hgsub as its URL.
>> > >> >>>
>> > >> >>> Is there any reason why this might be a bad idea?
>> > >> >>
>> > >> >> Nope. Try this:
>> > >> >>
>> > [snip]
>> > >>
>> > >> That particular feature of 1.4.2 doesn't work for me though. A
>> > >> default-path entry is added in the subrepo's hgrc but it's empty.
>> > >> I've tried various combinations of relative and absolute paths
>> > >> in .hgsub but that didn't change anything...
>> > >>
>> > [snip]
>> > > However instead of putting the default path to the URL present
>> > > in master repository .hgsub, it seems for me more logic to put the
>> > > path to the subrepos of the master directory from which it has
>> > > been cloned.
>> >
>> > What I was hoping for is that if .hgsub has absolute URLs then these
>> > should end up in the subrepos default path. If .hgsub has relative
>> > paths then the default path in the subrepo should be a combination
>> > of the path to the master repo + relative path in .hgsub
>> > (potentially mangled/normalised).
>> >
>> > Does that make sense? I imagine that if the above would work then
>> > that would ease working with the subrepos as I can push/pull for
>> > each one more easily (i.e. master repo is only glue that keeps
>> > subrepo in place). Of course I can add that path by hand but that
>> > gets tedious if I have many clones.
>> >
>>
>> Hummm even in case of absolute URLs in .hgsub, I think that the
>> logical behavior would be to have master repo + path to working
>> subrepo in .hgsub.
>>
>> Indeed without subrepo, if a standard repo 'main1' is cloned from an
>> absolute URL and we clone this 'main1' to 'main2', what is inside hgrc
>> default path ? The path to main1 and to the absolute URL.
>>
>> What do you think ?
>> After this discussion I will propose a patch, hopefuly it will be
>> included in the next version planned on 2009/03/01 !
>>
>> Regards,
>
> Well it seems that we are close to a freeze for next mercurial version.
> So I proposed a patch:
> http://mercurial.selenic.com/bts/issue2026
Will this still work if there is no working copy for the master-repo
(and hence none for the subrepos)? Lets say the repo to clone from lives
on a server but has no working copy (only the stuff in .hg/*).
Otherwise, yeah, your proposal makes more sense! The subrepos should
simply have the URL where they have been cloned from as their
default-path.
More information about the Mercurial
mailing list