Created
November 23, 2011 14:30
-
-
Save robballou/1388802 to your computer and use it in GitHub Desktop.
'svn up' all the directories
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
""" | |
Update all directories in the svn directory | |
""" | |
import sys | |
import os | |
import subprocess | |
def svnup(directory): | |
items = os.listdir(directory) | |
for item in items: | |
this_directory = "%s/%s" % (directory, item) | |
if item.startswith('.') or not os.path.isdir(this_directory) or not os.path.isdir("%s/.svn" % this_directory): | |
continue | |
print "svn up %s" % this_directory | |
pipe = subprocess.Popen('svn up %s' % this_directory, shell=True, stdout=subprocess.PIPE).stdout | |
print pipe.read() | |
if __name__ == '__main__': | |
directory = os.path.expanduser("~/svn") | |
if len(sys.argv) > 1 and os.path.exists(sys.argv[1]): | |
directory = sys.argv[1] | |
svnup(directory) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment