fix current directory restoring and svn update parsing

This commit is contained in:
Arvid Norberg 2013-06-16 22:51:03 +00:00
parent 4a10778b88
commit f3d144b06f
2 changed files with 42 additions and 34 deletions

View File

@ -19,6 +19,8 @@ def svn_fetch():
for l in p.stdout:
if 'At revision ' in l:
revision = int(l.split('At revision')[1].strip()[0:-1])
if 'Updated to revision ' in l:
revision = int(l.split('Updated to revision')[1].strip()[0:-1])
output += l
if revision == -1:

View File

@ -210,7 +210,10 @@ def main(argv):
print 'toolsets: %s' % ' '.join(toolsets)
# print 'configs: %s' % '|'.join(configs)
rev_dir = os.path.join(os.getcwd(), 'regression_tests')
current_dir = os.getcwd()
try:
rev_dir = os.path.join(current_dir, 'regression_tests')
try: os.mkdir(rev_dir)
except: pass
rev_dir = os.path.join(rev_dir, '%d' % revision)
@ -253,6 +256,9 @@ def main(argv):
f = open(os.path.join(rev_dir, build_platform + '#' + toolset + '.json'), 'w+')
print >>f, json.dumps(results)
f.close()
finally:
# always restore current directory
os.chdir(current_dir)
if __name__ == "__main__":
main(sys.argv[1:])