-
-
Save matschaffer/19440 to your computer and use it in GitHub Desktop.
This file contains 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
import commands | |
from string import Template | |
tmpl = Template("git-svn clone $repo $folder") | |
def getCommandOutput(command): | |
status, output = commands.getstatusoutput(command) | |
if status != 0: | |
raise RuntimeError, '%s failed w/ exit code %d' % (command, status) | |
return data | |
def get_externals(): | |
commands = [] | |
cmd_output = [] | |
externals_file = open('svn.externals','r') | |
for line in externals_file.readlines(): | |
parts = line.split(" ") | |
d = dict(repo=parts[1].replace("\n",""),folder=parts[0]) | |
commands.append(tmpl.substitute(d)) | |
for cmd in commands: | |
cmd_output.append(getCommandOutput(cmd)) | |
for output in cmd_output: | |
print output | |
if __name__ == '__main__': | |
get_externals() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment