Using svn with the trac Repository

Revision as of 08:17, 18 July 2011 by Andrew.eichmann (talk | contribs) (New page: The following is a sample session using the <code>svn</code> code repository management application on the public GEOS-5 repository, prepared by Dan Kokron. <pre> # All testing was perfo...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following is a sample session using the svn code repository management application on the public GEOS-5 repository, prepared by Dan Kokron.


# All testing was performed using
> > svn --version
svn, version 1.6.11 (r934486)

# Create a local SVN repository for testing
> > svnadmin create /home/dkokron/svntest

# Export a clean copy of F22p1 from geos5.org, save to directory named Fortuna-2_2p1
> > mkdir GEOSagcm
> > cd GEOSagcm
> > mkdir trunk tags branches
> > cd tags
> > svn export http://geos5.org/svn/branches/2.2p1 Fortuna-2_2p1

# Import the clean copy into the local repository
> > cd /home/dkokron/GEOSagcm
> > svn import -m "Initial import of F22p1" /home/dkokron/GEOSagcm file:///home/dkokron/svntest/GEOSagcm

# Create a branch for some development
> > svn copy -m"Create branch for rrtmg development" file:///home/dkokron/svntest/GEOSagcm/tags/Fortuna-2_2p1 file:///home/dkokron/svntest/GEOSagcm/branches/BRANCH-F22p1-rrtmg
> > svn copy -m"Create branch for testing" file:///home/dkokron/svntest/GEOSagcm/tags/Fortuna-2_2p1 file:///home/dkokron/svntest/GEOSagcm/branches/BRANCH-F22p1-test

# List contents of the local repository
> > svn list file:///home/dkokron/svntest/GEOSagcm/tags
Fortuna-2_2p1/
> > svn list file:///home/dkokron/svntest/GEOSagcm/branches
BRANCH-F22p1-rrtmg/
BRANCH-F22p1-test/

# cleanup the clean copy, go to a new location and checkout a version controlled copy from the local repository
> > rm -r /home/dkokron/GEOSagcm
> > cd /home/dkokron/GEOS-5
> > svn co file:///home/dkokron/svntest/GEOSagcm/branches/BRANCH-F22p1-test/ Fortuna-2_2p1

# You now have a working copy of Fortuna-2_2p1.  Add something to it.  I'm adding the cubed-sphere dycore from a CVS copy of 25U
> > cd Fortuna-2_2p1/src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSsuperdyn_GridComp/
> > cp "SomePath"/FVdycoreCubed_GridComp .

# clean up any build and CVS admin stuff
> > find FVdycoreCubed_GridComp -type f -name "*.[aoxd]" -exec rm {} \;
> > find FVdycoreCubed_GridComp -type f -name "*.mod" -exec rm {} \;
> > find FVdycoreCubed_GridComp -type d -name CVS -exec rm -r {} \;

# Now schedule it to be added to the local repository
> > svn add FVdycoreCubed_GridComp
A         FVdycoreCubed_GridComp
.
.
.
A         FVdycoreCubed_GridComp/FV_StateMod.F90

# Actually commit the mods to the local repository
> > svn commit -m "Added Cubed-Sphere dynamical core"
Adding         GEOSsuperdyn_GridComp/FVdycoreCubed_GridComp
.
.
.
Adding         GEOSsuperdyn_GridComp/FVdycoreCubed_GridComp/testcases_3_4_5_6_stand_alone.f90
Transmitting file data ............................................................................................
Committed revision 2.

# Change a file then compare with the repository
> > cd FVdycoreCubed_GridComp
> > vi fvdycore/model/sw_core.F90

# 'M' indicates SVN found that I modified the indicated file.  'stat' by itself is recursive so absence of other output indicates SVN did not find any other mods
# IMPORTANT! 'svn stat' replaces the functionality of 'cvs -nq upd'
> > svn stat
M       fvdycore/model/sw_core.F90

# A closer look at the modified file.  By default, SVN formats 'diff' output suitable for use with 'patch'
> > svn diff fvdycore/model/sw_core.F90
Index: fvdycore/model/sw_core.F90
===================================================================
--- fvdycore/model/sw_core.F90  (revision 2)
+++ fvdycore/model/sw_core.F90  (working copy)
@@ -2167,6 +2167,10 @@
 
   utmp=0.0
   vtmp=0.0
+  uc = 0.0
+  vc = 0.0
+  ua = 0.0
+  va = 0.0
 !----------
 ! Interior:
 !----------

# Commit the mod
> > svn commit -m 'Initialize output args' fvdycore/model/sw_core.F90
Sending        fvdycore/model/sw_core.F90
Transmitting file data .
Committed revision 3.

# Examine the log file for fvdycore/model/sw_core.F90
> > svn log fvdycore/model/sw_core.F90
------------------------------------------------------------------------
r3 | dkokron | 2011-06-08 13:45:20 -0400 (Wed, 08 Jun 2011) | 1 line

Initialize output args
------------------------------------------------------------------------
r2 | dkokron | 2011-06-08 13:15:23 -0400 (Wed, 08 Jun 2011) | 1 line

Added Cubed-Sphere dynamical core
------------------------------------------------------------------------