[PATCH] sburepo: change default path in hgrc of subrepo after cloning

Johannes Totz jtotz at imperial.ac.uk
Tue Feb 9 08:29:49 CST 2010


Saint Germain wrote:

> Hello,
>
> Apologies: with my previous patch
> (http://hg.intevation.org/mercurial/crew/rev/e1401c74572f) on subrepo
> default path, it seems that I've introduced a regression.
>
> Indeed when committing a new subrepo, its default path should be
> automatically set to the value referenced in .hgsub.

I don't think that commit should modify a subrepo's hgrc. Only when
cloning a master-repo the new clone's hgrc should get a default-path,
that is both the cloned master-repo and the subrepos inside it.

> My new patch solves the problem.
>
> However it raises one interesting issue. In case of a clone repository,
> we have a discrepancy between .hgsub and the default path.
>
> For instance, if we have in /tmp/main/.hgsub:
> nested = /tmp/nested
>
> We should have in /tmp/main/nested/.hg/hgrc:
> [default]
> path = /tmp/nested

This should not get set automatically!

> If we clone main2 from main, we should have for
> /tmp/main2/nested/.hg/hgrc:
> [default]
> path = /tmp/main/nested

It should be /tmp/nested because that is the path that would have been
used to clone it from (it's in .hgsub).

> But what about /tmp/main2/.hgsub ?!??
> The most 'logical' thing would be to set it to:
> nested = /tmp/main/nested

.hgsub should follow the existing behaviour, i.e. leave it as is. If
main/.hgsub says /tmp/nested then main2/.hgsub should be the same.

> But I'm not allowed to modify .hgsub because it is version controlled !
>
> What would be the correct behavior then ?





More information about the Mercurial-devel mailing list