blob: 0f9a2960fe4b23e704cd09335097c6c4587539bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/usr/bin/env python
import os, sys
def do_merge(revision_string):
os.system("svnmerge merge -r %s" % revision_string)
os.system("svn commit -F svnmerge-commit-message.txt")
os.system("svn up")
if __name__ == '__main__':
os.popen('svn up').read()
avail = os.popen('svnmerge avail').read().strip()
if not avail:
raise SystemExit, 0
if '-' in avail:
start, stop = [int(x) for x in avail.split('-')]
else:
start = stop = int(avail)
bf = []
other = []
for rev in range(start, stop + 1):
log = os.popen("svn log https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2 -r %s" % rev).read()
if "[bugfix]" in log:
bf.append(rev)
else:
other.append(rev)
if '-v' in sys.argv:
print log,
mrevs = ','.join([str(x) for x in bf])
if '-c' in sys.argv:
print "Revisions %s need merging" % (mrevs)
elif '-f' in sys.argv:
do_merge(mrevs)
else:
a = raw_input('Merge revisions %s: [yN] ' % mrevs)
if a in ['y', 'Y']:
do_merge(mrevs)
|