Created
March 1, 2014 20:05
-
-
Save meeuw/9296294 to your computer and use it in GitHub Desktop.
script to cherrypick a list of subversion revisions
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
#!/usr/bin/python | |
import subprocess | |
import fileinput | |
if False: | |
revs = [] | |
for line in subprocess.check_output(['svn', 'merge', '../branches/dev', '--dry-run']).split('\n'): | |
if line.startswith('--- Merging'): | |
s = line.split(' ') | |
revs.append((s[2][1:], s[4][1:])) | |
for rev in revs: | |
log = '' | |
for line in subprocess.check_output(['svn', 'log', '../branches/dev', '-r%s:%s' % rev]).split('\n'): | |
if line == '-'*72: | |
print log | |
log = '' | |
else: | |
log += line+' ' | |
else: | |
revs = [] | |
for line in fileinput.input('merge.txt'): | |
cmd = line.split(' ')[0].strip() | |
if cmd: | |
revs.append('-c'+cmd[1:]) | |
subprocess.check_call(['svn', 'merge', '../branches/dev'] + revs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment