Skip to content

Instantly share code, notes, and snippets.

@slackorama
Last active February 2, 2016 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slackorama/cabefcf6fc13f03a6dfe to your computer and use it in GitHub Desktop.
Save slackorama/cabefcf6fc13f03a6dfe to your computer and use it in GitHub Desktop.
Recursively checkout a directory tree (and just the directories) w/svn
#!/usr/bin/env python
"""
Recursively checkout a directory tree (and just the directories)
"""
import subprocess
import sys
import os
dirs = sys.argv[1:]
def update_directory(path):
print(path)
print(subprocess.check_output(['svn', 'update', '--set-depth', 'empty',
path]))
output = subprocess.check_output(['svn', 'ls', path])
output = output.split('\n')
print(len(output))
for check in output:
if check.endswith('/'):
update_directory(os.path.join(path, check))
for d in dirs:
update_directory(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment