subrepo: what about making subrepo URLs configurable

Brendan Cully brendan at kublai.com
Thu Feb 18 13:02:42 CST 2010


On Thursday, 18 February 2010 at 10:51, Kyle Altendorf wrote:
> On Thu, Feb 18, 2010 at 09:58, Steve Losh <steve at stevelosh.com> wrote:
> > Still, I think this should be *possible*, which would mean the URL does need to be version controlled.
> 
> I believe it means that something that selects the appropriate
> repository needs to be versioned.  I believe that this something
> should absolutely NOT be a URL since URLs are far from immutable.
> Anyways, isn't this functionality what I addressed in the second
> section of my message included below?  Why would being a sub-repo
> suddenly mean that the remote copy of that repository will never move?
>  Hg certainly doesn't assume that for a 'normal' repo.
> 
> -kyle

One hack I can think of is to use [paths] to override the subrepo
URLs:

.hgsub
src/libs/foo = http://oldserver/foo

[paths]
http://oldserver/foo = http://newserver/bar

This keeps the versioning properties we have now, but lets you fix URL
changes at the client. It doesn't let you retroactively fix old URLs
centrally -- that would probably need some kind of tags-like override
protocol -- but it's simple and should help.

If it's confusing to put that in [paths], we could create a new
subsection for it.

> > On Thu, Feb 18, 2010 at 00:50, Andreas Axelsson
> > <andreas.axelsson at combination.se> wrote:
> >> Versioning the URLs also gives one the ability to replace a subrepo with another with history.
> >
> > I can see this being useful but I think it has to be achieved without
> > revisioning the URLs as it is unreasonable to expect them to stay the
> > same.  How about I tweak Jonny's example files:
> >
> > ----- .hgsub -----
> > src/libs/abc = abc-lib.v2
> > src/libs/xyz = xyz-framework
> >
> > ----- .hg/hgrc -----
> > [subrepos]
> > abc-lib.default = ssh://mercurial.company.com/libs/abc-lib-v2
> > abc-lib.v1 = ssh://mercurial.company.com/libs/abc-lib-v1
> > abc-lib.v2 = ssh://mercurial.company.com/libs/abc-lib-v2
> > abc-lib.v3 = ssh://mercurial.company.com/libs/abc-lib-v3
> > xyz-framework.default = ssh://mercurial.company.com/libs/xyz-framework
> > xyz-framework.patched =
> > ssh://mercurial.company.com/libs/xyz-framework-patchedByMe
> >
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial


More information about the Mercurial-devel mailing list