# HG changeset patch # User Anton Shestakov # Date 1646579754 -10800 # Node ID 9e0aa8929206db3080cc434089978384077c03fe # Parent 1e7190adffcad08328616f276c8926d67e39ae48 fixup: use compat.StateError for missing state file diff -r 1e7190adffca -r 9e0aa8929206 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sun Mar 06 17:46:33 2022 +0300 +++ b/hgext3rd/evolve/cmdrewrite.py Sun Mar 06 18:15:54 2022 +0300 @@ -1492,12 +1492,12 @@ fixup_state = state.cmdstate(repo, b'fixup-state') if contopt: if not fixup_state.exists(): - raise error.Abort(_(b'no interrupted fixup to continue')) + raise compat.StateError(_(b'no interrupted fixup to continue')) fixup_state.load() return continuefixup(ui, repo, fixup_state) if abortopt: if not fixup_state.exists(): - raise error.Abort(_(b'no interrupted fixup to abort')) + raise compat.StateError(_(b'no interrupted fixup to abort')) fixup_state.load() return abortfixup(ui, repo, fixup_state) diff -r 1e7190adffca -r 9e0aa8929206 hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Sun Mar 06 17:46:33 2022 +0300 +++ b/hgext3rd/evolve/compat.py Sun Mar 06 18:15:54 2022 +0300 @@ -571,3 +571,9 @@ else: # hg <= 5.6 (8d72e29ad1e0) InputError = error.Abort + +if util.safehasattr(error, 'StateError'): + StateError = error.StateError +else: + # hg <= 5.6 (527ce85c2e60) + StateError = error.Abort diff -r 1e7190adffca -r 9e0aa8929206 tests/test-fixup.t --- a/tests/test-fixup.t Sun Mar 06 17:46:33 2022 +0300 +++ b/tests/test-fixup.t Sun Mar 06 18:15:54 2022 +0300 @@ -297,11 +297,11 @@ $ hg fixup --continue abort: no interrupted fixup to continue - [255] + [20] $ hg fixup --abort abort: no interrupted fixup to abort - [255] + [20] testing error cases