techtonik / python-patch

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

detect timestamp in diff header #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.python diff.py -u patch.py.merge-left.r40 patch.py.merge-right.r41 >
portfix.diff

What is the expected output? What do you see instead?
filenames in diff header are not separated from timestamp by tab

--- patch.py.merge-left.r40 Sat Dec 26 11:39:47 2009
+++ patch.py.merge-right.r41 Sat Dec 26 11:39:47 2009
@@ -8,7 +8,7 @@
 """

patch.py fails:
reading patch from file portfix.diff
total files: 1  total hunks: 2
source/target file does not exist
--- patch.py.merge-left.r40 Sat Dec 26 11:39:47 2009
+++ patch.py.merge-right.r41 Sat Dec 26 11:39:47 2009

Need to detect all possible timestamp formats.

Original issue reported on code.google.com by techtonik@gmail.com on 26 Dec 2009 at 9:55

techtonik commented 8 years ago

Need to see if unix patch handles this. Timestamp that is not separated by tab is invalid file format, because timestamp could be a part of filename as well.