Introduction
Recently I've been using tigris.org's vss2svn 0.3.3 perl script to convert many
large Visual Source Safe repositories to Subversion at work. For the most part it works
enough for my purposes, however I've come across a scenario that it does
not handle.
The problem
VSS apparently has a property one can set on a file to 'not store history'
information. This tells VSS to only maintain the latest version of the
file. If a file has this property set, vss2svn.pl fails to convert it
properly because SS.exe cannot fetch older versions. When it tries to do
so, nothing is created, and no error seems to be reported.
The fix
My patch below modifies the 0.3.3 version of vss2svn.pl to
check whether SS.exe actually created the file it was expected to. If the
file was *not* created, then the script now fetches the file without
specifying a version (get latest). This file is then used. If the second
fetch fails, the script dies.
Since tigris.org notes that the 0.3 branch is no longer going to be
updated, I've released my modification below for anybody who may be in the
same boat as I am (need to convert now, can't wait for new scripts to be
available).
This solution does have at least one drawback. From what I can tell since
each 'version' of this file is now exactly the same SVN will not re-commit
changes for it (good thing). However, this also means that later commit
comments will be lost for the file. For me that was a workable situation.
Download
This code is released as is. I've tested it myself and it seems to be in
good working condition. Please be sure to test it yourself to ensure it
does not destroy irrecoverable work!
The patch: vss2svn-0.3.3-p1.patch.bz2
The vss2svn.pl script with my patch applied: vss2svn-0.3.3-p1.pl.bz2
Contact me
Please
contact me if you have
suggestions or questions about my modification. For general questions
about this script please see the main
vss2svn site
(or the bundled README/INSTALL documents that come with the main
distribution).