I am trying to configure my Mercurial repository system to work with multiple subrepos. I basically followed these instructions to set up a client repo with the Mercurial v1.5 client, and I use HgWebDir to host my several projects.
I have an HgWebDir with the following structure:
http://myserver/hg |-- fooproj |-- mylib
where mylib is some collection of a common template library that fooproj should use. The fooproj structure is as follows:
fooproj |-- doc/ | `-- readme |-- src/ | `-- main.cpp |-- .hgignore |-- .hgsub `-- .hgsubstate
And .hgsub looks like this:
src/mylib = http://myserver/hg/mylib
This should work according to my interpretation of the documentation:
The first "nested" is the path to our working directory, and the second is the URL or path to go from.
In addition, the directory structure of the mylib project is as follows:
mylib |-- .hg | |-- 00changelog.i | |-- dirstate | |-- requires | |-- store | | |-- 00changelog.i | | |-- 00manifest.i | | | |-- data | | | | ` magic.hi | | |-- fncache | | `-- undo | |-- undo.branch | `-- undo.dirstate `-- magic.h
So let's say I pull fooproj to my home folder with:
~$ hg clone http:
It touches the directory structure properly and adds the ~/foo/src/mylib folder, which is the local Mercurial repository. Problems arise here: the mylib folder is empty, except for the elements in .hg . Messages from Mercurial:
requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 5 changes to 5 files updating working directory 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
With 2 seconds of research, you can see that src/mylib/.hg/hgrc :
[paths] default = http:
which is completely wrong (trying to pull this repo will give 404 because, well, this url doesn't make any sense).
foo |-- .hg | |-- 00changelog.i | |-- branch | |-- branchheads.cache | |-- dirstate | |-- hgrc | |-- requires | |-- store | | |-- 00changelog.i | | |-- 00manifest.i | | |-- data | | | |-- .hgignore.i | | | |-- .hgsub.i | | | |-- .hgsubstate.i | | | |-- doc | | | | `-- readme.i | | | `-- src | | | `-- main.cpp.i | | |-- fncache | | `-- undo | |-- tags.cache | |-- undo.branch | `-- undo.dirstate |-- .hgignore |-- .hgsub |-- .hgsubstate |-- doc | `-- readme `-- src |-- main.cpp `-- mylib `-- .hg |-- 00changelog.i |-- branch |-- dirstate |-- hgrc |-- requires `-- store
Logically, the default value should be what I specified in .hgsub , or in any way received files from the repository. Of course, changing src/mylib/.hg/hgrc to:
[paths] default = http:
and it works hg pull && hg update works fine. Of course, this is basically the same as not using subrepos in the first place.
None of the Mercurial commands return error codes (except pull from inside src/mylib ), so it clearly believes that it behaves correctly (and maybe only), although this does not seem logical at all.
What am I doing wrong?
The final problem might be that .hgsubstate would look like this:
0000000000000000000000000000000000000000 src/mylib
But I donβt know how to fix it ...