3 # mailer-tweak.py: tweak the svn:date and svn:author properties
6 # We need constant dates and authors for the revisions so that we can
7 # consistently compare an output against a known quantity.
9 # USAGE: ./mailer-tweak.py REPOS
17 from svn
import fs
, core
19 DATE_BASE
= 1000000000
23 def tweak_dates(pool
, home
='.'):
24 db_path
= os
.path
.join(home
, 'db')
25 if not os
.path
.exists(db_path
):
28 fsob
= fs
.new(None, pool
)
29 fs
.open_berkeley(fsob
, db_path
)
31 for i
in range(fs
.youngest_rev(fsob
, pool
)):
32 # convert secs into microseconds, then a string
33 date
= core
.svn_time_to_cstring((DATE_BASE
+i
*DATE_INCR
) * 1000000L, pool
)
35 fs
.change_rev_prop(fsob
, i
+1, core
.SVN_PROP_REVISION_DATE
, date
, pool
)
36 fs
.change_rev_prop(fsob
, i
+1, core
.SVN_PROP_REVISION_AUTHOR
, 'mailer test', pool
)
39 if len(sys
.argv
) != 2:
40 print 'USAGE: %s REPOS' % sys
.argv
[0]
43 core
.run_app(tweak_dates
, sys
.argv
[1])
45 if __name__
== '__main__':