views:

52

answers:

4

I'm using tortoisesvn to create the repositories and wondered if there was a way it could automatically create a skeleton directory structure within the repository?

I need this as I'm going to allow other people in the team to set-up new repositories and I need to make it as simple as possible and minimise mistakes. I would like the tags, branches and trunk directories to be created automatically.

A: 

As this is just a convention for organizing a Subversion repository and you don't actually want them at the top level all the time I doubt there is a way to do that automatically on repository creation. Usually you don't create multiple repositories per hour or so anyway.

Joey
+2  A: 

You can write a script (in the language of your choice) that creates the repository and commits the predefined directory structure, using the svn command line client.

Eli Acherkan
+1  A: 

Make a script. If you are on Windows, a bat. On Linux etc, an bash.

nanda
+1  A: 

I would suggest the following approach:

  1. create an empty repository
  2. check out a working copy of that empty repository
  3. add trunk/branches/tags folders
  4. set properties on those folders (e.g., if you're using TSVN you might want to set the tsvn:minlogsize and/or the tsvn:autoprops properties)
  5. commit those folders
  6. run svnadmin dump path/to/Repo > templaterepo.dmp

Now you have a template repository with some settings and folders pre-set.

All you need now is a script which does:

  1. svnadmin create path/to/new/Repo
  2. svnadmin load --ignore-uuid path/to/new/repo < templaterepo.dmp

and you're done. But don't forget to pass the --ignore-uuid param to svnadmin load! Otherwise you'll end up with all your repositories having the same uuid - and that will cause problems!

Stefan