I'm struggling on how to correctly track nested repositories using TortoiseHg.
I have a main repository that tracks my whole project. This project contains several little plugins that are stored inside a plugins/ subdirectory.
I would love to track each plugin independently (committing and pushing to BitBucket for each one of them) while still being able to make a "whole" commit of my project, including the changes made to the plugins and pushing it to an other location (not BitBucket).
What I've done so far is creating a new repo for each of my plugins. I can commit and push them to BitBucket easily. But when I went to commit my "main" repository, TortoiseHg displays an error message saying that abort: path 'mainrepo\\plugins\\plugin1\\plugin1.php' is inside repo 'mainrepo\\plugins\\plugin1'
.
I can see that I'm doing something wrong, but I can't tell what.
I'm using a nightly of both Mercurial and TortoiseHg (ToirtoiseHg version 0.9.3+237-ea50f793bbe4 and Mercurial-1.4.3+225-70dea42c9406) on WinXP. I read that subrepos handling was added to this TortoiseHg build, but, well, I'm not even sure subrepos is the feature I'm supposed to use here.
Update
I've made some progress, but still can't get it to work the way I'd like.
Here is my structure :
-- .hg
-- core
-- app
-- file.php
-- file.css
-- plugins
-- plugin1
-- file1.php
-- plugin2
-- file2.php
I went to app/plugins, and cloned a plugin (named plugin3) from BitBucket here. I then created a .hgsub file at the root and added app/plugins/plugin3 = app/plugins/plugin3
to it.
I was then able to commit my whole directory.
But then I tried to grab the latest version of plugin1 from BitBucket, so I went to app/plugins, deleted the plugin1/ folder and cloned the plugin1 from BitBucket. I then added app/plugins/plugin1 = app/plugins/plugin1
to .hgsub but when I tried to commit it I was greeted with abort: path 'app/plugins/plugin1/file1.php' is inside repo 'app\\plugins\\plugin1'
The problem seems to fire when my subrepo holds the same name as a directory already tracked by Hg in the plugins/ directory.
What am I doing wrong ? Should I add/edit something special in the .hg of my plugins ?
Update
I've finally managed to get it to work the way I want.
I had to "manually" tell Mercurial to remove the plugins/plugin1, plugins/plugin2 directories, commit the change, then clone back the plugin1 and plugin2 from BitBucket, add app/plugins/plugin1 = app/plugins/plugin1
to .hgsub and commit all. It worked.
The important step was committing after having deleted the plugin1/plugin2 folders.