Setting up a new SVN repository

Since I rarely tend to setup new $g(SVN source repositories) I find myself googling for the syntax of the various commands so I’m writing this post to myself for future reference. I’m starting a new website project at work and needed a new repository created with a few external folder references to another project. After creating a bootstrap set of directories and files from pieces of another project then needed to create the new repository. My folder structure looks like this:

~/work/publishing <- location of new project files/folders

cd ~/work
svn import -m "Initial revision" publishing https://svn/repos/publishing/trunk

The project has two folders which will come from an existing project that won’t be modified in this new project so I’m using svn:externals to reference those folders. I’m not sure this was the best way to do it but since I have several other people who will be using the repository I decided to check it out locally:

cd ~/work
svn co https://svn/repos/publishing pub

Next, I changed to the subfolder where the two external folders are located:

cd ~/work/pub/trunk/application

Then using svn propedit I created two external links though the first time through I got it wrong. Note, the quotes are important here:

SteveT:application strefethen$ svn propset svn:externals 'model https://svn/repost/proj/trunk/application/lib' .
property 'svn:externals' set on '.'
SteveT:application strefethen$ svn up
svn: warning: Error handling externals definition for 'model':
svn: warning: OPTIONS of 'https://svn/repost/proj/trunk/application/model': 200 OK (https://svn)
At revision 24431.

The problem in this case was my mistyping “repos” adding a “t” (bolded above). Next, I made the mistake of using propset twice for two different externals (model and lib) which yielded the following when I tried to update:

SteveT:application strefethen$ svn up
svn: warning: Error handling externals definition for 'model':
svn: warning: URL '' at revision 24431 doesn't exist
At revision 24431.

At this point, I needed to use svn propedit to create two external folder references but I didn’t have any editor set to make these changes which yielded:

SteveT:application strefethen$ svn propedit svn:externals .svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found. I edited my .bash_profile adding an SVN_EDITOR environment variable
mate ~/.bash_profile


export SVN_EDITOR="mate -w"

Save an close TextMate. Then source my .bash_profile to get the changes:

source ~/.bash_profile

Now I could finish editing the svn:externals as follows:

svn propedit svn:externals .

The lib external was already defined from my previous propset command so I just needed to the model external making my svn:externals look like this:

lib https://svn/repos/proj/trunk/application/lib
model https://svn/repos/proj/trunk/application/model

Now when I update both external folders are updated:

SteveT:application strefethen$ svn up
Fetching external item into 'model'

External at revision 24431.

Fetching external item into 'lib'
External at revision 24431.

At revision 24431.

Finally, I committed my changes to the application folder for these externals. 

SteveT:application strefethen$ svn commit
Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
Sending        application
Committed revision 24432.

Not sure this is going to be helpful for anyone else but I can certainly make use of it in the future.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.