Mercurial/Importing Repositories
From Debuntu
Importing a sub-directory to its own repository
Suppose you have a repository called myrepo which contains 2 sub-directories:
- dir1
- dir2
You want to make dir2 managed in its own repository and want to keep the changes/commit related to that directory.
To do this, we can use the convert feature of mercurial. First we need to set up '~/.hgrc with the following to enable the plugin:
[extensions] hgext.convert=
Then, we will create a file map with the following:
$ echo include dir2 > /tmp/filemap $ echo rename dir2 . >> /tmp/filemap $ hg convert --filemap /tmp/filemap /path/to/repo/myrepo /tmp/dir2-repo