Patch-ng

Latest version: v1.17.4

Safety actively analyzes 625297 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

8.061

- initial release

1.16

- Python 3 support, thanks to Yen Chi Hsuan (yan12125)
(pull request 36)

1.15

- Project moved to GitHub
- patch-1.15.zip archive is now executable
- improved Git patch detection thanks to mspncp (32)
- tests/data contains database of all possible patches
- tests suite scan now processes tests/data automatically
- API changes:
+ setdebug() initializes logging and enables debug info

1.14.2

- --revert option to apply patches in reverse order (unpatch)
- support for broken patches generated by online Google Code editor
- API changes:
+ PatchSet and Patch objects are now iterable
+ new PatchSet.findfile() contains logic detecting filename to patch
+ PatchSet.revert()
- make directory based tests easier to create and run manually
- fix xnormpath with Windows paths on Linux
(issue 24, found by Philippe Ombredanne)

1.13

- diffstat output now also shows size delta in bytes
- added --directory (-d) option to specify root when applying patches
- hunk headers produced by `diff -p` option are now parsed and accessible
(issue 22, found by Philippe Ombredanne)
- API changes:
+ Hunk.desc field to access hunk headers content
+ PatchSet.apply() gets `root` keyword argument for the working dir
when applying patches (issue 7)
- improve error message for missing files
- improve docs (fix issue 5)

1.12.11

- patch.py can read patches from stdin
- patch.py can show nice histogram with --diffstat option
- added detection of SVN, GIT and HG patch types, unrecognized
patches marked as PLAIN
- added error reporting for parsing functions and helpers (now they
return False if parsing failed) - make sure you handle this correctly
- added normalization to filenames to protect against patching files
using absolute paths or files in parent directories
- test run patch.py on all patches submitted to Python bug tracker, which
resulted in improved parsing and error handling for some corner cases
- improved logging
- API changes
* fromfile(), fromstring() and fromurl() now return False on errors
* previous Patch is renamed to PatchSet, new Patch is single file entry
* Patch.header is now a list of strings
* PatchSet.parse() now returns True if parsing completed without errors
+ PatchSet.__len__()
+ PatchSet.diffstat()
+ PatchSet.type and Patch.type
+ PatchSet.errors and
+ xisabs() cross-platform version of `os.path.isabs()`
+ xnormpath() forward slashed version of `os.path.normpath()`
+ xstrip() to strip absolute path prefixes

Page 2 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.