Mercurial/Importing Repositories

From Debuntu

Jump to: navigation, search

Importing a sub-directory to its own repository

Suppose you have a repository called myrepo which contains 2 sub-directories:

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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense