diff tests/test-import-bypass.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 8d72e29ad1e0
children
line wrap: on
line diff
--- a/tests/test-import-bypass.t	Fri Nov 26 17:22:14 2021 +0100
+++ b/tests/test-import-bypass.t	Fri Nov 19 12:57:53 2021 -0800
@@ -43,7 +43,7 @@
   unable to find 'a' for patching
   (use '--prefix' to apply patch relative to the current directory)
   abort: patch failed to apply
-  [255]
+  [20]
   $ hg st
   $ shortlog
   o  1:4e322f7ce8e3 test 0 0 - foo - changea
@@ -234,7 +234,7 @@
   patching file a
   Hunk #1 FAILED at 0
   abort: patch failed to apply
-  [255]
+  [20]
   $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff
   applying ../test.diff
   $ shortlog