techtonik / python-patch

Library to parse and apply unified diffs
https://pypi.python.org/pypi/patch
106 stars 63 forks source link

Return an error when aborting due to existing .orig file (fixes #60) #61

Open fmarier opened 5 years ago

fmarier commented 5 years ago

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
fmarier commented 5 years ago

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.