Migration from CVS to SVN: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(→‎External links: migration plan example)
(→‎Creating SVN repository: exclude undocumented branches)
Line 24: Line 24:


=== Creating SVN repository ===
=== Creating SVN repository ===
* [http://grass.itc.it/devel/cvstags.php List of documented tags/branches]


==== grass6 ====
==== grass6 ====
Line 61: Line 59:


  cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 -s grass6svn grass-cvs/grass6
  cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 -s grass6svn grass-cvs/grass6
Exclude all [http://grass.itc.it/devel/cvstags.php undocumented] braches
cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 \
--exclude="grass" \
--exclude="grassreleasebranch_5_0_0" \
--exclude="markus" \
--exclude="releasebranch_14_august_2001_5_0_0" \
--exclude="releasebranch_26_april_2002_5_0_0" \
--exclude="releasebranch_5_4" \
--exclude="unlabeled*" \
-s grass6svn1 grass-cvs/grass6


→ '''[http://josef.fsv.cvut.cz/cgi-bin/viewcvs.cgi/?root=grass6svn grass6svn]'''
→ '''[http://josef.fsv.cvut.cz/cgi-bin/viewcvs.cgi/?root=grass6svn grass6svn]'''

Revision as of 17:20, 21 October 2007

This page contains notes related to GRASS code migration (planned) from CVS to SVN.

Basic

  • The SVN command line interface is just like CVS, many tasks are identical- just change the program name from cvs to svn.

Gotchas

  • cvs2svn is known to break binary files (images) which were not imported into the CVS with the -kb flag. Luckily Glynn fixed most of these some months ago.
  • Files using keyword substitution, such as $Date$ in the description.html files, will have to have support for that enabled manually, once per file (or write a find routine with | xargs svn ...).
$ svn propset svn:keywords "Date" filename.txt
$ svn commit
  • how to maintain timestamps of files? We want to keep the last modification date, not the date of local download

Testing SVN repository

Copy of GRASS CVS repository

rsync -r --times --links --bwlimit=200 rsync://rsync.intevation.de/grass grass-cvs

→ cca 600 MB!

Creating SVN repository

grass6

cvs2svn --use-cvs --no-default-eol  -s grass6svn grass-cvs/grass6
...
Error summary:
ERROR: A CVS repository cannot contain both grass-cvs/grass6/display/d.erase/main.c,v and grass-cvs/grass6/display/d.erase/Attic/main.c,v
ERROR: A CVS repository cannot contain both grass-cvs/grass6/general/g.mapsets/main_inter.c,v and grass-cvs/grass6/general/g.mapsets/Attic/main_inter.c,v
ERROR: A CVS repository cannot contain both grass-cvs/grass6/include/gproj_api.h,v and grass-cvs/grass6/include/Attic/gproj_api.h,v
ERROR: A CVS repository cannot contain both grass-cvs/grass6/visualization/nviz/src/getCat.c,v and grass-cvs/grass6/visualization/nviz/src/Attic/getCat.c,v
Exited due to fatal error(s).

Solution:

Remove Attic files (?)

rm -f grass-cvs/grass6/display/d.erase/Attic/main.c,v
rm -f grass-cvs/grass6/general/g.mapsets/Attic/main_inter.c,v
rm -f grass-cvs/grass6/include/Attic/gproj_api.h,v
rm -f grass-cvs/grass6/visualization/nviz/src/Attic/getCat.c,v

Restart

cvs2svn --use-cvs --no-default-eol  -s grass6svn grass-cvs/grass6
...
----- pass 2 (CollateSymbolsPass) -----
ERROR: It is not clear how the following symbols should be converted.
Use --force-tag, --force-branch and/or --exclude to resolve the ambiguity.
   'releasebranch_6_2' is a tag in 2 files, a branch in 5259 files and has commits in 1513 files

Restart

cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 -s grass6svn grass-cvs/grass6

Exclude all undocumented braches

cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 \
--exclude="grass" \
--exclude="grassreleasebranch_5_0_0" \
--exclude="markus" \
--exclude="releasebranch_14_august_2001_5_0_0" \
--exclude="releasebranch_26_april_2002_5_0_0" \
--exclude="releasebranch_5_4" \
--exclude="unlabeled*" \
-s grass6svn1 grass-cvs/grass6

grass6svn

grass6 HEAD → grass7

cvs2svn --use-cvs --no-default-eol --force-branch=releasebranch_6_2 --trunk-only -s grass7svn grass-cvs/grass6

grass7svn

External links

SVN hosting

There are two main options to host the new SVN repository.