当前位置: 首页 > 工具软件 > PySVN > 使用案例 >

Python-Pysvn中获取两个版本之间的diff

吕自怡
2023-12-01
from pysvn import *
client = Client()
client.set_default_username(g_svnUserName)
client.set_default_password(g_svnPassword)
currentRevision = Revision(opt_revision_kind.committed)
if g_preVersion == 0:
	olderRevision = Revision(opt_revision_kind.previous)
else:
	olderRevision = Revision(opt_revision_kind.number, g_preVersion)
versionDiff = client.diff(os.path.join(os.environ["temp"], "1.tmp"), g_localPath, olderRevision, g_localPath, currentRevision)


对应于SVN的命令行:

svn diff -r COMMITTED:PREV

 类似资料: