4

I migrated a subversion repository to mercurial. The svn repository contains several projects which are located in different places on my local system. I can't figure out how I'm supposed to work that way. It appears that mercurial expects that I will always want to check out the entire tree into one spot.

Is it possible to check out only a specific subtree?

If not, then I'll need to somehow import parts of my single subversion repository into multiple mercurial repositories. How would I go about doing that (without losing history information from subversion of course).

2

2 Answers 2

2

Mercurial does not support checking out subtrees. The ConvertExtension (included with Mercurial) is used to convert repositories, and can also be used to perform filtering where users, files and directories can be remapped or trimmed. See specifically the --filemap option for including/excluding specific branches from the source repository.

0

As mentioned by Mark, convert extension can do the job as explained on its wiki page, so to convert a subdirectory "subfoo" of a repository "foo" into repository of its own do this:

echo include subfoo > filemap.txt
echo rename subfoo . >> filemap.txt
hg convert --filemap filemap.txt path/to/foo newsubfoo-repo

Another tool that can help you with various repository conversions is reposurgeon.

There is also a brand new narrowng extension to do this thing, but it is not clear yet if it is production ready.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.