External paths for subrepositories
Martin Geisler
mg at aragost.com
Mon May 16 17:43:25 UTC 2011
Vasiliev Vladimir <vasilievvladimir89 at gmail.com> writes:
> Hello.
> I use subrepositories and have found them quite inconvenient to track
> changes locally and at bitbucket.org.
>
> Method of setting .hgsub as "Shared = ../Shared" works, but, as i see,
> it is not very good for working (e.g. cloning) local (another example:
> if i want to push to other repos, the copy of subrepository at the
> same level, as main repository, will be updated with changesets, not
> the subrepository itself) I saw at hgrc/subpaths then, but,
> regretfully, they work only with right parts of .hgsub.
>
> It would be great, if they worked with entire path after substitution
> - it is just what i expected. It will make subrepositories much more
> flexible, then now, because regular expression allow to set
>
> In this case, for .hgsub "shared=shared" i would use following subpath
> section for my bitbucket account:
> [subpath]
> https://bitbucket.org/user/repository/shared =
> https://bitbucket.org/user/shared
> Then any problems with local work would end.
For what it's worth, my client would like the same change.
They were the ones who sponsored the original work in this area, and
they've come to the conclussion that remapping the full path is much
easier than remapping the partial path.
> 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.
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/
More information about the Mercurial
mailing list