mercurial/localrepo.py
changeset 45088 3e40abe0a170
parent 45084 07b3166e94ca
child 45106 a03c177a4679
--- a/mercurial/localrepo.py	Sat Jul 11 00:53:34 2020 +0200
+++ b/mercurial/localrepo.py	Sat Jul 11 01:14:00 2020 +0200
@@ -2995,14 +2995,9 @@
             mergeutil.checkunresolved(ms)
 
             # internal config: ui.allowemptycommit
-            allowemptycommit = (
-                cctx.branch() != cctx.p1().branch()
-                or extra.get(b'close')
-                or merge
-                or cctx.files()
-                or self.ui.configbool(b'ui', b'allowemptycommit')
-            )
-            if not allowemptycommit:
+            if cctx.isempty() and not self.ui.configbool(
+                b'ui', b'allowemptycommit'
+            ):
                 self.ui.debug(b'nothing to commit, clearing merge state\n')
                 ms.reset()
                 return None