einpoklum
einpoklum

Reputation: 131405

Can a mercurial subrepository be a subfolder of another repository?

My repository A depends on repository B, so I intend to add B to A as a subrepo. But in fact, A doesn't depend on all of B, just, say on the contents of a subfolder bar/ in the root of the B repository.

Is it possible to indicate that just the subfolder constitutes the subrepo?

Note: This is essentially the same question as

Git Submodule to a subfolder

but for mercurial rather than git.

Upvotes: 0

Views: 372

Answers (1)

planetmaker
planetmaker

Reputation: 6044

The same answer holds true for mercurial: You cannot make a checkout which contains only part of a repository.

If you need only part of a repository, you can consider the same approach and move the part which is of wider interest (e.g. a library) into a separate repository which henceforth can be referenced as sub-repo by several proejcts. However you should consider whether you really want it an official sub-repository or if you simply link it (without making it an official sub-repository); you could also split-out that library part into a separate repo and regularily simply pull that into the repositories which shall make use of it (which is a duplication of sorts, but avoids the sub-repo approach).

Upvotes: 1

Related Questions