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.
14 FILELIST
= 'textfiles'
15 COUNT
= 1000 # this many commits
16 MAXFILES
= 10 # up to 10 files at a time
18 files
= open(FILELIST
).readlines()
22 for i
in range(COUNT
):
23 n
= random
.randrange(1, MAXFILES
+1)
25 print "echo '--- begin commit #%d -----------------------------------'" % (i
+1,)
27 fname
= random
.choice(files
)[:-1] # strip trailing newline
28 print "echo 'part of change #%d' >> %s" % (i
+1, fname
)
30 print "svn commit -m 'commit #%d' %s" % (i
+1, ' '.join(l
))