References on Subversion
This article contains three parts. The first part is for LONI clients who simply want to connect to the LONI subversion repository. The second part is for both admin’s and users as a write-up for various features and tools of subversion. The third part is for LONI admins that want to administrator the websvn site.
Part 1:
To connect to the subversion repository you will need a subversion client. The recommended client is smartsvn. They have a Linux, OS X and Windows version. The software can be found here:
http://www.syntevo.com/smartsvn/download.jsp
Once you have downloaded the software it is time to checkout the code.
When you start the program there should be an option that allows you to check out code. Choose this option. At this point you should be presented with a box asking for “Access Method" Choose:
SVN+SSH
Server Name:
svn.loni.ucla.edu
Repository Path: (This is the path to the location of your repository everyone’s will be different for ccb it would be
/cvs/ccb or pipeline it would be
/cvs/pipeline
Next you will be asked about “Login Name” at this point every project has it own login name. (Ask your project leader for this info.) By early summer of 07 you will be able to use your own login name and password to authenticate rather than the global account.
In the end the path should look like
svn+ssh://@svn.loni.ucla.edu//
IE
svn+ssh://ccb@svn.loni.ucla.edu/cvs/ccb
Note From Ivo
In eclipse menu: window > preferences > team > svn change the default SVN interface from JAVAHL(JNI) to
JavaSVN?(Pure JAVA)“
“Eclipse/Subclipse Use: svn+ssh://svn.loni.ucla.edu/cvs/ccb -- you will be asked for authentication (name/password) later. For more on Subclipse see:
http://subclipse.tigris.org/
Part 2:
1) Basic Subversion Info
a) The Subversion Redbook:
This is the official manual which though published by O'Reilly, is still available for free in PDF & HTML. The nightly build is up-to-date for the latest release of Subversion - v1.3
http://svnbook.red-bean.com/
b) Best Practices for programmer/users read the following:
Chapter 1, section: What is Subversion?
Chapter 1, section: A Quick Start
Chapter 2, section: Subversion in Action
Chapter 3, section: Import
Chapter 3, section: Basic Work Cycle
As the "Basic Work Cycle" write up in the SVN book makes clear, as a user, there are really only a few commands you'll need to know:
- Import - to add an exist project to the SVN system and put it under version control
- Checkout - to get a local "working" copy of this project, now under version control
- Add or Delete - to add or delete files to the project so that SVN is aware of these changes
- Commit - to add changes you make to your local working copy to the SVN server copy of the project
- Update - to receive changes from the server that have been added by someone else
- Info - to get back info on your working copy (can remind you of it's server address and other info)
- Status - lets you know the current status of files in your working copy (helpful when you are about to 'Commit' - it shows what has been added, deleted, modified, etc. since the last commit. svn help status is very informative and makes it clear what all the info in an svn status report means)
- Merge - IF you are jointly working on the same project, merging becomes inevidible. The key to making this as painless as possible, is to put human business rules in place that make it clear who's working on what. In a totally Open Source project with 100s of coders contributing from around the world, that's pretty tough to do - though many projects do it effectively. For us, its much easier to insure we almost never need to merge.
This site (and some of the others below) provide some clear sense of why moving to SVN from CVS is a good idea:
http://www.oreillynet.com/onlamp/blog/2004/09/byebye_cvs_ive_been_subverted.html
As for general info on usage, there's the main Subversion site (
http://subversion.tigris.org/). One can also consult the SVN User Mailing List (which is a very busy list):
http://svn.haxx.se/users/ (archive)
This page also includes lists for TortoiseSVN and Subclipse (see below)
2) Using Subversion to create an automated build system:
This Ars Technica reference really points to all the features specific (and native) to Subversion that make this possible.
http://arstechnica.com/articles/columns/linux/linux-20050406.ars
Your admins may find the following useful, if they plan to install the SVN server on Windows. Doing on a Unix-based OS is really quite easy, and it's well explained in the SVN Redbook.
http://excastle.com/blog/archive/2005/05/31/1048.aspx
3) Subversion binary server (svnserver) + SSL/SSH
a) Fine grained authentication with SVN+SSH:
This is the way we all access our repository. I'm little less concerned with the details of security, but as of v1.3 of Subversion, it is possible to set up very fine grained access rights by group & user. See the following write up by the developer of the PuTTY SSH suite for more info:
http://www.chiark.greenend.org.uk/~sgtatham/svn.html
I would say this is one of the most thorough and insightful detailed descriptions of how to use SVN+SSH
b) basic use of SVN+SSH (using PuTTY)
The following link provides an excellent step-by-step description of how to set up SSH on the server accounts being used, so that on the client you login from, all authentication will be completely automatic. Basically, all SSH suites come with an SSH-agent. You can provide this agent with links to your various keys - public & private.
If you create a public/private key pair on the server account you'll use to login to svn+ssh, then copy that PRIVATE key over to the client where you'll be doing your development, the ssh-agent clients can use this key to auto-magically log you in every time you perform a any transaction with the server. If YOU DON'T set this up, life with Subversion - or any VCS using an SSH encrypted tunnel to protect your data - you will soon loose your mind from all the user/password/passphrase entry you need to do every time you run any command against the server. I CANNOT stress this enough: Set up the ssh-agent, and something like TortoiseSVN (described below) will be no more complicated than using the File Explorer.
Here's the link. The whole document is useful, but the section labeled "Setup SSH" spells out how to rig automatic authentication.
It works like a charm:
http://ozmm.org/docs/subversion_windows_xp.html
You can also check out the following, but the former URL is much more useful and detailed:
http://www.logemann.org/day/archives/000099.html
I would also add this basic scenario works regardless of the client platform you use. I use a nice Cocoa SSH-Agent GUI client for Mac OS X (SSHKeychain -
http://www.sshkeychain.org) which provides a long-lasting (you can set the time out) encrypted tunnels to servers, which all the SVN+SSH software I use on Mac OS X - svnX, command line, and the Netbeans SVN plugin - are all able to take advantage of. Once SSHKeychain opens a tunnel, I can use any one of these SVN tools and never have to login.
Same is true for Linux
(NOTE: The other trick is to follow his recommendation for the SSHD config file - to wit, "# Make sure your SSH configuration file has these lines uncommented: PubkeyAuthentication yes; AuthorizedKeysFile %h/.ssh/authorized_keys"
Just remember, if you run into login/authentication hassles, it probably the SSH setup, not subversion.
c) The PuTTY Windows SSH Suite
Finally, on Linux & Mac OS X, you will have all the SSH/SSL libraries & apps you need as a part of the core OS install. Not so on the every security conscious MS Windows environment. By far, the best way to solve this deficit is to download the complete PuTTY suite of
programs:
PuTTY Download Page:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Just download the whole shabang. Go down to "A .ZIP file containing all the binaries (except PuTTYtel), and also the help files" and download "putty.zip"
Excellent, thorough PuTTY documentation is available here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/docs.html
For use with SVN, really the ozmm.org link above should suffice
d) Win64:
You're probably wondering why I kept saying win32. It turns out the Win64 version (for those of you using
WindowsXP?/64 on AMD chips, for instance - we have two such setups) of TortoiseSVN is still in alpha. There is a work around, and it is easy to set up and definitely works. It turns out Internet Explorer/32-bit is still installed on WinXP/64 systems (and if MS should change this, you can still get it and install it yourself). You can start up IE32 and use it to peruse files and directories on the local disk. If you install TortoiseSVN just as on Win32, it will work just fine via this route.
The detailed procedure for doing this is:
- i) The path to your 32-bit IE is: C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE
- ii) You can make a shortcut to this program on your desktop - giving it an appropriate name like "32-bit Internet Explorer"
- iii) Just double-click this shortcut to start up 32-bit IE.
- iv) Use the "Open File" command, selecting the root directory of one of your algorithm projects.
- v) Save a bookmark to this directory.
- vi) You'll now be exploring the contents of that folder in 32-bit IE and TortoiseSVN (if installed) should be available by simply right-clicking on any of the file or directory icons.
You can also modify the 32-bit IE shortcut you create so the "Start In" directory points to the root of all of the projects you want to put under source control (right-click the shortcut and select "Properties"). This way, when you double-click the short-cut, it will automatically come up with a "File Explorer" view of this directory, and you'll be ready to go from there.
The following URLs explain how to set this up:
http://www.jonathanmalek.com/blog/TortoiseSVNOnWindowsXPX64andOtherShellExtensions.aspx
(brief explanation of the problem and some detailed suggested
work-arounds)
http://tortoisesvn.tigris.org/servlets/ProjectDocumentList?folderID=616&expandFolder=616&folderID=616
(link to the TortoiseSVN 64 alpha build)
4) GUIs for Subversion - some available from the Subversion Downloads site at:
http://subversion.tigris.org/project_packages.html
a) Windows (32-bit)
*
SmartSVN? (
http://www.syntevo.com/smartsvn/download.jsp)
*
TortoiseSVN? (
http://tortoisesvn.tigris.org/):
b) Mac OS X
c) Linux
d) JavaSVN
- A Java-only SVN client library - with a client app built around it.
I've not used it before, but have heard good things about it.http://tmate.org/svn/
5) Subversion IDE plugins
a) NetBeans:
I've been using NetBeans since just after it went beta, at a time when you could never get Eclipse to run very long on Mac OS X without crashing and when only NetBeans had full support for Tomcat Servlet & Axis Web Service development - so this is my IDE of choice.
There has been a Subversion plugin for NetBeans for about 3 years.
Used to be you had to go to the NetBeans VCS site to get it, but now the regular
NetBeans? Updater will provide this. You can still get it from the VCS site and install it manually if you like:
http://vcsgeneric.netbeans.org/profiles/index.html
NetBeans plugins for other Version Control Systems are there as well.
As I mentioned above, once I have my ssh-agent (SSHKeychain) running, the NetBeans SVN integration runs like a charm - totally transparent and tightly integrated into the
NetBeans? project view. It turned out
- however - since I had the SVN command line tools + libraries installed via Fink (for historical reasons). There's now a Mac OS X binary installer available that's really easy to use (
http://metissian.com/projects/macosx/subversion/), and the SVN version he puts out generally stays ahead of the Fink release.
Anyway, if you get the following error when using the SVN plugin in
NetBeans:
"Command "LIST_CMD" has failed. Execution string: /bin/sh -c "cd\"/home/me/development/project/src/.svn\"; svn status -v -N --noignore"
The error output follows, check Runtime for the full output of the command.
svn: '.' is not a working copy
there is a simple workaround. You need to just edit the "SVN_CMD"
property in the svn.xml netbeans module config file. Set it to the absolute path of your svn command-line binary (/sw/bin/svn for Fink - /usr/local/bin/svn for the other binary installer pkg). You'll find that config file located at "~/.netbeans/dev/config/vcs/config/svn.xml," though the name of the actual XML file may vary, if you created your own saved profile for the svn plugin
b) Linux:
KDE KDeveloper
c) Eclipse:
Subclipse is it!!! Very popular and functional much longer than the NetBeans SVN plugin I now use:
http://subclipse.tigris.org/
http://www.ugrad.cs.ubc.ca/~cs319/02T2/projects/Subversion-Integration-for-Eclipse/project-description.html
d) IntelliJ:
IntelliJ works well, but it will cost money.
http://plugins.intellij.net/plugins/
d) XCode:
- i) The old-way:
http://maczealots.com/tutorials/xcode-svn/
- ii) it's now integrated via the XCode Plugin Interface - though some have had trouble with it. I think Apple's got most of the kinks worked out now. The following link gives a pretty good description of how to set the XCode Subversion client up to use SSH, though I'm pretty certain the SSHKeychain technique I use would work just fine:
http://bensyverson.com/geek/svnssh/
e) MS Visual Studio:
There are several options, but I laid off VS back in the late 90's, so I can't vouch for them. Given the size of the customer base, I'm certain one or more of these must be very robust, though I expect many folks just use TortoiseSVN. See:
http://ankhsvn.tigris.org/
http://nidaros.homedns.org/subway/
http://www.pushok.com/soft_svn.php
http://blog.dreamprojections.com/archive/2004/12/16/417.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=159736&SiteID=1
http://svn.haxx.se/users/archive-2005-04/1470.shtml
http://www.gungfu.de/facts/wiki/Main/VisualStudio
Part 3:
Web SVN
See who has control of the web repo then you must go to the httpd.conf file. At the bottom of the file you will see a list of repos and what group has access to them. If a user needs access to a repo make sure they are in the group that is associated with the web repo.
If a part of the repo does not want to be password protected then a rewrite rule must be created.