code_junkie

SVN checkout ignore folder

Nov 11th, 2011
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. $ svn co http://subversion/project/trunk my_checkout --depth immediates
  2.  
  3. $ cd my_checkout && ls
  4. bar/ baz foo xyzzy/
  5.  
  6. $ cd bar && svn update --set-depth infinity
  7.  
  8. svn co -N foo
  9. cd foo
  10. svn up -N bar
  11. svn up
  12.  
  13. # Path to the svn repository to be checked out
  14. rpath=https://svn-repo.company.com/sw/trunk/ &&
  15. # This files are to be excluded (folders are ending with '/')
  16. # this is a regex pattern with OR ('|') between enties to be excluded
  17. excludep='docs_folder/tests_folder/|huge_folder/|file1|file2' &&
  18. # Get list of the files/folders right under the repository path
  19. filtered=`svn ls $rpath | egrep -v $excludep` &&
  20. # Get list of files out of filtered - they need to be 'uped'
  21. files=`echo $filtered | sed 's| |n|g' | egrep '^.*[^/]$'` &&
  22. # Get list of folders out of filtered - they need to be 'coed'
  23. folders=`echo $filtered | sed 's| |n|g' | egrep '^.*[/]$'` &&
  24. # Initial nonrecursive checkout of repository - just empty
  25. # to the current (./) working directory
  26. svn co $rpath ./ --depth empty &&
  27. # Update the files
  28. svn up $files &&
  29. # Check out the all other folders finally.
  30. svn co `echo $folders | sed "s|<|$ubrpath|g"`
Add Comment
Please, Sign In to add comment