The Artima Developer Community
Sponsored Link

Java Buzz Forum
The Subversion Conversion Diversion

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
The Subversion Conversion Diversion Posted: Mar 28, 2005 11:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: The Subversion Conversion Diversion
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

I've meant to start using Subversion ever since I first looked into it 394 days ago. I went as far as reading the online book from cover to cover. (I promised to buy the book when it came out but haven't, yet. But that's another story.) However inertia kept me from making the switch.

The excuse came when Julie decided to upgrade her workstation, which also doubles as my Web/JBoss/Oracle/CVS/Print server. It's been running Red Hat 7.2 since May 2002. I stopped upgrading her machine since that always meant the programs will run slower and the menus and icons will be rearranged, without any added benefits. This time, though, some of the new features of Yahoo doesn't work with the old Mozilla 1.0.1 anymore.

I've moved my blog over to my workstation 19 days ago. (I also desperately needed the new spam blocking features of Pebble 1.7.1.) I moved my CVS repository over this morning, and converted it to Subversion.

"How did it go?" You ask.

"Splendid! Everything worked as expected, after I figured them out."

What did I figure out? Plenty. Having read the book a year ago definitely helped. Fedora Core 3 helped a lot by including the Subversion in its distribution. The cvs2svn script did all the conversion work. I also read blogs from these helpful people:

Here's my version of the experience report.

Subversion in Fedora Core 3

Subversion is included as part of the Fedora Core 3 distribution. The main subversion package was installed by default when I installed Fedora Core 3. The Apache connector package mod_dav_svn is not, and I have to run yum install mod_dav_svn to get it.

I planned to run Subversion through the Apache connector and nothing else. Since Apache httpd is run as the apache user, all of my Subversion administration work has to be done as the apache user. To be able to su - apache I have to edit /etc/passwd to change apache's login shell from /sbin/nologin to /bin/bash.

Creating the Subversion Repository.

I created the Subversion repository by running the

[root@gao-2004] # svnadmin create /var/svnroot

command as root. I then changed the owner by running

[root@gao-2004] # chown -R apache.apache /var/svnroot

To make SELinux happy, I also run

[root@gao-2004] # chcon -R -h -t httpd_sys_content_t /var/svnroot

as suggested by the Subversion FAQ.

Configuring mod_dav_svn

I followed the book in configuring mod_dav_svn. Fedora Core 3 modularized Apache's httpd.conf. To configure mod_dav_svn, I only need to edit /etc/httpd/conf.d/subversion.conf. Here's my customized version of the file:

[root@gao-2004] # cat /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn>
   DAV svn
   SVNPath /var/svnroot

   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
   Allow from ::1
   Allow from 192.168.7

   <LimitExcept GET PROPFIND OPTIONS REPORT>
      AuthType Basic
      AuthName "Subversion"
      AuthUserFile /etc/svn-auth-file
      Require valid-user
   </LimitExcept>
</Location>

This allowed me to access the Subversion repository from any machine on my local network. When I visited the URL http://www.weiqigao.com/svn/ from Firefox, I see an empty Subversion repository.

Converting the CVS repository to Subversion

I installed cvs2svn. I read the documentation of cvs2svn, and decided that I can get away with the simplest command possible:

[root@gao-2004] # cvs2svn --existing-svnrepos --no-default-eol --keywords-off \
 --cvs-revnums -s /var/svnroot /var/cvsroot

[...]
cvs2svn Statistics:
------------------
Total CVS Files:              2808
Total CVS Revisions:          4505
Total Unique Tags:               3
Total Unique Branches:           1
CVS Repos Size in KB:        84619
Total SVN Commits:             293
First Revision Date:    Tue May  6 20:46:23 2003
Last Revision Date:     Sun Mar 27 18:34:00 2005
------------------
Timings:
------------------
pass 1:    36 seconds
pass 2:     0 seconds
pass 3:     0 seconds
pass 4:     1 second
pass 5:     1 second
pass 6:     0 seconds
pass 7:     0 seconds
pass 8:   340 seconds
total:    381 seconds

This sucked everything from my CVS repository into the newly created Subversion repository, all the histories, tags, branches, everything. It took a little while.

However, in hast, I run the command as root, which left a couple of log files in the /var/svnroot/db owned by root. That made Apache unhappy. When I tried to access the repository through the URL in Firefox I got an error message saying it cannot access the SVN filesystem.

I stopped Apache, changed the owner of the log files, and run svnadmin recover /var/svnroot just ro make sure the database is OK. When I restarted Apache, I can indeed see my repository from the browser:

I can now go to another computer in the house and check out my blog:

[weiqi@gao-2003] $ svn co http://www.weiqigao.com/svn/trunk/blog blog

A run of the command diff -q -r between the CVS check out directory and the Subversion check out directory showed that they are identical, not counting the CVS and the .svn directories.

Some Statistics

Here are some statistics:

  • My CVS repository size is 108MB.
  • The converted Subversion repository size is 95MB.
  • A fresh checkout of my blog project from the CVS repository took 38 seconds (over the network).
  • With Subversion, it took 2 minute 7 seconds (local machine).
  • The CVS check out is 98MB in size.
  • The Subversion check out is 280MB in size.

Read: The Subversion Conversion Diversion

Topic: Living by Basecamp, day 5 Previous Topic   Next Topic Topic: Gateway Software Symposium - Day 2

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use