1
votes

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

subrepo = https://[email protected]/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?

2
Can you provide the exact command you're using to clone your repository and maybe the name of it, so we can test also ?krtek
I am running hg clone https://[email protected]/me/parent-repo from the terminal on my Mac.Micah Wood
Run the clone command with the -v option and post the output.Lasse V. Karlsen
@Micah Can you provide the url of your repository so we can test it ?krtek
So here is the actual url (which is now public) for the repository: bitbucket.org/woodent/parent-repo. The latest development is that I am now getting a complete file structure when I clone, but using the 'Get Source' link in BitBucket doesn't get me the entire structure. Is this something that could be a BitBucket issue?Micah Wood

2 Answers

1
votes

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.

0
votes

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.