cloning subrepos doesnt set default in hgrc
Saint Germain
saintger at gmail.com
Mon Feb 8 17:08:35 CST 2010
On Mon, 8 Feb 2010 16:48:07 +0000 (UTC), Johannes Totz
<jtotz at imperial.ac.uk> 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.
>
Hello,
Your question raises interesting issue that I have overlooked.
Cloning is not a problem, as subrepos are immediatly created at first
commit (and thus creating a working copy).
However when first commiting subrepo, the subrepo .hg/hgrc should be
set to the value present in .hgsub.
I can make a fix to create the subrepo default path depending on the
situation (commit or clone) but what about the .hgsub ?
Cloning a .hgsub with the associated path doesn't make much sense I'm
afraid.
I will continue the discussion on mercurial-devel, as I need the advice
of hg developer before issueing another patch
Regards,
More information about the Mercurial
mailing list