首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用svn+python获取两个文件之间的差异

使用svn+python获取两个文件之间的差异
EN

Stack Overflow用户
提问于 2018-02-20 20:25:07
回答 1查看 204关注 0票数 0

我想弄清楚如何做到以下几点

svn diff –r REVNO:HEAD FilePath

使用svn python包装器。我尝试过以下几种方法:

import svn.local
l = svn.local.LocalClient(FilePath)
ModifiedFiles = l.diff_summary(6382,6383) #List of dicts containing modified files and some attributes
Difference = l.diff(6382, 6383, FilePath) #throws error

我得到了错误:

索引回溯(最近一次调用):文件“D:/TEMP/SVN/

/GetLines.py”,第6行,in Difference = l.diff(6382,6383)文件索引行447,用于筛选器中的索引的diff (None,diff_result.decode(‘utf8’).split(‘non_empty_diff:')):UnicodeDecodeError:'utf-8’编解码器无法解码位置396852中的字节0xda :无效的继续字节

不过,在subversion命令行中,它工作得很好。

如何使用python包装器获取特定文件的更改?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48885265

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档