mailer-tweak.py
来自「subversion-1.4.3-1.tar.gz 配置svn的源码」· Python 代码 · 共 45 行
PY
45 行
#!/usr/bin/env python## mailer-tweak.py: tweak the svn:date properties on all revisions## We need constant dates for the revisions so that we can consistently# compare an output against a known quantity.## USAGE: ./mailer-tweak.py REPOS#import sysimport osimport getoptfrom svn import fs, coreDATE_BASE = 1000000000DATE_INCR = 10000def tweak_dates(pool, home='.'): db_path = os.path.join(home, 'db') if not os.path.exists(db_path): db_path = home fsob = fs.new(None, pool) fs.open_berkeley(fsob, db_path) for i in range(fs.youngest_rev(fsob, pool)): # convert secs into microseconds, then a string date = core.svn_time_to_cstring((DATE_BASE+i*DATE_INCR) * 1000000L, pool) #print date fs.change_rev_prop(fsob, i+1, core.SVN_PROP_REVISION_DATE, date, pool)def main(): if len(sys.argv) != 2: print 'USAGE: %s REPOS' % sys.argv[0] sys.exit(1) core.run_app(tweak_dates, sys.argv[1])if __name__ == '__main__': main()
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?