Mercurial > public > mercurial-scm > hg
diff tests/test-import.t @ 48363:6a454e7053a1
errors: return more detailed errors when failing to parse or apply patch
This patch adds subclasses of `PatchError` so we can distinguish
between failure to parse a patch from failure to apply it. It updates
the callers to raise either `InputError` or `StateError` depending on
which type of error occurred.
Differential Revision: https://phab.mercurial-scm.org/D11824
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 19 Nov 2021 12:57:53 -0800 |
parents | 5b9865032533 |
children | 220506bb213e |
line wrap: on
line diff
--- a/tests/test-import.t Fri Nov 26 17:22:14 2021 +0100 +++ b/tests/test-import.t Fri Nov 19 12:57:53 2021 -0800 @@ -234,7 +234,7 @@ $ hg --cwd b import -mpatch ../broken.patch applying ../broken.patch abort: bad hunk #1 - [255] + [10] $ rm -r b hg -R repo import @@ -834,7 +834,7 @@ Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file a.rej abort: patch failed to apply - [255] + [20] $ hg import --no-commit -v fuzzy-tip.patch applying fuzzy-tip.patch patching file a @@ -853,7 +853,7 @@ Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file a.rej abort: patch failed to apply - [255] + [20] $ hg up -qC $ hg import --config patch.fuzz=2 --exact fuzzy-reparent.patch applying fuzzy-reparent.patch @@ -2054,7 +2054,7 @@ (use '--prefix' to apply patch relative to the current directory) 1 out of 1 hunks FAILED -- saving rejects to file file1.rej abort: patch failed to apply - [255] + [20] test import crash (issue5375) $ cd .. @@ -2064,7 +2064,7 @@ applying patch from stdin a not tracked! abort: source file 'a' does not exist - [255] + [20] test immature end of hunk @@ -2076,7 +2076,7 @@ > EOF applying patch from stdin abort: bad hunk #1: incomplete hunk - [255] + [10] $ hg import - <<'EOF' > diff --git a/foo b/foo @@ -2087,4 +2087,4 @@ > EOF applying patch from stdin abort: bad hunk #1: incomplete hunk - [255] + [10]