Patchwork D8195: commit: error out on unresolved files even if commit would be empty

login
register
mail settings
Submitter phabricator
Date March 2, 2020, 2:31 p.m.
Message ID <c815ed42e45012de4d577ae49579e7cd@localhost.localdomain>
Download mbox | patch
Permalink /patch/45419/
State Not Applicable
Headers show

Comments

phabricator - March 2, 2020, 2:31 p.m.
Closed by commit rHGf935b680860d: commit: error out on unresolved files even if commit would be empty (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8195?vs=20401&id=20412

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8195/new/

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-update-branches.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -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
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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