Question

This is (i'm guessing) a not too-too rare occurrence, but how do people deal with common links in subrepos? It may just be one of the things thats why subdirs are a pain in the butt to use.

 Subrepo A has a subrepo B at rev 5
 Subrepo C has a subrepo B at rev 10
 Subrepo D has A and C. There is now a conflict between the Bs in some build systems.

So you get the dependency structure:

  D___A__B
   \__C__/

Even if you managed to get A and C pointed at the same revision, there is still two copies of the code that make a conflict.

What would probably be better is to say "A requires B at rev 5." and "C requires B at rev 10." and "D requires A at ref X" and "D requires B at ref X" and "A is here, B is here, C is here, D is here, FIND THE CONFLICTS" but i don't think that is currently possible.

Was it helpful?

Solution

You don't deal with it, this is instead a not-too often case.

First of all, it is greatly discouraged to have a sub-repo outside the directory, and that setup requires at least one outside sub-repo.

Second, even if you setup an outside repo, it is even less recommended to have more than one repo holding the reference to a single repo.

So yes, it is possible, but getting in that state is already hard to do, and if someone actually came to me with this, I'd tell him that he should rethink his configuration. There is a bad smell here anyway, and it is not mercurial's job to handle this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top