These instructions help you set up a Subversion sandbox to play with. This sanbox is not the place to put your real work. It's only a place to help you explore how subversion works. Once you've figured out what you are trying to learn, you need to document and carry out the steps on the official repository.
These instructions center around getting comfortable with managing vendor drops.
Note: you should be comfortable with this before you attempt to do it on the main repository. Ask for help on uabgrid-dev@vo.uabgrid.uab.edu before you try anything against the main repositories.
This example focuses on GridWay as our vendor.
Scenario 1: A basic sandbox
Create the Sandbox Repository
The TMPSVNROOT environment variable is the only one you need to hang on to over the following sections. It points at your Subversion sandbox and all the remaining commands use it.
Create and configure the repository structure
TMPSVNROOT=`mktemp -d --tmpdir` svnadmin create $TMPSVNROOT reposetup=`mktemp -d --tmpdir` pushd $reposetup mkdir branch tags trunk vendor svn import . file:///$TMPSVNROOT --message 'Initial repository layout' popd rm -rf $reposetup unset reposetup
Import the Vendor Source
We start off with our work with an official vendor release, GridWay 5.4.0.
- Download the 5.4 release
- Unpack it so you can import the source
importsrc=`mktemp -d --tmpdir`
tar -x -C $importsrc -f gw-5.4.0.tar.gz
tag=5.4.0
pushd $importsrc
svn import $importsrc/gw-$tag \
file:///$TMPSVNROOT/vendor/gridway/current \
-m "importing gw-$tag vendor drop"
svn copy file:///$TMPSVNROOT/vendor/gridway/current \
file:///$TMPSVNROOT/vendor/gridway/$tag \
-m "tagging gw-$tag"
svn copy file:///$TMPSVNROOT/vendor/gridway/$tag \
file:///$TMPSVNROOT/trunk/gridway \
-m "bringing gw-$tag into the main branch"
popd
rm -rf $importsrc
unset importsrc
Confirm /trunk Works
Test the repository by checking out a working copy of the code from /trunk in your sandbox repository. You would then use this working copy for your "development". Remember this is all pretend, so this only test development not your real stuff.
work=`mktemp -d --tmpdir` cd $work svn co file:///$TMPSVNROOT/trunk/gridway cd gridway svn log
You can commit changes you make to the code and tag your "releases" for tracking purposes.
Clean up after yourself
When you are done exploring you can remove the test repository and working directory.
cd rm -rf $work unset work
rm -rf $TMPSVNROOT unset TMPSVNROOT
Scenaro 2: Catching up with the vendor
While you've been busy coding (playing), the vendor has too. You've noticed there are some problems with the version you're working with and would like to get the latest changes from the vendor. You want to integrate your updates to the code with this latest version.
Apply Fixes for the 5.4 release to /trunk/gridway
There was a fix or two that needed to be applied to GridWay in order for it to compile. Make sure to apply the fixes that you made in your working copy. Tag this revision.
Note: build gridway from an export of /trunk/gridway. That is, don't build inside your working dir unless you intend to be careful about not cluttering subsequent imports with the artifacts of the build process.
Import GridWay? 5.5-cvs-2005-03-25
Important: the date will be used for the tag to track the specific state of GridWay? Head we are treating as our vendor drop. The policies for this depend on who the vendor is and what release of their code your are tracking.
importsrc=`mktemp -d --tmpdir`
pushd $importsrc
tag='2009-03-25'
cvs -d ':pserver:anonymous@cvs.globus.org:/home/globdev/CVS/globus-packages' export -d gridway -r :$tag gridway
/usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl \
-t gridway-5.5-cvs-$tag \
file:///$TMPSVNROOT/vendor/gridway \
current \
$importsrc/gridway
popd
rm -rf $importsrc
unset importsrc
Get a working copy
If you don't have your working copy of /trunk/gridway from Scenario 1, get a copy again
work=`mktemp -d --tmpdir` cd $work svn co file:///$TMPSVNROOT/trunk/gridway cd gridway svn log
Merge your working copy with the vendor changes
A merge is the process of identifying the differences between two vendor releases, in this case Gridway 5.4.0 and 5.5-cvs-2009-03-25, and applying those differences to your working copy. This process has the effect of *merging* your changes to the original vendor drop that's formed the bases of your /trunk with the changes from the latest vendor drop you just imported.
Note: these revision numbers 2:6 will work if you've just followed the scenarios without any other commits. Be sure you use the correct starting and ending revisions. If your working with these scenarios and have made some commits of your own between the vendor drops, just adjust the last revision number (you should see it in the svn log output).
cd $work/gridway svn merge -r 2:6 file:///$TMPSVNROOT/vendor/gridway/current .
You now have a work copy that has been modified to be at the state of the latest vendor drop, plus any changes you made. It may have conflicts with your local changes, so fix them if they exist. After you are happy that the state is good, commit the working copy to /trunk. Now your /trunk is up to date.
cd $work/gridway svn commit -m "Merged changes with gw-5.5-cvs-2009-03-25"
Experimental: Working with svn_load_dirs.pl
This is experimental. It seems to focus on the /vendor branch only. That is, it doesn't do anything about merging. This is good but it seems better to get comfortable with the manual process instead.
You can install this command on openSUSE11 with yast -i subversion-tools. The command is found in /usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl
- Create a sandbox repo as above.
- Get your vendor drop for the starting point, e.g. GridWay?-5.4 release
- Download the 5.4 release
- Unpack it so you can import the source -- apparently svn_load_dirs.pl doesn't work if we don't yet have a vendor drop in place, so start with the old-fashioned way.
importsrc=`mktemp -d --tmpdir` tar -x -C $importsrc -f gw-5.4.0.tar.gz tag=5.4.0 pushd $importsrc svn import $importsrc/gw-$tag \ file:///$TMPSVNROOT/vendor/gridway/current \ -m "importing gw-$tag vendor drop" svn copy file:///$TMPSVNROOT/vendor/gridway/current \ file:///$TMPSVNROOT/vendor/gridway/$tag \ -m "tagging gw-$tag" svn copy file:///$TMPSVNROOT/vendor/gridway/$tag \ file:///$TMPSVNROOT/trunk/gridway \ -m "bringing gw-$tag into the main branch" /usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl \ -t gridway-5.4.0 \ file:///$TMPSVNROOT/vendor/gridway \ current \ $importsrc/gridway-5.4.0
- Import into your sandbox
- Get a later release and import it
importsrc=`mktemp -d --tmpdir` pushd $importsrc tag='2009-03-25' cvs -d ':pserver:anonymous@cvs.globus.org:/home/globdev/CVS/globus-packages' export -d gridway -r :$tag gridway /usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl \ -t gridway-5.5-cvs-$tag \ file:///$TMPSVNROOT/vendor/gridway \ current \ $importsrc/gridway
