I have a project with a directory structure like this:
project
|--source
|--fgh
|--...
|--ijk
`--tests
|--abc
|--cde
|--...
|--utils
I want to checkout the source
and tests/utils
directories (and everything inside recursively). Remainder directories (like abc
, cde
, ...) should not be checked out since they are huge.
I think svn co --depth empty
is what I'm looking for. But then how to check out only tests/utils
if test
doesn't exist after the checkout is done?
You are on the right track - do it like this:
svn co [REPO-URL] --depth emtpy
svn up [PROJECT]/source --depth infinity
svn up [PROJECT]/tests --depth empty
svn up [PROJECT]/tests/utils --depth infinity
Edit: LazyBadger is arguing that "--set-depth
for svn up
will be more correct way". Well, the SVN documentation quite clearly states for the --set-depth
option (emphasis mine):
It is with this option that you can change the sticky depth of a working copy item.
However in this case, we are not changing any previously checked out working copy item - We're building a (sparse) working copy from scratch, step by step. So why would --set-depth
be more correct? It isn't. But for completeness, if you'd like to type a bit more, you could also do:
svn co [REPO-URL] --depth emtpy
svn up [PROJECT]/source --set-depth infinity
svn up [PROJECT]/tests --set-depth empty
svn up [PROJECT]/tests/utils --set-depth infinity