Mercurial commit with subrepositories in subfolders

471 Views Asked by At

I have file/directory structure:

main/.hg
main/subrepo/.hg
main/subrepo1/.hg

I have .hgignore file with such content

.hg

Finally, I want to make a commit in 'main' repository that will include all files in it, including all files from main/subrepo and main/subrepo1 and excluding folders main/subrepo/.hg and main/subrepo1/.hg (so all files from main folder, excluding .hg folders in it will be commited). But Mercurial skips main/subrepo/* and main/subrepo1/*. It does not include this subfolders/subrepos to commit fully. How can I fix this?

1

There are 1 best solutions below

2
On

I'm going to guess that you have simply created some nested repositories, but not properly linked them as subrepositories.

Make sure that the root of the main repository has a file called .hgsub. You create the file, add the following and then add + commit the file to the main repository:

subrepo = https://path-to-subrepo/
subrepo1 = https://path-to-subrepo1

If the subrepos do not point to some remote server, you would use the local path of course.