python-patch
python-patch copied to clipboard
Return an error when aborting due to existing .orig file (fixes #60)
Using the same setup as described in #60:
$ ./patch.py --debug working.patch || echo Failed
DEBUG reading working.patch
DEBUG crlf: 0 lf: 5 cr: 0 - file: b.txt hunk: 1
DEBUG - 1 hunks for a.txt
DEBUG total files: 1 total hunks: 1
DEBUG normalize filenames
DEBUG patch type = plain
DEBUG source = a.txt
DEBUG target = b.txt
DEBUG processing 1/1: a.txt
DEBUG hunk no.1 for file a.txt -- is ready to be patched
WARNING can't backup original file to a.txt.orig - aborting
Failed
That Travis CI failure is unrelated to my change and needs to be fixed with something like https://github.com/graingert/python-patch/commit/ba64f7259de9b2630eec73edb83af9fe22772eb1.