Using svn:externals to integrate external sources in your own development code base

Sometimes, you have to include an external library in your code base and would like to get updates for this immediately as they are published. For example: you have included the zend framework in your PHP application and would like to get updates as soon as possible into your development code base.
The best way is to include their svn code base into yours. But, your code base is located in your own svn. The solution is to use svn:Externals. This facility allows to integrate an external repository into your local checked out repository without pushing the external library into your repository while still be able to update from theirs. This is the major difference from simply placing their code in your local code base and choosing svn:ignore.
I explain how to use svn:Externals with tortoise svn. It would also be possible with the command line tool.
To make use of svn:external, select the directory you would like to include the external library into. (_lib/ in the example). Make a right click to open the context menu and chose “Tortoise SVN -> Properties”

A dialog opens to edit the properties. Choose “New > Externals”

In the second dialog that opens to edit the externals click on “New …” to configure the new svn:externals settings.

In this dialog, you can specify the name of the subdirectory you would like to place in the external sources (“Zend” in the screenshot) as well as the svn url you would like to checkout the sources from (Zend version 1.11 in the screenshot). As shown in the example, you can choose the head of a branch for a specific version, for example, to get the bug fixes and patches for a specific release.
As soon as you have confirmed all these dialogs by clicking “OK”, you can perform an svn update on the base directory you added the svn:external dependency to and tortoise svn will immediately start to download the external content.

In the example shown in the screenshot, I have included the Zend Framework Release 1.11 as an external dependency in my php application code base.
Zend framework release repository: http://framework.zend.com/svn/framework/standard/branches/release-1.11/library/Zend/

Leave a Comment