Friday, July 14, 2006

The edge-seater - > converting a cvsnt project to subversion.

Nows when the nightmare starts I thought when I wanted my CVSNT project to be migrated with all details to Subversion. One thing that was in my favour was there was nothing CVSNT specific that I used and my project was pretty simple project.

First I downloaded cvs2svn and extracted it.
Then I downloaded Python and installed it.
I opened a command prompt to the extracted cvs2svn directory and then typed d:\python2.4\python setup.py install and it started pouring out its usual sysouts like
"install
running install
running build
running build_py
creating build
creating build\lib
....
..
running install_scripts
creating D:\Python24\Scripts
copying build\scripts-2.4\cvs2svn -> D:\Python24\Scripts"

Thats it..Python had created cvs2svn and I crossed my first hurdle.

Then I downloaded UnxUpdates because the sort feature is required by cvs2svn.

I made a copy of the cvs folder I wanted to migrate and then decided its time. I had made the choide to do exactly this! Ok enough of build up ...

I went to the folder where I made the CVS copy opened a command prompt and then typed away.

I first added the sort.exe I downloaded from unx to the path

"set path=%path%;;"

Then...here goes....

"D:\Python24\python D:\Python24\Scripts\cvs2svn --fs-type=fsfs --use-cvs -s d:\svnrepo\<svn_repo_name> <cvs_repo_path>"

The -fs-type is to tell the process to use the fsfs file system insted of the berkley thingy and then --use-cvs is to tell it to use cvs rather that RCS!

I waited with baited breath as the sysouts started to roll...

"----- pass 1 -----
Examining all CVS ',v' files...
....
..
Done
----- pass 2 -----
Checking for blocked exclusions...
Checking for forced tags with commits...
Checking for tag/branch mismatches...
Re-synchronizing CVS revision timestamps...
Done
----- pass 3 -----
Sorting CVS revisions...
Done
----- pass 4 -----
Copying CVS revision data from flat file to database...
Finding last CVS revisions for all symbolic names...
Done
----- pass 5 -----
Mapping CVS revisions to Subversion commits...
Creating Subversion r2 (commit)
Creating Subversion r3 (commit)
Creating Subversion r4 (commit)
....
...
.
----- pass 6 -----
Sorting symbolic name source revisions...
"

Yes, finally the sort is working!!!! If the path was not added, the process breaks exactly here!

"Done
----- pass 7 -----
Determining offsets for all symbolic names...
Done.

Done.

cvs2svn Statistics:
------------------
Total CVS Files: 137
Total CVS Revisions: 383
Total Unique Tags: 1
Total Unique Branches: 2
CVS Repos Size in KB: 124765
Total SVN Commits: 120
First Revision Date: Mon Jun 12 14:58:50 2006
Last Revision Date: Wed Jul 12 17:11:14 2006
------------------
Timings:
------------------
pass 1: 1 second
pass 2: 0 seconds
pass 3: 0 seconds
pass 4: 0 seconds
pass 5: 0 seconds
pass 6: 0 seconds
pass 7: 0 seconds
pass 8: 218 seconds
total: 222 seconds"


Thats it!, I had sucessfully migrated my project.


1 comment:

jakyra said...

Thanks for this! I followed your directions and it worked perfectly! I too had not done anything but commit, tag and branch.

The conversion did take a *really*, *really* long time (as in all day and into the evening - 42441 seconds.)

Thanks for the hint about UnxUtils. I don't know that I would have figured that all out.