Let’s say you have this subversion repository:
- /trunk <– General development to v. 2.2
- /branches/feature_a <– Eventually will be merged with trunk
- /branches/feature_b <– Eventually will be merged with trunk
- /branches/version-2.1 <– Stable version. Released to my customers
- /branches/version-2.0 <– Not needed anymore. I’d like to get rid of it
- /branches/version-1.0 <– Not needed anymore. I’d like to get rid of it
Here’s how to import this structure to Kiln:
hg convert actually makes this pretty easy. There is a config option called
clonebranches that you just need to set to true, and it will make a separate repo for each branch:
hg convert http://url.to/my/svn/repo imported-branches --config convert.hg.clonebranches=1
What you will end up with looks like this:
imported-branches/ .hg/ # ignore this .hg, you won't need it default/ # default branch, a.k.a. trunk/ .hg/ # notice, no files in here yet. run 'hg update' to get files feature_a/ # all of your branches will be there own repos now .hg/ feature_a/ .hg/ version-2.1/ .hg/ version-2.0/ .hg/ version-1.0/ .hg/
In case it’s not clear, you’ll have a separate repo for each branch. They’ll all be nested under another repo. Don’t bother pushing this parent repo, it won’t have anything in it.
Once you have the corresponding repos created on Kiln, just push each of the repos that you want to keep:
cd imported-branches hg push -R default https://example.kilnhg.com/Repo/Project/Group/devel hg push -R feature_a https://example.kilnhg.com/Repo/Project/Group/feature_a hg push -R feature_b https://example.kilnhg.com/Repo/Project/Group/feature_b hg push -R version-2.1 https://example.kilnhg.com/Repo/Project/Group/2-1 ...etc...
For the branches you don’t want, you can just delete them, though it wouldn’t hurt to push them to Kiln, just for posterity’s sake. You could keep them in a separate repository group.
Note that Mercurial and Kiln will both do the right thing, and recognize that these branches are all related. You’ll be able to see differences between them on the Outgoing tab in Kiln, and should be able to pull and push between them locally with Mercurial.