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