Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Forked from mcfearsome/get_svn_externals.py
Created October 24, 2008 14:35
Show Gist options
  • Save matschaffer/19440 to your computer and use it in GitHub Desktop.
Save matschaffer/19440 to your computer and use it in GitHub Desktop.
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