Subrepository remapping plan

Martin Geisler mg at aragost.com
Fri Jul 23 08:52:54 CDT 2010


Didly <didlybom at gmail.com> writes:

>> On Fri, Jul 23, 2010 at 13:38, Martin Geisler <mg at aragost.com> wrote:
>
> On Fri, Jul 23, 2010 at 1:47 PM, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
>
>>> I've made a wiki page that describes what I'm planning on
>>> implementing for remapping URLs in the .hgsub file:
>>>
>>>  http://mercurial.selenic.com/wiki/SubrepoRemappingPlan
>>>
>>> Please take a look and tell me if you think this will solve your
>>> problems. The plan comes from the company that has hired me to
>>> implement this, and we believe it will solve their problems.
>>
>> - Why do we need the intermediate key "libfoo"? It seems like we
>> could just use the in-repo path to the subrepo to key off of (i.e.
>> the subpaths file or hgrc would have lib/foo =
>> http://hg.company.com/libraries/libfoo). It might change location in
>> the repo, but it wouldn't be hard to add an extra mapping entry (the
>> libfoo is also prone to being renamed at some point).
>
> I believe that the reason for the intermediate key "libfoo" is not
> really stated on the wiki and it is that (at least originally) the
> subpath entries are meant to be used to substitute the beginning of
> the source paths, rather than the full source paths. That is, if your
> hgsub file was:
>
> libfoo = libfoo/my/custom/path/to/libfoo
>
> then setting a subpaths mapping such as:
> libfoo = http://myserver/libfoo
>
> would be equivalent to having the following hgsub file:
>
> libfoo = http://myserver/libfoo/my/custom/path/to/libfoo
>
> Martin, is that right?

I was about to add a section about remapping prefixes only... but I'm
starting to doubt if it is really so sensible. One problem is that if
you have a .hgsub file with

  libs/foo     = libfoo
  libs/fooplus = libfooplus

then you cannot remap 'libfoo' only since it is also a prefix of
'libfooplus'. So I was starting to explain something about only
remapping prefixes that end with a '/', so that you can remap a .hgsub
file containing

  libs/foo = http://server.com/libraries/foo
  libs/bar = http://server.com/libraries/bar
  libs/baz = http://server.com/libraries/baz

with a .hg/hgrc file containing

  [subpaths]
  http://server.com/ = ssh://localhost:1234/

But it suddenly seemed a bit messy to me and I left it out from the
proposal. So now it's just mapping one string to another.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list