用于分析和应用统一差异的库
patch的Python项目详细描述
功能
- Python 2 and 3 compatible
- Automatic correction of * Linefeeds according to patched file * Diffs broken by stripping trailing whitespace * a/ and b/ prefixes
- Single file, which is a command line tool and a library
- No dependencies outside Python stdlib
- Patch format detection (SVN, HG, GIT)
- Nice diffstat histogram
- Linux / Windows / OS X
- Test coverage
开箱即用的东西:
- File renaming, creation and removal
- Directory tree operations
- Version control specific properties
- Non-unified diff formats
用法
下载patch.py并用Python运行它它是一个独立的 没有外部依赖关系的模块:
patch.py diff.patch
您还可以运行.zip文件:
python patch-1.16.zip diff.patch
安装
patch.py是自给自足的。您可以将其复制到存储库中 从这里开始使用。此设置将始终可重复但是如果 您需要添加补丁程序模块作为依赖项,请确保使用strict 在版本2发布时避免命中API中断的说明符:
pip install "patch==1.*"