Notes about Subversion
On this page we will describe fundamental things that you have to understand about Subversion to effectively use it. There is also a special section for CVS users that are of special interest. Many of the things here are closely related to our VersioningConventions.
General
There are some special things you should know when using Subversion:
- The whole repository has a global revision number, it changes for all files if any file is changed (see below in CVS vs. SVN)
- Directories have versions
- Files, directories and revisions have properties.
CVS vs. SVN
You may already be used to CVS. In that case read about the differences to Subversion. This should help to make some things clear to avoid the typical pitfalls. Many of these things are shortened versioned of the Subversion book, appendix A.
- Version numbers
- In CVS every file has its own version number and you say "file x of version v". This is not true in SVN. Here all you have is a software release r. Each version of a file belongs to multiple releases of the repository. So you say "file x in release r". In terms of revision numbers in CVS you would say for example "revision 1.5 of file x" but in SVN you rather say "file x in revision 5".
- Directories have versions
- Unlike in CVS directories are versioned in SVN.
- Disconnected operations
- In Subversion clean copies of the files are stored in the .svn directory during checkout. This way the operations svn status, svn diff and svn revert are offline operations which do not need an active network connection.
- Distinction between status and update
- In CVS you regularly issued a cvs update just to see which files had been modified. The command cvs status yieleded way too much output to be useful for this task. This has changed. Now you use svn status to see what you have changed and svn update only to update your working copy to the current version of the repository.
- Branches and tags
- Branches and tags are nothing special any longer. They are just a copy created with svn copy. It is a convention that branches are put into the branches top directory and tags in the tags top directory, see the VersioningConventions.
- .cvsignore
- There is no .cvsignore or similar file anymore. This is now stored in directory properties in Subversion. The property is named svn:ignore.
Properties
Directories and files have properties. They control special behaviour. For example in the GettingStartedGuide the svn:keywords property is set for all new files. Another important property that you should set is svn:ignore. It should be set if you add a directory in which you compile objects. As a rule of thumb set this property on directories that contain a Makefile. Use a command like the following:
svn propset svn:ignore ".objs .deps" directory
Yes, the line break is correct, on purpose and needed! If you use bash just type it as it is written here, if you started a quotation you can just hit enter to continue on the next line. This is needed because different entries have to be separated into distinct lines. This command will add the subdirs .objs and .deps as ignored entries. When adding directories use the -N flag to add non-recursive, set the flag and then add the files. Or run a make clean in the directory before adding the files.
Also watchout for backup files, temporary files (moc_*, *~, etc.), do not add these files!

