Fwd: subrepo: what about making subrepo URLs configurable
JonnyDee
jonny.dee.1 at googlemail.com
Thu May 27 21:33:10 UTC 2010
Hi,
a few months ago I started a discussion about making URLs to subrepos
contained within the .hgsub file configurable. For convenience, I've
copied the content of my posting:
---------- Forwarded message ----------
From: Jonny Dee <jonny.... at gmx.net>
Date: Feb 17, 12:26 am
Subject: subrepo: what about making subrepo URLs configurable
To: mercurial
Hi,
in our company we use Mercurial'ssubrepofeature in many cases and it
is working pretty well. Recently, however, we had to restructure the
directories of our central Mercurial server. Consequently, some URLs
to
our repositories on that server have changed. For instance, theURLto a
repository xyz-framework withURL
ssh://mercurial.company.com/xyz-framework changed to
ssh://mercurial.company.com/libs/xyz-framework. Now the problem is
that
we cannot rollback to a previous version of a project referencing that
xyz-framework anymore, because older revisions reference thesubrepoby
using its oldURLssh://mercurial.company.com/xyz-framework, and
thisURLis no longer valid. In order to get an older state we would
have to
make sure the old URLs can still be used.
I think this issue is not an uncommon one. Eventually, repositories
get
hosted somewhere else (in case of DVCSs this is even more likely) and
then you can practically forget to rollback to an earlier version
easily.
I would prefer something like the following idea to solve this
problem:
An exemplary .hgsub file would look like this:
----- .hgsub -----
src/libs/abc = abc-lib
src/libs/xyz = xyz-framework
------------------
And in the repository's .hg/hgrc file I would configure the actual
mapping fromsubrepoidentifiers (abc-lib and xyz-framework in this
case) to URLs like this:
----- .hg/hgrc -----
[subrepos]
abc-lib = ssh://mercurial.company.com/libs/abc-lib
xyz-framework = ssh://mercurial.company.com/libs/xyz-framework
--------------------
This solution would make the history of your project independent from
the history of your repository hosting infrastructure.
Best regards,
Jonny
---------- End of forwarded message ----------
I am trying to resurrect that discussion again, because our problem is
now even worse. We are able to access our repositories over SSH from
the internet as well as from the intranet. However, we need to use
different URLs, i.e. accessing our repos from outside our company
requires us to use other IPs or DNS names than accessing them from
inside. The problem now is, that automatically cloning the subrepos
either only works from inside or from outside our company. It depends
on which URLs are used within the .hgsub file. Would there be a
possibility to define a mapping (like I suggested in my initial post)
that wouldn't be an issue for us. Maybe URL mappings could also be
defined within the .hgrc / mercurial.ini files. This way one could
define URL mappings once in a central way.
Cheers,
Jonny
More information about the Mercurial
mailing list