Adding an External SVN Resource With Tortoise SVN

Most of my projects are usually checked out at several different computers and several different operating systems. For Windows, there is The One SVN Client Above All Else, namely TortoiseSVN. As Christer and I’ve been working on an unnamed project lately, we’ve built up a set of resources in regards to basic functionality (user registration, user verification, access management, etc). These resources have become a small framework for a basic site, so I’ve adopted the set of files for several other projects. When using the “Framework” in other codebases, I still want to keep the framework versioned against the original SVN repository, so that if Christer commits his Überkool Must Have Feature v2.5 to the framework, I get all the magic with a single svn up.

The magical way ofdoing this is using the svn:external property to tell svn that you depend on an external repository. The property is set on the parent directory, and contains the value Directory RepositoryURL; i.e:

Property Value
svn:externals Framework https://svn.example.com/Framework/trunk/Framework

To set a property using TortoiseSVN, right click on the parent directory (i.e. libs or whatever you prefer to call your directory of common code), and select “TortoiseSVN” and “Properties”. Click “Add” and select svn:externals from the pulldown menu. In the value field you simply add Framework https://svn.example.com/Framework/trunk/Framework. Close the dialogs and select SVN Update when right clicking on your libs directory. This will create a directory named Framework in libs and check out the svn repository to the directory.

Voilá!

UPDATE: Erik Hansen adds:
In order for Tortoise to “Update” your local copy with the external files, you first need to commit the property change to the REPO before it will do that.

Tags: , ,

4 Responses to “Adding an External SVN Resource With Tortoise SVN”

  1. Erik Hansen Says:

    I was looking for how to do this. One thing you might want to mention: In order for Tortoise to “Update” your local copy with the external files, you first need to commit the property change to the REPO before it will do that.

  2. Mats Says:

    Thanks for the comment, I’ll add it to the main text.

  3. SVN Externals for CSE Repo using TortoiseSVN Says:

    [...] this can be done with any SVN client (including the geekey command line client). Thanks to this and this, now things are working [...]

  4. Andrew Says:

    Thanks Mat… Havn’t used externals much before, article was a great help.

Leave a Reply