When does it make sense to use subrepositories?

Lester Caine lester at lsces.co.uk
Sat Apr 20 14:58:06 UTC 2013


Matt Mackall wrote:
> You're right, this statement is a little bit strong for subrepos. There
> are uses of subrepos that I would consider best practice insofar as the
> alternatives are worse.

This particular problem keeps coming up and while I can understand the desire to 
start new projects 'in the approved way', changing the way existing legacy code 
was originally modularized is the thing which keeps breaking this 'new' model.

We have already been told that Mercurial is not suitable for everybody, but in 
many cases the alternatives are equally problematic, and now that I have a few 
years of Mercurial history built on top of the original CVS/SVN history things 
are getting even more complex to manage. Add to that the fact that many of these 
code bases have blindly migrated to git just increases the agro!

The majority of my PHP based projects do not lay themselves easily to a 'flat 
repo' model and as a result the earlier codebase which was individual modules in 
CVS have evolved to a multitude of repos in git. Piling the whole lot back into 
a single repo would make it so large as to be unusable, and the git subrepos do 
now seem to be handling the resultant 'mess' in a manner that does make things 
workable, but these all falls flat when mirroring that back to Hg where I'm now 
having to update each package manually rather than being able to scan a 
'superproject' for repos that have been updated.

The problem as I see it is not one of 'When does it make sense to use 
subrepositories?' but rather how do we manage projects that pull together 
sub-modules from many sources. Some of the packages I'm using are external 
libraries and manually linking to their repo's is just a matter of convenience, 
but where many people are contributing add-on packages to a popular framework, 
having to create folders for each in some master repo is definitely NOT the way 
to handle things! We want to be able to pick and choose which packages we are 
working with in the local versions, rather than having to download everything.

What is perhaps needed is a better higher level management tool? Something that 
would then not need to worry about the format of the history it's pulling together?

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



More information about the Mercurial mailing list