Question

I've got a checkout of a project on my machine to which I've added subrepo. Works fine on that checkout, but when I clone the project in other location it doesn't clone subrepos. .hgsub is pushed to default.

Dir structure is

./projA/            ## - the main project directory
./projA/lib/projB/  ## - the sub-repo project directory

And .hgsub:

lib/projB = [hg]ssh://hg@bitbucket.org/username/projB

Now when I do hg clone ssh://hg@bitbucket.org/username/projA it makes no attempts whatsoever to fetch subrepo. What am I missing?

Was it helpful?

Solution 2

I've kind of found solution. The problem was that .hgsubstate file was not generated. I've manually created one using hashes obtained via hg --debug id -i lib/projB/ thus situation was like:

.hgsubs

lib/projB = [hg]ssh://hg@bitbucket.org/user/projB/

.hgsubstate

1e07729703d0e9447ae174a732bfd3e1cbdd96f4 lib/projB

Interestingly enough, after committing .hgsubstate it did get auto-regenerated.

After that change cloning works as expected, cloning recursively both main repo and subrepo:

hg clone ssh://hg@bitbucket.org/user/projA

destination directory: projA
requesting all changes
adding changesets
adding manifests
adding file changes
added 13 changesets with 24 changes to 10 files
updating to branch default
cloning subrepo lib/projB from ssh://hg@bitbucket.org/user/projB
requesting all changes
adding changesets
adding manifests
adding file changes
added 653 changesets with 3864 changes to 1899 files 

OTHER TIPS

Read "Subrepos" topic from "Mercurial Kick Start Exercises", "Remote Subrepositories" part

Note that we clone the repository to the place where it should be, because just adding the entry in the .hgsub file will not do anything unless there is a repository and the given location.

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