External paths for subrepositories
Kastner Masilko, Friedrich
Kastner-Masilko at at.festo.com
Tue May 17 10:14:30 UTC 2011
> From: mercurial-bounces at selenic.com [mailto:mercurial-bounces at selenic.com] On Behalf Of Martin Geisler
>
> Vasiliev Vladimir <vasilievvladimir89 at gmail.com> writes:
> > Another idea, that I see as good decision for this problem, if i set
> > .hgsub as "../shared = ../shared" - then shared repository will be
> > always at the same level, as main repository (like at bitbucket). But
> > when i tried to do this, mercurial returned error: "abort. path
> > contains illegal component: ../shared"
>
> Interesting idea... Mercurial is normally quite careful not to write
> outside of the repository root -- this is a basic security mechanism to
> prevent someone from sending you a changeset that overwrites random
> files on your hard drive.
>
> However, for subrepos it would be great to be able to clone a set of
> related repos like this and have the structure be the same on both
> server and client.
>
> Creating subrepositories outside of the working copy would need to be
> done very carefully, though. Perhaps we could prompt the user when such
> a subrepo need to be created? After it is created, future pulls can be
> done like normal.
We had a similar use-case at work. Basically, the idea was to use a superrepo as versioned "recipe" to bring related repositories into consistent states with just one "hg up".
The attached patch (based on 1.8.3) introduces the new subrepo-type [link] to implement this. You can then have something like "shared = [link][url://path/to/server/repo]../shared" in the .hgsub in order to use the up-level "shared" repo as virtual subrepo "shared" in the superrepository, with [url://path/to/server/repo] being the URL part to pull/clone from.
The patch is certainly far from being perfect, but it allowed us to explore the idea a bit.
regards,
Fritz
Development Software Systems
Festo Gesellschaft m.b.H.
Linzer Strasse 227
Austria - 1140 Wien
Firmenbuch Wien
FN 38435y
Tel: +43(1)91075-198
Fax: +43(1)91075-282
www.festo.at
Der Inhalt dieses E-Mails ist ausschliesslich fuer den bezeichneten Adressaten bestimmt. Jede Form der Kenntnisnahme,
Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieses E-Mails durch unberechtigte Dritte ist unzulaessig. Wir
bitten Sie, sich mit dem Absender des E-Mails in Verbindung zu setzen, falls Sie nicht der Adressat dieses E-Mails sind und das
Material von Ihrem Computer zu loeschen.
This e-mail and any attachments are confidential and intended solely for the addressee. The perusal, publication, copying or
dissemination of the contents of this e-mail by unauthorised third parties is prohibited. If you are not the intended recipient of this
e-mail, please delete it and immediately notify the sender.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hgsource_14305.patch
Type: application/octet-stream
Size: 4242 bytes
Desc: hgsource_14305.patch
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20110517/cddeb5a0/attachment-0002.obj>
More information about the Mercurial
mailing list