Sunday, 4 July 2010

Excluding folders while checking out an SVN repository

Blogging this entry out of frustration of not finding an easier way to exclude selected folders while ‘svn checkout’ing a huge svn repository.

I had to checkout all folders from webkit trunk repository except this folder – LayoutTests, which was not really necessary for my work. I was not interested in downloading it, as it was really huge and could consume lots of time and bandwidth in downloading it.

Unfortunately ‘svn:ignore’ couldn’t helped me in achieving this as I was thinking earlier :(. ‘svn:ignore’ is meant only for ignoring files/folders while committing/adding them to repository, but not for checking out or updating a repository.

After googling for a while came to know that only way of achieving this is to use Sparse Checkouts feature which was introduced since SVN v1.5.

However, solution is not straight forward. we have to checkout with an option of --depth=immediates which would checkout all files and folders (excluding everything from sub-folders). Then ‘svn up’ individual folder which we are interested in.

I was really not satisfied by this solution. This doesn’t help much in addressing the problem if we do have large number of folders and are in different levels in folder hierarchy.

Can this be a new feature for svn toolset? or do any one have a better approach for this problem? Let me know.

3 comments:

vprajan said...
This comment has been removed by the author.
vprajan said...

Have you tried this ?

http://svnbook.red-bean.com/en/1.1/ch07s04.html

I think its possible to do external checkouts into same directory using multiple repositories. Same thing could be used to solve your problem.

But yes.. you need some externals file configured in server side itself.. since it looks like, you don't have prop access to it..

Hiệp Lê tuấn said...

I've just faced them same problem like you. Do you find any approach for it?

Thanks,