We are developing an in-house framework that several projects are going to use.
The idea is to have the entire framework tracked as a mercurial
subrepository of each project’s repository. This resulted in the following
subrepo tree (see thin-shell
repository):
ProjectMaster/
Project/
CommonLib/
FrameworkMaster/
Framework/
CommonLib/
- Does this make any sense to you? Is there a better/simpler way to handle these
dependencies which doesn’t involve subrepositories? - Specifically, does it make sense to have both CommonLib subrepositories?
- If not, would it make sense for Project to use FrameworkMaster/CommonLib? This
could get messy if the dependencies were more complicated. - Where would you open feature branches? On the master? Only in the relevant
subrepository?- If you don’t have feature branches on the master, every time you clone the
repository you end up getting the subrepo state of the last commit, which may put
any subrepo in any random feature branch. Very confusing. - If you have feature branches on the master, you still need a feature branch
in at least one subrepo to avoid having unnamed heads there.
- If you don’t have feature branches on the master, every time you clone the
In general, this solution sounds difficult to work with. Any suggestions?
As per description in the thin-shell repository documentation:
The resulting structure you have described has nested subrepositories that contains ‘real’ code and hence its not the recommended way. As per mercurial documentation, the recommended structure would be as following (I don’t know if /FrameworkMaster/ was included as just place holder for nested subrepositories or it also have ‘real’ code. If /FrameworkMaster/ also has ‘real’ code then it should also be included in following as sibling leaf node):
So, to answer your questions:
The better/simpler way would be to use the thin-shell repository to simplify the complex dependencies.
If both Project and Framework are depending on same version or branch of CommonLib then it doesn’t make sense to have it at both places. But if for some legacy reasons Project and Framework are requiring different version or branch of CommonLib then it does make sense to have CommonLib at both places.
Not sure here what you mean by feature branches. Did you meant to say ‘future’ here?