Patchwork D9393: errors: raise StateError on uncommitted changes when merge starts

login
register
mail settings
Submitter phabricator
Date Nov. 24, 2020, 6:07 p.m.
Message ID <differential-rev-PHID-DREV-3st27ecb3gyexvqhzpf3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47670/
State Superseded
Headers show

Comments

phabricator - Nov. 24, 2020, 6:07 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9393

AFFECTED FILES
  mercurial/merge.py
  tests/test-merge1.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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 @@ 
   $ 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
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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"),
                 )