需要安装pysvn模块 # -*- coding: cp936 -*- # 从svn repos里 获取当天的日志 import pysvn import time SVNURL = "http://192.168.7.242/svn/test/trunk" #SVNURL = "E://riag//work//HMI-Contrib" g_LogList = [] TodayTime = time.strftime("%Y-%m-%d", time.localtime()) Repos_NUM = 0 def print_reposinfo(reposInfo): ReposComitTime = time.strftime("%Y-%m-%d", time.localtime(reposInfo.date)) ; print reposInfo.author print ReposComitTime print reposInfo.message.encode("cp936") print reposInfo.revision.number def getTody_log() : global g_LogList g_LogList = [] client = pysvn.Client() revision_start=pysvn.Revision( pysvn.opt_revision_kind.head ) bContinue = True while bContinue : LogList = client.log(SVNURL, revision_start, limit=10) ; print "LogList: %s" % (Today