gpt4 book ai didi

python - pysvn client.log() 返回空字典

转载 作者:太空狗 更新时间:2023-10-30 02:00:33 28 4
gpt4 key购买 nike

我有以下脚本用于从 svn 获取日志消息

import pysvn
class svncheck():
def __init__(self, svn_root="http://10.11.25.3/svn/Moodle/modules", svn_user=None, svn_password=None):
self.user = svn_user
self.password = svn_password
self.root = svn_root

def diffrence(self):
client = pysvn.Client()
client.commit_info_style = 1
client.callback_notify = self.notify
client.callback_get_login = self.credentials
log = client.log(
self.root,
revision_start=pysvn.Revision( pysvn.opt_revision_kind.number, 0),
revision_end=pysvn.Revision( pysvn.opt_revision_kind.number, 5829),
discover_changed_paths=True,
strict_node_history=True,
limit=0,
include_merged_revisions=False,
)
print log
def notify( event_dict ):
print event_dict
return

def credentials(realm, username, may_save):
return True, self.user, self.password, True



s = svncheck()
s.diffrence()

当我运行这个脚本时,它返回一个空的字典对象 [<PysvnLog ''>, <PysvnLog ''>, <PysvnLog ''>,..

知道我在这里做错了什么吗?我正在使用 pysvn 版本 1.7.2 再次构建 svn 版本 1.6.5干杯纳什

最佳答案

pysvn.Client.log 方法返回日志条目列表;每个日志条目都是一本字典。 (参见 pysvn Programmer's reference)

您可以像这样在代码中打印日志消息:

for info in log:
print info.revision.number,
print info.author,
print time.ctime(info.date),
print info.message

关于python - pysvn client.log() 返回空字典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2839386/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com