Difference between revisions of "GENIE Quick SVN ref"

From SourceWiki
Jump to navigation Jump to search
Line 5: Line 5:
 
=Using Subversion=
 
=Using Subversion=
  
First, just as it was with CVS, you will need a '''Subversion client''' installed on your machine.  If you are using linux, then you will most likely have the '''command line''' client already installed.  Try typing '''which svn''' to see if the clent is in your path.  SVN clients exists in both command line and nice GUI forms for just about any operating system. [http://tortoisesvn.tigris.org tortoisesvn] is popular for windows. [http://www.apple.com/downloads/macosx/development_tools/svnx.html SVNx] is popular for the Mac.  For more links see the [http://source/wiki/Subversion_links links page] on this wiki.
+
First, just as it was with CVS, you will need a '''Subversion client''' installed on your machine.  If you are using linux, then you will most likely have the '''command line''' client already installed.  Try typing "'''which svn'''" to see if the clent is in your path.  Command line and nice GUI clients for SVN are available for just about any operating system. [http://tortoisesvn.tigris.org tortoisesvn] is popular for windows. [http://www.apple.com/downloads/macosx/development_tools/svnx.html SVNx] is a good choice for the Mac.  For more links see the [http://source/wiki/Subversion_links links page] on this wiki.
  
Once you have Subversion installed, you will need an username and password.  This will allow you to access the GENIE SVN repository.  Happily, this is considerably easier than for CVS.  You will be prompted for your password when required.  SVN caches your password, and so you often do not need to type it.
+
Once you have Subversion installed, you will need a username and password.  If you haven't already them, email XXX.  Happily, access is considerably easier than for CVS.  You will be prompted for your password when required.  SVN caches your password, and so you often do not need to type it.
  
Another big difference between CVS and SVN is that repositories are accessed through a URL.  For example, you might checkout GENIE from SVN by typing:
+
Another big difference between CVS and SVN is that repositories are accessed through a URL.  For example, you can checkout GENIE from SVN by typing:
 
<pre>svn checkout http://source.ggy.bris.ac.uk/subversion/genie/trunk --username <your_username> ~/genie</pre>
 
<pre>svn checkout http://source.ggy.bris.ac.uk/subversion/genie/trunk --username <your_username> ~/genie</pre>
  

Revision as of 08:30, 5 June 2007

What is Subversion?

Subversion (abbreviated to SVN) is the successor to CVS. It is closely related to CVS and so many of the commands are the same. Subversion still has the commands checkout, commit and update, except that, for example, cvs update is replaced with svn update. Happily this means that there is little re-learning required to use SVN instead of CVS. If CVS and SVN were entirely alike, we would not get the advantages that Subversion brings. Subversion addresses a number of the shortcomings of CVS. For example, the command svn move now exists, which allows you to rename a file without losing it's history, something not possible under CVS.

Using Subversion

First, just as it was with CVS, you will need a Subversion client installed on your machine. If you are using linux, then you will most likely have the command line client already installed. Try typing "which svn" to see if the clent is in your path. Command line and nice GUI clients for SVN are available for just about any operating system. tortoisesvn is popular for windows. SVNx is a good choice for the Mac. For more links see the links page on this wiki.

Once you have Subversion installed, you will need a username and password. If you haven't already them, email XXX. Happily, access is considerably easier than for CVS. You will be prompted for your password when required. SVN caches your password, and so you often do not need to type it.

Another big difference between CVS and SVN is that repositories are accessed through a URL. For example, you can checkout GENIE from SVN by typing:

svn checkout http://source.ggy.bris.ac.uk/subversion/genie/trunk --username <your_username> ~/genie

Quick Start

See the above example, showing how to checkout the trunk of the GENIE repository. (We will cover branches later.) The examples below are for the command line client.

To update an existing checkout, simple cd to the highest-level directory and type:

svn update

If you have created a new file, use:

svn add <filename>

Similarly, to delete a file:

svn del <filename>

Once you have made your local changes, you should test them before committing any of them back to the repository. Type:

make test
make testebgogs
make testbiogem

to run the IGCM- and EMBM-based short tests respectively (the BIOGEM test is based on an EBGOGS config').

Once your tests pass with an "**OK**", then you can go ahead and commit your changes:

svn commit -m "type your message here"

NB SVN uses version numbers differently to CVS. SVN gives the entire repository a version number and increments this whenever there has been a change. Thus--unlike CVS--individual files do have a version number.

To see the history of a given file, type

svn log <filename>

To check-out one of the stable releases of GENIE, you can use:

svn checkout https://source.ggy.bris.ac.uk/subversion/genie-test/tags/rel-2-1-0 --username <your_user_name> ~/genie

To find out more SVN options type:

svn --help