Assume that you have a directory under subversion control, that contains some files and tons of subdirectories, like that:
file1.txt
file2.txt
file3.txt
dir1/
di
For anyone who comes across this later, and uses TortoiseSVN, here is how to do the same thing...
(Note: This was done with TortoiseSVN 1.7.5, and may vary for other versions.)
You can try this trick involving a local repository and svn:externals declarations.
Haven't tried it myself, though.
What I'm trying to do cannot be done with Subversion 1.4 or Subversion 1.5; Period.
No work around exists, that's just the way it is.
It can be done with Subversion 1.6, though.
Unlike SVN 1.5, SVN 1.6 can reduce the depth on a directory
svn up --set-depth exclude dir2
is the solution. It sets the depth for dir2 to zero and it will immediately vanish from the checkout and no update will bring it back, unless you explicitly set the depth of this directory to a value again (or just do an update on it without depth option, since not giving any depth always means infinity, unless you use non-recursive, which means "files").
TIP:
Actually SVN 1.6 cannot really reduce the depth the same way it can increase it. You can increase it from any level to any higher level. You can only reduce it to "exclude" (the lowest level of all). If you want to reduce from "infinity" (highest) to "files" (somewhere in the middle), you must first reduce it to "exclude" (causing the directory to vanish) and then increase it back again to "files". This is a bit of a hack, but it works just nice.
Update: I'm running SVN 1.6.11 and I was able to de-telescope using svn up --set-depth empty dir
rather that having to exclude
the directory.
With svn 1.6, --set-depth
is the answer.
With svn < 1.6, you can get sparse checkouts by abusing svn switch
: Create an empty directory somewhere in your repository, and switch
the subdirectories you don't need right now to point to that instead of their "real" URL.