3

Lay of the land (simplified):

I own repo/project Fuzzy. Fuzzy depends on a different project, Zazzy (let's say its a library of some sorts). Both are mercurial repositories. The directory tree would look along the lines of:

-+- Fuzzy /* root repo */
  \
   +- something_fuzzy_related.c
   |
   +- Zazzy /* that other repo */
    \
     +- a_rather_zazzy_library.so

Now, let's say some poor soul decided to checkout my Fuzzy project. He or she will not automatically checkout Zazzy.

How can I make it so? How does this kind of problem get tackled in large projects? Do I have to use a custom script (I have no problem with that) to handle the checkouts (many projects out there have these weird scripts they use to update sources, think Chromium, WebKit)?

ntl0ve
  • 1,896
  • 3
  • 19
  • 25

2 Answers2

3

People sometimes use subrepositories to handle this.

Beware that they have some sharp edges and that we don't recommend putting the Zazzy project inside the Fuzzy project. This is because it create a very tight coupling between the two projects. This can be appropriate if the outer repository (Fuzzy) really depend on the exact changesets in Zazzy.

However, it's normally a bad practice to couple different components too strongly. There are dedicated tools for managing dependencies: in the Java world, Maven is very popular for this. I'm not aware of something as widely used for for C projects, though you can always use a package system (RPM, APT, ...) to handle this if you end up with a lot of complicated dependencies.

Community
  • 1
  • 1
Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
2

You should explore Mercurial subrepos. They are exactly for this purpose.

taimur
  • 103
  • 8