CVS To SVN Migration

From Audacity Wiki

Jump to: navigation, search
Migration to SVN was completed on 25th January 2010

This page is a jotter for the process of migrating Audacity's source code from Sourceforge CVS and a few other places into a single Subversion repository on Google Code.

  1. Starting point. We have:
    • Sourceforge CVS
    • Sourceforge SVN (old Mezzo)
    • Google Code SVN (wiki)
  2. Download a backup of Sourceforge CVS using rsync: rsync -av --delete-delay rsync://audacity.cvs.sourceforge.net/cvsroot/audacity/* audacity-cvsbackup/
  3. Download a backup of Sourceforge SVN repo using rsync: rsync -av --delete-delay audacity.svn.sourceforge.net::svn/audacity/* audacity-svnbackup/
  4. Create an empty repository to put the Google Code contents in: svnadmin create oldrepo
  5. Ensure we can push changes into new repo: echo '#!/bin/sh' > oldrepo/hooks/pre-revprop-change; chmod u+x oldrepo/hooks/pre-revprop-change
  6. Prepare to download the contents of the Google Code SVN repo using svnsync: svnsync --no-auth-cache --username RichardAsh1981 init file://$(pwd)/oldrepo/ https://audacity.googlecode.com/svn/
  7. Do the download: svnsync --no-auth-cache --username RichardAsh1981 sync file://$(pwd)/oldrepo/
  8. OK, so we now have two SVN repositories and a set of server-side CVS files. We need to convert them into SVN repository dump files in order to proceed.
  9. Dump Google Code to a file: svnadmin dump gc-svnsync-old/oldrepo/ > gc-old.svndump
  10. Dump Sourceforge SVN to a file: svnadmin dump sf-svn-backup/audacity-svnbackup/ > sf-svn.svndump
  11. Convert Sourceforge CVS into a SVN dump-format file with cvs2svn: cvs2svn --encoding=utf-8 --encoding=cp1252 --encoding=cp1140 --dumpfile=sf-cvs.svndump --cvs-revnums sf-cvs-backup/audacity-cvsbackup/ > cvs2svn.log
  12. Wait a while for that to complete
  13. Check the huge amount of output sent to file for errors and warnings: grep -i warning cvs2svn.log; grep -i error cvs2svn.log
  14. Assuming all that finds is file names, we are good to continue with creating a new subversion repository to contain these three dumps.
  15. Create a repository to load everything in to svnadmin create gc-newsvn
  16. Create top-level directories into which the dumps will go temporarily: svn mkdir -m "InitialSVN dump import roots" file://$(pwd)/gc-newsvn/gc-svn file://$(pwd)/gc-newsvn/sf-svn file://$(pwd)/gc-newsvn/sf-cvs
  17. Load in Google Code SVN dump: svnadmin load gc-newsvn --parent-dir gc-svn < gc-old.svndump
  18. Load in Sourceforge SVN dump: svnadmin load gc-newsvn --parent-dir sf-svn < sf-svn.svndump
  19. This last one will take forever - it's got 10,000 revisions to load, and manages about 2 a second ...
  20. Load in Sourceforge CVS dump: svnadmin load gc-newsvn --parent-dir sf-cvs < sf-cvs.svndump
  21. In principle, we now have our new Subversion repository, however it's quite a mess inside, so we should do some tidying up before we make it public.
  22. Make a backup-of this loaded repository, it is precious!
  23. Create a local working copy from the repository (which needs an absolute path, so edit the commands): mkdir test-checkout; cd test-checkout; svn co file:///var/tmp/richard/audsvn/gc-newsvn/ .
  24. This will check out the complete repository to disk, which uses a lot of space (be warned!)
  25. The CVS repository unfortunately contained directories called .svn which means the repository can't be checked out because of a conflict with the .svn directories used by the client for metadata. The solution to this is to delete the .svn directories directly in the repository (not in a working copy):
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macos/compat/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macos/compat/sys/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macos/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macosx/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macosx/ogg.pbproj/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/XIPHOPHORUS/lib-src/libogg/macosx/English.lproj/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/allegro2-branch/lib-src/libogg/macos/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macos/compat/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macos/compat/sys/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macos/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macosx/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macosx/ogg.pbproj/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/Audacity_UmixIt/lib-src/libogg/macosx/English.lproj/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macos/compat/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macos/compat/sys/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macos/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macosx/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macosx/ogg.pbproj/.svn/
    svn del -m "Delete .svn directory that should never have gone into CVS" file://$(pwd)/gc-newsvn/sf-cvs/branches/audacity-1_3_0-branch/lib-src/libogg/macosx/English.lproj/.svn/

  1. Same in sf-cvs/branches/AUDACITY_1_2, sf-cvs/tags/Audacity_1_3_2/, sf-cvs/tags/audacity-1_3_0-release, sf-cvs/tags/Before_Allegro2, sf-cvs/tags/Audacity_UmixIt_BNL, sf-cvs/tags/LIBOGG-1_1_2, but by now I'm scripting the clean-up
  2. Start to locate the trees we want in the final repository and put them into place, using svn mv
Personal tools