Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: How to manage common/shared code

Tags:

mercurial

I'm using Mercurial for personal use and am conteplating it for some distributed projects as an alternative to SVN for various reasons.

I'm getting comfortable with using it for self contained projects and can see various options for sharing however I haven't yet found any guidance on managing common libraries to be included in multiple projects in a similar manner to that provided by externals in subversion.

The most obvious shared lump of code is error handling and reporting - we want this to be pretty much the same in all projects (its fairly well evolved). There is also utility code, control libraries and similar that we find better to have as projects built with each solution than to pull in as compiled classes (not least because it ensures they are kept up to date, continuous integration helps us address breaking changes).

Thoughts (I hate open ended questions, but I want to know what, if anything, others are doing).

like image 842
Murph Avatar asked May 06 '09 18:05

Murph


2 Answers

Mercurial 1.3 now includes nested repository support, which can be used to express dependencies. The other option is to let your build system handle the download and tracking of dependencies using something like ivy or maven though those are more focused on pulling down compiled code.

like image 85
Ry4an Brase Avatar answered Sep 23 '22 15:09

Ry4an Brase


The world has changed since I asked that question and the solution I now use is different.

The simple answer is now to use packages (specifically NuGet as I do .NET) to deliver the common code instead of nesting repos and including the projects in a solution.

So I have common code built into NuGet packages by and hosted using TeamCity and where previously I would have an external and include the project/source I would now just reference the package.

like image 34
Murph Avatar answered Sep 21 '22 15:09

Murph