Last active
February 2, 2016 18:16
-
-
Save slackorama/cabefcf6fc13f03a6dfe to your computer and use it in GitHub Desktop.
Recursively checkout a directory tree (and just the directories) w/svn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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