##// END OF EJS Templates
patch: add hint about mangled whitespace on bad patch...
Martin von Zweigbergk -
r49187:220506bb default
parent child Browse files
Show More
@@ -2025,7 +2025,12 b' def tryimportone(ui, repo, patchdata, pa'
2025 similarity=sim / 100.0,
2025 similarity=sim / 100.0,
2026 )
2026 )
2027 except error.PatchParseError as e:
2027 except error.PatchParseError as e:
2028 raise error.InputError(pycompat.bytestr(e))
2028 raise error.InputError(
2029 pycompat.bytestr(e),
2030 hint=_(
2031 b'check that whitespace in the patch has not been mangled'
2032 ),
2033 )
2029 except error.PatchApplicationError as e:
2034 except error.PatchApplicationError as e:
2030 if not partial:
2035 if not partial:
2031 raise error.StateError(pycompat.bytestr(e))
2036 raise error.StateError(pycompat.bytestr(e))
@@ -2086,7 +2091,12 b' def tryimportone(ui, repo, patchdata, pa'
2086 eolmode=None,
2091 eolmode=None,
2087 )
2092 )
2088 except error.PatchParseError as e:
2093 except error.PatchParseError as e:
2089 raise error.InputError(stringutil.forcebytestr(e))
2094 raise error.InputError(
2095 stringutil.forcebytestr(e),
2096 hint=_(
2097 b'check that whitespace in the patch has not been mangled'
2098 ),
2099 )
2090 except error.PatchApplicationError as e:
2100 except error.PatchApplicationError as e:
2091 raise error.StateError(stringutil.forcebytestr(e))
2101 raise error.StateError(stringutil.forcebytestr(e))
2092 if opts.get(b'exact'):
2102 if opts.get(b'exact'):
@@ -519,6 +519,7 b' Invalid base85 content'
519 > EOF
519 > EOF
520 applying patch from stdin
520 applying patch from stdin
521 abort: could not decode "binary2" binary patch: bad base85 character at position 6
521 abort: could not decode "binary2" binary patch: bad base85 character at position 6
522 (check that whitespace in the patch has not been mangled)
522 [10]
523 [10]
523
524
524 $ hg revert -aq
525 $ hg revert -aq
@@ -534,6 +535,7 b' Invalid base85 content'
534 > EOF
535 > EOF
535 applying patch from stdin
536 applying patch from stdin
536 abort: "binary2" length is 5 bytes, should be 6
537 abort: "binary2" length is 5 bytes, should be 6
538 (check that whitespace in the patch has not been mangled)
537 [10]
539 [10]
538
540
539 $ hg revert -aq
541 $ hg revert -aq
@@ -548,6 +550,7 b' Invalid base85 content'
548 > EOF
550 > EOF
549 applying patch from stdin
551 applying patch from stdin
550 abort: could not extract "binary2" binary data
552 abort: could not extract "binary2" binary data
553 (check that whitespace in the patch has not been mangled)
551 [10]
554 [10]
552
555
553 Simulate a copy/paste turning LF into CRLF (issue2870)
556 Simulate a copy/paste turning LF into CRLF (issue2870)
@@ -234,6 +234,7 b' import of malformed plain diff should fa'
234 $ hg --cwd b import -mpatch ../broken.patch
234 $ hg --cwd b import -mpatch ../broken.patch
235 applying ../broken.patch
235 applying ../broken.patch
236 abort: bad hunk #1
236 abort: bad hunk #1
237 (check that whitespace in the patch has not been mangled)
237 [10]
238 [10]
238 $ rm -r b
239 $ rm -r b
239
240
@@ -2076,6 +2077,7 b' test immature end of hunk'
2076 > EOF
2077 > EOF
2077 applying patch from stdin
2078 applying patch from stdin
2078 abort: bad hunk #1: incomplete hunk
2079 abort: bad hunk #1: incomplete hunk
2080 (check that whitespace in the patch has not been mangled)
2079 [10]
2081 [10]
2080
2082
2081 $ hg import - <<'EOF'
2083 $ hg import - <<'EOF'
@@ -2087,4 +2089,5 b' test immature end of hunk'
2087 > EOF
2089 > EOF
2088 applying patch from stdin
2090 applying patch from stdin
2089 abort: bad hunk #1: incomplete hunk
2091 abort: bad hunk #1: incomplete hunk
2092 (check that whitespace in the patch has not been mangled)
2090 [10]
2093 [10]
General Comments 0
You need to be logged in to leave comments. Login now