errors: raise StateError on uncommitted changes when merge starts
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 23 Nov 2020 23:08:58 -0800
changeset 45917 721f765a34ac
parent 45916 fa87536d3d70
child 45918 ac565222b9f8
errors: raise StateError on uncommitted changes when merge starts Differential Revision: https://phab.mercurial-scm.org/D9393
mercurial/merge.py
tests/test-merge1.t
--- a/mercurial/merge.py	Mon Nov 23 16:48:13 2020 -0800
+++ b/mercurial/merge.py	Mon Nov 23 23:08:58 2020 -0800
@@ -1912,7 +1912,7 @@
                         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"),
                 )
--- a/tests/test-merge1.t	Mon Nov 23 16:48:13 2020 -0800
+++ b/tests/test-merge1.t	Mon Nov 23 23:08:58 2020 -0800
@@ -282,7 +282,7 @@
   $ 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 @@
   $ hg merge 2
   abort: uncommitted changes
   (use 'hg status' to list changes)
-  [255]
+  [20]
 merge of b expected
   $ hg merge -f 2
   merging b