# HG changeset patch # User Martin von Zweigbergk # Date 2020-11-24 07:08:58 # Node ID 721f765a34ace5b02326d88b7c874ddbbdf0023b # Parent fa87536d3d70e768e7d2a52723bf0fad9965243d errors: raise StateError on uncommitted changes when merge starts Differential Revision: https://phab.mercurial-scm.org/D9393 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1912,7 +1912,7 @@ def _update( hint=_(b"use 'hg update' or check 'hg heads'"), ) if not force and (wc.files() or wc.deleted()): - raise error.Abort( + raise error.StateError( _(b"uncommitted changes"), hint=_(b"use 'hg status' to list changes"), ) diff --git a/tests/test-merge1.t b/tests/test-merge1.t --- a/tests/test-merge1.t +++ b/tests/test-merge1.t @@ -282,7 +282,7 @@ merge fails $ hg merge 2 abort: uncommitted changes (use 'hg status' to list changes) - [255] + [20] merge expected! $ hg merge -f 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -319,7 +319,7 @@ merge of b should fail $ hg merge 2 abort: uncommitted changes (use 'hg status' to list changes) - [255] + [20] merge of b expected $ hg merge -f 2 merging b