A thought on subrepos

Johannes Totz jtotz at imperial.ac.uk
Thu Apr 14 20:03:56 CDT 2011


On 14/04/2011 22:07, Matt Mackall wrote:
> On Thu, 2011-04-14 at 22:41 +0200, Patrick Mézard wrote:
>> Le 14/04/11 22:00, Matt Mackall a écrit :
>>> It seems many projects with subrepos are structured like:
>>>
>>> app/ <- main repo
>>>  lib/ <- a subrepo
>>>
>>> This is perhaps the most obvious way to do things, but is not really
>>> ideal. A better way is:
>>>
>>> build/ <- main repo
>>>  app/ <- subrepo
>>>  lib/ <- subrepo
>>>
>>> For starters, this does away with most of the "I didn't mean to
>>> recursively commit" issues as commits at the top-level will be much less
>>> common.
>>
>> Why? Am I supposed to work in app/ in this model or ?
> 
> Generally, you'll either want to commit in app/ or lib/, and only in
> build/ when you've got "synchronization points" - dependencies between
> app and lib, releases, etc.

This is exactly how I've been doing things for a few years now (even
before switching to HG). Works quite smooth.
The idea is that main-repo only glues the sub-repos together and does
not itself contain code.
It also means that you can reuse lib-repo in various other projects
without coupling it into main-repo.



More information about the Mercurial-devel mailing list