Howto: Subversion externals basics
Here's a quick howto on using subversion externals to load other subversion repositories into various directories of your project. We use this at "work":http://www.rainstormconsulting.com to load in shared classes so that they're versioned in one location. We could possibly use something like "PEAR":http://pear.php.net to provide some of those but this method is nicer I think, and all in one spot. To setup an external for a directory in your repository, I typically start at the root project directory, say MyProject, and set it there. Externals are a "subversion property":http://svnbook.red-bean.com/nightly/en/svn.advanced.props.html which holds some text as to what to what paths pull from what URLs. The easiest method to edit externals I think is to use the svn propedit command. This will require you to have an editor set for EDITOR or SVN_EDITOR environment variable (and this applies to unix/osx type systems) before you can successfully use svn propedit. The actual property name is svn:externals and we can use the commands svn propset or propedit etc. to work with it, easiest is propedit so that's what I'll demonstrate.
$ cd MyProject $ export SVN_EDITOR=vim $ svn propedit svn:externals .
Now you can make changes to the externals of the current directory specified by '.', you can specify a path-url combination per line, then save and exit your editor to finish the change. The path part comes first, and is relative to where your setting the external. Example of the format:
classes/MyUtilities http://example.com/svn/MyUtilities/classes
Once your done adding externals, you can run svn update to actually pull down the external, you'll need to commit to actually push the external property change to the server so anybody else working on the project gets it too.
$ svn update $ svn commit -m 'Added external for classes/MyUtilities'
There, any changes made to the other repository or path will come down when you do svn update. You can also commit changes within that external's directory by just entering that and doing normal subversion commands.
Technorati Tags: howto, programming, subversion, svn, tutorial
10:00 AM | 0 Comments | Tags: externals, howto, subversion, tutorial