-
Notifications
You must be signed in to change notification settings - Fork 0
Merging and Updating the SVN Repository For Icarus
This page will detail information about the updating SVN repository for Icarus
First, svn copy the trunk (or another branch) into a new branch:
svn copy https://geos5.org/svn/trunk https://geos5.org/svn/branches/Icarus-2_0 -m "geos: created Icarus-2_0 branch"
Note that this is just a copy, so that means the Icarus-2_0 branch isn't actually Icarus-2_0 yet.
cd /path/to/svn/directory
ls
branches/ tags/ trunk/
cd branches/
svn checkout https://geos5.org/svn/branches/Icarus-2_0
This is a bit "belt-and-suspenders", but to be sure you don't muck up the "merge" from CVS to SVN, I made a copy of the new branch:
cp -a Icarus-2_0 Icarus-2_0-SAVE
The next step is to check out the tag that will become the new branch:
cd /path/to/cvs/directory
mkdir Icarus-2_0
cd Icarus-2_0
cvs -Q co -r Icarus-2_0 GEOSagcm
This isn't really necessary, but it's a good step. Run a cvscmp on this checkout:
$ cvscmp Icarus-1_0_p1
This will give you a good idea of what changed and how many differences the SVN commit should be committing.
Next, in the CVS branch, run the HandleCopyright.py script:
cd /path/to/cvs/directory/Icarus-2_0/GEOSagcm/src
HandleCopyright.py -p .
At the moment, we *think* the copyright script correctly handles all files, but the proof will be when you try and build the "copyrighted" code. The files that have the greatest chance of getting screwed up are .h files since some in the GEOS-5 GCM are .h files that contain C code (mainly in GFDL_fms) and most are .h files that contain Fortran code.
I've created a script in:
~mathomp4/bin/stripCopyright.bash
that automatically removes the copyright notice from directories that are external (GFDL_fms, RRTMG, NCEP_Shared, LANL_Shared)
Using plain ol' cp, copy the copyrighted CVS into the SVN directory:
cd /path/to/svn/directory/branches/Icarus-2_0/src
cp -rv /path/to/cvs/directory/Icarus-2_0/GEOSagcm/src/* .
Now remove the CVS directories using find:
find . -type d -name 'CVS' -exec rm -rf {} +
You can see all the files that must be added by doing a:
cd /path/to/svn/directory/branches/Icarus-2_0/src
svn status | grep "^?"
What we need to do is add those.
Note: Before blindly adding all new files, some big tarballs from the Surface Shared directory might be there as well as some large NC4 files from LANL_cice. For sanity's sake, you should 'rm' or 'svn delete' these from the branch:
$ rm GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/Raster/data/MOM/120x65/grid_spec.nc.gz
$ rm GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/Raster/data/MOM/360x200/grid_spec.nc.gz
$ rm GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/Raster/data/MOM/720x410/grid_spec.nc.gz
$ rm -rf GMAO_Shared/LANL_Shared/LANL_cice/input_templates
Or perhaps (all in one):
find . -type d -name 'CVS' -exec rm -rf {} +
find . -iname '*.nc' -exec rm {} +
find . -iname '*.nc.gz' -exec rm {} +
rm -rf GMAO_Shared/LANL_Shared/LANL_cice/input_templates
Running:
svn add `svn status | grep "^?" | awk '{print $2}'`
will add all the un-added files. It's good to make sure they are expected.
At this point, you can do an xxdiff between the CVS and the SVN checkout:
$ xxdiff /path/to/svn/directory/branches/Icarus-2_0/src /path/to/cvs/directory/Icarus-2_0/GEOSagcm/src
If all is well there should be either 0 differences or 1 difference (the grid_spec files above. If there are more differences, that usually means you need to svn delete files that were removed between versions of the model. Go through these one-by-one until the only difference is grid_spec or none at all.
If you like, you can do the above copyright work on the CVS checkout and then do a diff. If you did things right, you should only see diffs with the MOM tarballs above:
$ diff -rq --exclude='.svn' --exclude='CVS' --exclude='*.nc' /path/to/svn/directory/branches/Icarus-2_0/ /path/to/cvs/directory/Icarus-2_0/GEOSagcm/
$ svn commit -m "geos: Update to code from Icarus-2_0 CVS checkout."
Now make sure the branch can actually be built on discover:
$ cd /path/to/model/directory
$ mkdir Icarus-2_0-SVN
$ cd Icarus-2_0-SVN
$ svn checkout https://geos5.org/svn/branches/Icarus-2_0 GEOSagcm
$ cd GEOSagcm/src
$ make install |& tee make.log
If there are issues, fix them. Most likely ones are g5_modules isn't quite right, or a copyright was put in in the wrong format. Make note of the latter issues since the HandleCopyright.py script needs to handle them correctly.
Make sure to commit all changes to the SVN repo.
Once the code builds, if it's not a feature branch, but the latest code, this should be merged to trunk. In this case, we're going to use old-style merges. In order to do so, we need to know the revision we copied from the trunk, and the revision that is latest on our branch:
$ cd /path/to/svn/directory/branches/Icarus-2_0
$ svn update
Updating '.':
At revision 415.
$ svn log --stop-on-copy
------------------------------------------------------------------------
r415 | geos | 2017-07-26 08:06:39 -0400 (Wed, 26 Jul 2017) | 1 line
geos: Update to code from Icarus-2_0 CVS checkout.
------------------------------------------------------------------------
r414 | geos | 2017-07-26 07:57:26 -0400 (Wed, 26 Jul 2017) | 1 line
geos: created Icarus-2_0 branch
------------------------------------------------------------------------
Note the value of the revision that was on trunk when we branched. Now we need to do the merge on the trunk and take all updates since that on our branch:
$ cd /path/to/svn/directory/trunk
$ svn update
At revision 415.
So, we have to merge from revision 249 to revision 293 (note, some commits were not on this branch):
$ svn merge -r414:415 https://geos5.org/svn/branches/Icarus-2_0
--- Merging r415 into '.':
U src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSmkiau_GridComp/GEOS_mkiauGridComp.F90
U src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOS_PhysicsGridComp.F90
U src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/GEOS_MoistGridComp.F90
U src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/cloudnew.F90
U src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSchem_GridComp/GEOS_ChemEnvGridComp.F90
...
U src/GMAO_Shared/GEOS_Util/plots/grads_util/stats_montage
U src/GMAO_Shared/GEOS_Util/post/gcmpost.script
U src/GMAO_Shared/GEOS_Util/post/GNUmakefile
U src/GMAO_Shared/GEOS_Util/post/gcmclim.script
--- Recording mergeinfo for merge of r415 into '.':
U .
Now run a diff:
$ diff -r --exclude='.svn' /path/to/svn/directory/trunk/src /path/to/svn/directory/branches/Icarus-2_0/src
That diff should so no difference.
Now we need to commit with a VERY SPECIFIC MESSAGE so that if there are any updates on the branch, we can correctly merge them to trunk.
$ svn commit -m "geos: Merged branches/Icarus-2_0 changes r414:415 into the trunk."
Now the trunk and branches/Icarus-2_0 should be identical.
$ svn diff https://geos5.org/svn/trunk https://geos5.org/svn/branches/Icarus-2_0
svn copy https://geos5.org/svn/trunk https://geos5.org/svn/tags/Icarus-2_0 -m "geos: Create Icarus-2_0 tag"
diff -r --exclude=".svn" sub/dir/one sub/dir/two
Category:SI Team Category:SVN