Title: Subversion intro Subject: Basic usage of subversion ------------------------------ 1. Install subversion on gentoo echo 'dev-util/subversion -apache2' >> /etc/portage/package.use emerge --update --newuse subversion 2. Create and check out a repository svnadmin create $HOME/svn_rep svn co file://$HOME/svn_rep svn_checkout 3. Add files to this repository cp my_linux_notes.txt $HOME/svn_checkout/ svn status $HOME/svn_checkout svn add $HOME/svn_checkout/* svn checkin -m 'initial import' 4. Edit the files in this repository echo 'man is the man who can RTFM' >> svn_checkout/my_linux_notes.txt svn status $HOME/svn_checkout/ svn status -v $HOME/svn_checkout/ svn checkin -m 'Notes about man' $HOME/svn_checkout/my_linux_notes.txt 5. Now look at the hisotry of this file svn log $HOME/svn_checkout/my_linux_notes.txt 6. Now check out the older version of the file svn up -r 1 $HOME/svn_checkout/my_linux_notes.txt 7. Show difference between new and old versions svn diff -r1:HEAD $HOME/svn_checkout/my_linux_notes.txt 8. Get list of subversion commands svn help 9. Get help on specific subversion command svn help ------------------------------ You would backup $HOME/svn_rep (the repository holding all data and hisotry) You can recreate $HOME/svn_checkout (the working copy) --------------------------------- Vendor Brnaches - custom modificaitons to third-party data, including new funcitons or bug fixes, maintained internally until they become part of the third-part release, or maybey never returned to third-party. 'vendor drop'- each verison of the orignal data Benefits: 1. known good vendor-drop version ensures thrid-party version works 2. custom changes can be stored in your repository Management procedure: # # Create Vendor branch directory # svn mkdir svn_MYAPP/VENDOR_libs -m 'create vendor branch VENDOR_libs' # # Import VENDOR_libs # svn import svn_VENDOR_libs/trunk svn_MYAPP/VENDOR_libs/current -m 'VENDOR_libs import' # # Tag # svn cp svn_MYAPP/VENDOR_libs/current svn_MYAPP/VENDOR_libs/VENDOR_libs-r2345 -m 'tagging vendor branch' # # Copy tag to main development branch (/trunk/) # svn cp svn_MYAPP/VENDOR_libs/current svn_MYAPP/trunk/VENDOR_libs -m 'adding vendor branch to trunk' # ##################################### # Update vendor brnach: ##################################### # # Checkout vendor branch # svn export https://svn/VENDOR_libs/trunk svn_VENDOR_libs # # copy right over the top of existing current. # rsync -avz --delete --exclude .svn svn_VENDOR_libs/ svn_MYAPP/VENDOR_libs/current # # Show all files added, removed or changed # svn status svn_MYAPP/VENDOR_libs/current # # Run svn add on any new files # svn add -R svn_MYAPP/VENDOR_libs/current # # Run svn del on any files messing # svn del ...... # # Commit 'current' now that it contains the new version # svn ci svn_MYAPP/VENDOR_libs/current # # Tag it # svn cp svn_MYAPP/VENDOR_libs/current svn_MYAPP/VENDOR_libs/VENDOR_libs-r2380 -m 'tagging vendor branch' # # merge the differences between the tag of the previous version # and the new current version into our main development branch. # svn merge svn_MYAPP/VENDOR_libs/VENDOR_libs-r2380 svn_MYAPP/trunk/VENDOR_libs -m 'mergeing updates from vendor branch'