Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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