SubversionSubversion is the code management system that is supplanting CVS in the open source community. This not just a change of the client but the whole structure behind the scenes. In many ways it works in a similar fashion to cvs but it is incompatible in others; there are tools for exporting and importing svn repositories to/from cvs repositories as long as certain more advanced svn features are not used. But a client (code user) can not use one system to access a repository of the other type.
Unlike cvs, files are not individually tagged as versions. When a commit is made it should be the collection of all the relevant files that make up a consistent set of changes. The overall version is then incremented if all the changes were made. If any part of the commit conflicts with some other change then none of the files are modified.
Using SubversionIn many repects svn works in a manner very similar to cvs and commands look very similar. There are differences though both in syntax and some underlying principles (see above).
Since MINOS is not currently using svn for committing to a repository, this guide will focus only on those commands that a code user (e.g. not a developer) would need.
svn help # list all the commands svn help diff # help for a particular command
checkoutThe command to checkout the "HEAD" (bleeding edge of the development branch) of ROOT is:
svn checkout http://root.cern.ch/svn/root/trunk mysubdirThe trunk is the main development branch. The mysubdir is an arbitrary directory name and could just as well be trunk or bleeding-edge as the user desires. The equivalent of CVS tagged releases are checkout via:
svn checkout http://root.cern.ch/svn/root/tags/v5-17-03 v5-17-03
diffComparing the difference between a working copy and a tagged version looks something like:
svn diff -r HEAD[:BASE]where BASE means the working copy and HEAD is the latest of that branch. Comparing a tagged version to the trunk or another tag is a bit more work:
svn diff http://root.cern.ch/svn/root/trunk http://root.cern.ch/svn/root/tags/v5-17-04
a word about versionsThe arg to the -r flag is the revision. It can be:
logTo print the commit log messages for all changes between the current working copy and the HEAD use:
svn log -r HEAD:BASE
project tagsTo list the available tagged versions use:
svn ls --verbose http://root.cern.ch/svn/root/tags
status (changed files)Checking which files in the working copy have local modifications (or are scheduled for addition/deletion) can be done by:
svn statusDoing this does not need network acess and does not change the working copy. To see which items in the working copy are out-of-date (i.e. newer versions exist in the repository) use:
svn status -uFiles that have been locally modified are indicated by a M, out-of-date files by *.
$ svn status -u * 20392 xrootd/src/xrootd-20071001-0000.src.tgz * 20392 netx/src/TXNetSystem.cxx * 20392 histpainter/src/THistPainter.cxx * 20392 geom/src/TGeoCone.cxx * 20392 geom/src/TGeoSphere.cxx * 20392 io/src/TBufferFile.cxx ? root_config.log ? root_build_map.log ? nohup.out ? root_build.log ? root_distclean.log ? config/Makefile.linux.original M 20392 config/Makefile.linux ? root_build_cintdlls.log Status against revision: 20404General info about a working copy can be found with:
Under Scientific Linux it may be available via a yum RPM installation if you have system privileges -- though the latest for SLF 3 or 4 seemed to be Subversion 1.1 which is pretty old. The current pages at http://subversion.tigris.org/ suggest that one want a version newer than 1.2.
If you don't want to go RPM route you can build and install the client code from source (you won't need the server code). On the FNAL nodes Subversion is installed in the $INSTALLATION area and proceeded along the lines of:
The -deps packages up some of the auxillary external libraries that Subversion itself depends on. Many of these aren't normally found on most systems.
On the Mac OS X one can get prebuilt binaries by following the links on http://subversion.tigris.org/project_packages.html to the Universal Installer.
Subversion and firewallsIf you are behind a firewall that blocks outgoing HTTP you will need to tell SVN about your web proxy server. Edit ~/.subversion/servers (if you don't have one first type svn help which will create it) to add lines like:
[groups] root = root.cern.ch [root] http-proxy-host = proxy.foo.bar http-proxy-port = 3128
|Security, Privacy, Legal||