changeset 44409:f935b680860d

commit: error out on unresolved files even if commit would be empty Differential Revision: https://phab.mercurial-scm.org/D8195
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 28 Feb 2020 10:30:18 -0800
parents 6cf92d6c0ad5
children c85d5fd1a5d9
files mercurial/localrepo.py tests/test-update-branches.t
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Feb 28 10:49:13 2020 -0800
+++ b/mercurial/localrepo.py	Fri Feb 28 10:30:18 2020 -0800
@@ -2944,6 +2944,9 @@
                 self, status, text, user, date, extra
             )
 
+            ms = mergemod.mergestate.read(self)
+            mergeutil.checkunresolved(ms)
+
             # internal config: ui.allowemptycommit
             allowemptycommit = (
                 wctx.branch() != wctx.p1().branch()
@@ -2958,9 +2961,6 @@
             if merge and cctx.deleted():
                 raise error.Abort(_(b"cannot commit merge with missing files"))
 
-            ms = mergemod.mergestate.read(self)
-            mergeutil.checkunresolved(ms)
-
             if editor:
                 cctx._text = editor(self, cctx, subs)
             edited = text != cctx._text
--- a/tests/test-update-branches.t	Fri Feb 28 10:49:13 2020 -0800
+++ b/tests/test-update-branches.t	Fri Feb 28 10:30:18 2020 -0800
@@ -347,8 +347,8 @@
   $ hg revert -r . a
   $ rm a.orig
   $ hg ci -m empty
-  nothing changed
-  [1]
+  abort: unresolved merge conflicts (see 'hg help resolve')
+  [255]
   $ hg resolve -m a
   (no more unresolved files)
   $ hg resolve -l