views:

64

answers:

3

I am using TortoiseSVN and I have a SVN repository organized in this way:

folder1
  folder2
    trunk
    tag
    branches
  folder3
    trunk
    tag
    branches
  folder4
    folder5
      trunk
      tag
      branches

I would like to know if there is a way to checkout only trunk directories, keeping the entire tree under the versioning control:

folder1
  folder2
    trunk
  folder3
    trunk
  folder4
    folder5
      trunk

In this way I can update all trunks with a single update command on folder1, without updating tags and branches which can be full of data.

A: 

The closest and easiest might be sparse checkouts. That would give you

folder1
  folder2
    trunk
      A
      B
      C
      ...
    tag
    branch
  folder3
    trunk
      A
      B
      C
      ...
    tag
    branch
  folder4
    folder5
      trunk
      A
      B
      C
      ...
      tag
      branch

and the ability to update all in one go.

Or you do this using externals. Create a new folder in your repository which does nothing but refer to other trunks.

sbi
+1  A: 

There are two ways to do this.

  1. Switch the unneeded directories to empty ones. For that you have to have an empty directory somewhere in your repository. Then you first checkout the whole tree, then do
svn switch svn://foo/bar/path/to/empty/dir folder1/folder2/tags
svn switch svn://foo/bar/path/to/empty/dir folder1/folder2/branches

etc.

  1. Starting with 1.5, you can use sparse directories.
Laurynas Biveinis
+1  A: 

Please note, that sparse checkouts are usually the way to go, however Subversion will not allow you to merge with --reintegrate option.

This may sound as a minor problem(eg if you are single user), but you really should think over it and use a proper repository structure.

Your mentioned repository structure will also not allow to tag or branch all project at once.

Peter Parker
+1 That's some good advice.
sbi