Question

I have created a repository that contains a subfolder called 'subrepo'. I then created an .hgsub file with the following contents:

subrepo = https://me@bitbucket.org/me/subrepo-test

When I go to BitBucket and view the source, I see a 'subrepo' folder that, when clicked, takes me to the linked subrepository. I also see the .hgsub file along with the root-level index.php file I created.

My problem is that cloning or downloading the source of the main repository only gets me the index.php file, not the .hgsub file or the subfolder with the contents of the linked subrepository. My understanding is that I should be getting the complete contents. What could I be doing wrong?

Was it helpful?

Solution 2

Ok, so the reason that the original clone wasn't working was because I hadn't properly cloned the subrepo initially, made an update and then committed the change... followed by a commit/push of the parent.

The reason that I am not getting a complete download of source from BitBucket is because the hg archive command (used by BitBucket) does not recursively package up sub-repositories. Adding the --subrepos flag to the command will cause everything to be packaged. I am currently communicating with BitBucket regarding this issue.

OTHER TIPS

The .hgsub controls the revision of the subrepos: no .hgsub, no subrepo. So if your .hgsub isn't being cloned, perhaps you are checking out a revision/head where the .hgsub doesn't exist? Try updating to the revision with the .hgsub, and the corresponding subrepo should be pulled as well.

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