I would like to import the source code from a Subversion repository to Mercurial. Using Hg Subversion I imported it. The problem is, the layout of the SVN repo is the default one - with trunk
directory, branches at the branches
directory etc. - today, but it was not so before. Some time ago, all directories of the project were a the root repository, so Hg Subversion could not convert the branches
directory to Mercurial branches and the new Mercurial repository just contains the directories branches
and trunk
.
I converted the branches directories into Mercurial branches the "hard way":
b
hg mv branches/$b .
hg rm branches trunk
hg branch $b
hg commint -m "Creating branch $b"
However, I wonder: is there a better way to do it? How would you solve this problem?
The answer is no, there was no better method. This situation was very specific, and there was an workaround, so I assume a "fix" wouldn't probably be worth it. I solved following the steps in the question, and would recommend it for most people in this situation.