Symlinks to .hg directories

Sébastien Pierre sebastien.pierre at gmail.com
Wed Feb 1 16:40:52 UTC 2017


This is exactly what I was looking for, it worked much better than trying
to use subpaths. Thanks a lot for pointing this out!

2017-01-31 17:03 GMT-05:00 Augie Fackler <lists at durin42.com>:

> On Tue, Jan 31, 2017 at 4:44 PM, Sébastien Pierre
> <sebastien.pierre at gmail.com> wrote:
> > Hi all,
> >
> > I'm trying to find a way to optimize disk space for the following
> situation.
> >
> > I have a LIBS repository that aggregates a dozen of repository from
> > GitHub/BitBucket as subrepositories.
> >
> > LIBS/.hg
> > LIBS/.hgsub
> > LIBS/deps/<SUBMODULE_01>/.hg
> > LIBS/deps/<SUBMODULE_02>/.hg
> > ..
> > LIBS/deps/<SUBMODULE_10>/.hg
> >
> > I have dozens of PROJECT_NN repositories that each include LIBS as a
> > subrepository (each project might use a specific revision of LIBS).
> >
> > The problem is that for each clone of LIBS, Mercurial does a fresh clone
> of
> > each SUBMODULE_NN directly from the provider (eg. GitHub/BitBucket),
> > preventing to use the nice hardlink optimization of local repositories.
> >
> > To work around that, I wrote a simple script that clones the SUBMODULE_NN
> > repositories in ~/.cache/LIBS/deps/<SUBMODULE_NN> and replace each
> > LIBS/deps/<SUBMODULE_01>/.hg in each PROJECT_NN by a symlink to
> > ~/.cache/LIBS/deps/<SUBMODULE_NN>.
> >
> > As you can see, the idea is to have a local centralised place for all the
> > SUBMODULE_NN repositories and re-use their .hg repository by using
> symlinks.
> > However, this does not seem to work well -- I keep running into
> mysterious
> > errors and undefined behaviour.
> >
> > Any suggestions on how do achieve de-duplication without the problems
> > introduced by the shared .hg directory?
>
> Have you tried https://www.mercurial-scm.org/wiki/ShareExtension?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20170201/c5c0d037/attachment.html>


More information about the Mercurial mailing list