windows
http://pysvn.tigris.org/servlets/ProjectDocumentList?folderID=1768
centos
yum install pysvn -y #python3安装请查看我的另一篇博文
#coding=utf-8
import pysvn
import datetime
client = pysvn.Client()
entry = client.info('本地代码库项目路径')
print u'SVN路径:',entry.url
print u'最新版本:',entry.commit_revision.number
print u'提交人员:',entry.commit_author
print u'更新日期:', datetime.datetime.fromtimestamp(entry.commit_time)
#列出最近更新5版本的文件列表
entries_list = client.log('G:\\svn\\trunk\\tests', discover_changed_paths=True)
list=[]
for i in range(5):
message =re.findall(r"\d+",str(entries_list[i].revision)),entries_list[i].message
list.append(message)
#b= json.dumps(list)
#b = json.dumps(list,encoding="UTF-8",ensure_ascii=False)
#b = b.replace('\"', '')
print(list)