|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
TOP COLDFUSION LINKS CF Techniques Version Control Using Subversion
This article describes the differences between CVS and Subversion and explains how to install Subversion
By: Harry Klein
Jul. 19, 2006 07:15 PM
I've been meaning to switch from CVS to Subversion for quite a while. It seemed hard, but it actually took me only a couple of days to get it installed and configured for the whole development team.
Subversion Versus CVS
There exist several Installation Guides for Subversion, like the "Mere-Moments Guide to installing a Subversion server on Windows". If you're feeling lazy and prefer an automated install, you can use the "svn1clicksetup" project from Tigris. Svn1ClickSetup takes you through all the steps necessary to install the Subversion command-line utilities and TortoiseSVN as well as creating a repository and initial project. There are several installation options for Subversion. I preferred the Apache installation. SVN Server together with Apache is the installation used most often and provides authentication, path-based authorization, and basic repository browsing. I was advised never to use the Berkeley database so I selected a file system for our repository. After the Subversion installation I was searching for a tool to import content from CVS to the new Subversion repository. It should preserve commits, authors, commit messages, and the dates of commits and also convert CVS branches and tags to SVN branches and tags. The tool of choice was the Polarion "SVN Importer," a command-line utility that transfers data from other version control systems to SVN. It also supports the version control systems PVCS, VSS, ClearCase, and MKS. All I had to do was modify the configuration file "config.properties," specifically the sections "SVN AUTOIMPORT OPTIONS" and "CVS PROVIDER CONFIGURATION." Then I had a long coffee break because the repository to migrate was very large. After five hours everything was imported without a single warning.
Configuration Subversion supports $Id$, but not the $Log$ keyword. Subversion developers haven't included a $Log$ keyword (expands to list all of the log messages) because in their opinion all this extra stuff in the source files gets in the way of reading the code. For Subversion to recognize things like $Id$ in source files, you have to tell it to do this explicitly by updating the "svn:keywords" property.Changes such as this are versioned just like any other changes to the files so you'll have to commit after running this command for it to take effect. To set the property automatically on files matching certain patterns, add lines such as this to your subversion/config file:
### Section for configuring miscellaneous Subversion options.
Both svn:keywords and svn:eol-style are file properties. svn:keywords is needed to add the keywords to the file; svn:eol-style determines the line ending character on a file. I also thought about using the folder property "tsvn:logminsize," which would set the minimum length of a log message for a commit, but changed my mind. The previous CVS installation used SSPI (integrated Windows authentication), so we needed something similar for Subversion. Subversion provides the SSPI module "mod_auth_sspi.so." Within the Apache httpd.conf file the following modules must be setup in order:
# Windows authentication module I also added the authentication lines to the Location Tag:
<Location /svn> A simple "authorization.conf" file would contain only these two lines:
[/] This means that all users can read and write. Please consult the documentation for more advanced configuration options. If your Subversion repository is being served up through the Apache HTTP Server you can point any Web browser to your Subversion repository and navigate your way through the latest revision of your repository.
Subversion Project Structure, Clients and IDE Integration Trunk represents the main line of development, release Branches represent working code that differs from trunk. Tags (read-only) are significant events in a project's lifecycle. A repository may contain only one project root or a number of them. Subversion versions the repository, not individual projects. When you commit a change to the repository, make sure your change reflects a single purpose like fixing a specific bug, adding a new feature, or some particular task. Our development team uses several IDEs like Homesite, Dreamweaver, or Eclipse (with the CFEclipse plug-in). In the past the preferred CVS Client was WinCVS. After switching to Subversion, Homesite users installed the Tortoise SVN and were happy with the Windows shell extension. This extension let them execute SVN actions inside their IDE. CFEclipse users installed the Subclipse plug-in, which let them access the Subversion repositories inside Eclipse. The Subversive project is a new Eclipse plug-in that provides Subversion support.
Ant Scripts
<!- define svn taskdef ... ‡ After several tries and connection problems I finally gave up and used the Ant exec task instead. Sample code from build.xml:
<!-- svn-settings --> CFDJ LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||