views:

51

answers:

1

Hello,

We are developing a closed-source project, versionned with Mercurial. We are using two libraries in our project :

  • One of those libraries is being developed by a third-party. They are using git, and we usually just pull from their repo once in a week to get the latest changes.

  • The other library is being developed by ourselves, and is under active development. It must live in its own public mercurial repository, as it is licensed under LGPL. (It's a fork of a third-party LGPL component, ported to our platform)

So my question is: How should I organize the source to ensure that:

  1. A developer from our team should be able to get all the source (main project + libraries) with a single "clone" command

  2. We should be able to pull easily the latest changes from the libraries, even though one of them is managed by git

Should we use mercurial sub-repos functionnality, with hg-git to access to the library under git? Is it well supported by TortoiseHg and BitBucket? (pros: easy to pull library changes / cons: does it works well?)

Or should we keep only snapshots of the libraries under our project? (thus, when there are new upstream changes in the libraries, we pull them to a separate place, and then copy the whole source to our project? (pros: will work / cons: pain in the ass, especially for the library that is being developed by ourselves, which is subject to a lot of daily changes)

A: 

Yeah, use the subrepo with hg-git. It's easy, well-supported, and effective. Your .hgsubstate file will include pointers to snapshots of the subrepos, and that file is controlled, so at any point in time you'll be able to answer the question: what version of library X was this working against. It's good stuff.

Alternately, you can use a dependency manager like ivy or maven as appropriate for your language, but don't include their libraries in your repo if you can avoid it. Pointers to versions of their code is better and a dependency manager or subrepos are the cleanest ways to do that.

Ry4an