hgext/rebase.py
changeset 45090 0ecb3b11fcad
parent 45087 83f75f1efdcc
child 45123 1efbfa9b36a7
--- a/hgext/rebase.py	Sat Jul 11 02:13:19 2020 +0200
+++ b/hgext/rebase.py	Sat Jul 11 03:10:23 2020 +0200
@@ -1427,12 +1427,6 @@
 def commitmemorynode(repo, wctx, editor, extra, user, date, commitmsg):
     '''Commit the memory changes with parents p1 and p2.
     Return node of committed revision.'''
-    # FIXME: make empty commit check consistent with ``repo.commit``
-    if wctx.nofilechanges() and not repo.ui.configbool(
-        b'ui', b'allowemptycommit'
-    ):
-        return None
-
     # By convention, ``extra['branch']`` (set by extrafn) clobbers
     # ``branch`` (used when passing ``--keepbranches``).
     branch = None
@@ -1447,6 +1441,8 @@
         branch=branch,
         editor=editor,
     )
+    if memctx.isempty() and not repo.ui.configbool(b'ui', b'allowemptycommit'):
+        return None
     commitres = repo.commitctx(memctx)
     wctx.clean()  # Might be reused
     return commitres