Follow-up to r29036: Now that the "mergeinfo" transaction file is no
[svn.git] / tools / dev / random-commits.py
blob04f0829bce239340fe268358ecf431413ff20e9b
1 #!/usr/bin/env python
3 # USAGE: random-commits.py
5 # Using the FILELIST (see config below), a series of COUNT commits will be
6 # constructed, each changing up to MAXFILES files per commit. The commands
7 # will be sent to stdout (formatted as a shell script).
9 # The FILELIST can be constructed using the find-textfiles script.
12 import random
14 FILELIST = 'textfiles'
15 COUNT = 1000 # this many commits
16 MAXFILES = 10 # up to 10 files at a time
18 files = open(FILELIST).readlines()
20 print '#!/bin/sh'
22 for i in range(COUNT):
23 n = random.randrange(1, MAXFILES+1)
24 l = [ ]
25 print "echo '--- begin commit #%d -----------------------------------'" % (i+1,)
26 for j in range(n):
27 fname = random.choice(files)[:-1] # strip trailing newline
28 print "echo 'part of change #%d' >> %s" % (i+1, fname)
29 l.append(fname)
30 print "svn commit -m 'commit #%d' %s" % (i+1, ' '.join(l))