Personal tools
You are here: Home Developer Info Getting Started With Subversion
Document Actions

Getting Started With Subversion

by Kyle Halliday last modified 2006-12-05 15:27

Overview

This guide is intended for PCMDI software developers and external collaborators who contribute to CDAT. It provides a brief introduction to accessing the PCMDI Subversion source code repository using the Subversion command-line tools.

Repository Mapping from Perforce --> Subversion

The repository layout was changed significantly when we switched from Perforce to Subversion.

How to Access the Subversion Repository

To access the repository, you'll need to download and install a Subversion client:
http://subversion.tigris.org/project_packages.html

If you build the Subversion client from source, you shouldn't need any of the addional libraries mentioned in the INSTALL file (e.g. Berkeley DB, Apache), since those are only required for building the Subversion server.

Once your client is set up, you can check out a working copy and try it out.

To check out the main CDAT development branch, I would do:
svn checkout http://www-pcmdi.llnl.gov/svn/repository/cdat/trunk cdat
To check out my CDAT development branch, I would issue the command:
svn checkout http://www-pcmdi.llnl.gov/svn/repository/cdat/branches/halliday /home/halliday1/dev/cdat
If I already had a working copy, I would do an svn update to get changes made by anyone else (unlikely, because in this example I'm working with my own dedicated development branch).

This creates a working copy, which I can then edit. After editing the file, I can run svn status, which tells me that README.txt has been modified:
[halliday1@ananke]$ svn status
M      README.txt
I can do an svn diff to tell me how README.txt has changed:
[halliday1@ananke]$ svn diff README.txt
Index: README.txt
===================================================================
--- README.txt  (revision 5326)
+++ README.txt  (working copy)
@@ -1,6 +1,6 @@
Climate Data Analysis Tools (CDAT)

-VERSION: 4.0.5
+VERSION: 4.0.6

UCRL-CODE-2002-0021
I can run svn log to view the history of README.txt (note how the history is preserved from the original branch).
[halliday1@ananke]$ svn log README.txt
------------------------------------------------------------------------
r5325 | halliday1 | 2005-12-06 10:01:17 -0800 (Tue, 06 Dec 2005) | 2 lines

Branch from cdat trunk - development branch for halliday

------------------------------------------------------------------------
r3055 | doutriau | 2005-10-05 06:22:10 -0700 (Wed, 05 Oct 2005) | 2 lines

integrate version changes to main

------------------------------------------------------------------------
r3049 | doutriau | 2005-10-04 07:53:03 -0700 (Tue, 04 Oct 2005) | 2 lines

adding proj to ioapi needed externals....

------------------------------------------------------------------------
r3047 | doutriau | 2005-10-04 03:15:13 -0700 (Tue, 04 Oct 2005) | 2 lines

fine tuned README

------------------------------------------------------------------------
........lots more..........
Finally, I can svn commit my change back to my development branch:
svn commit
This prompts me for a log message, using the text editor specified in my EDITOR environment variable.

More Subversion Documentation 

http://svnbook.red-bean.com/en/1.1/svn-book.html


Powered by Plone