As Nelly would say, hurrr we go.
I’ve tested the script several times in the last few days and all the bugs I’ve come across have been quashed, I’m pleased to say. The trickiest one had to do with something caused by that most evil of Clearcase objects, the symlink. Basically, if you have a symlink that you break and replace with an identically named directory/file, it’s difficult for the script to reflect the removal-and-readdition in a single revision. Thankfully, the Subversion dump format took that into account (which I find remarkably foresightful), and I fixed that. The script’s pretty heavily commented, so you can see how, if you’re interested :)
Anyway, the script’s attached, with a detailed set of instructions in the README.txt. Please feel free to send me any questions or comments.
Update: Final, confirmed numbers below. This is for a project where the latest Clearcase snapshot is about 187MB in size.
- Dumping: 257 revisions took 2:23:21, and yielded 8.22GB of data
- Loading: 257 revisions took 2:44:51, and yielded a repository 321MB in size
Also, a little note: the label-importing idea can achieve arbitrary granularity by use of the ‘time’ rule in cspecs. In fact, it might be worthwhile to extend this script to generate and set cspecs based on the time rule instead of labelling, which would save a lot of labelling time for those projects that don’t label regularly and religiously.



Vamsi Hari wrote in with questions about why the script wouldn’t work on his Windows installation. The answer was pretty standard: line terminations. I’ve converted the files to CRLF, so that should no longer be an issue.
Other things that Vamsi’s email highlighted:
1) The ‘vob already mounted’ message is a warning (as opposed to a fatal error) so it can be ignored.
2) On Windows, Clearcase is often installed in =C:\Program Files=, which is problematic because of the space between ‘Program’ and ‘Files’. If that is the case for your installation, remember to put the path in double-quotes when you update the the config file.
How about migrating clearcase to subversion from separate windows boxes?
Not sure what you mean. Let’s assume that your project is composed of 3 VOBs and you have views on 3 boxes that look at one of the VOBs each. In that case, to use this script you would create a source view on one of those machines that has a config spec that loads up all 3 VOBs and then use the script as usual. There isn’t any special jiggery required with the config spec — you could just concatenate the specs you’re using for the 3 partial views.
It seems the config file is a little wrong — there’s an entry called ‘clearcase’, which should actually be called ‘cleartool’.
Thanks to Samuel for asking about this.