hgext/split.py
changeset 46923 8ee1ac083ee7
parent 46843 728d89f6f9b1
child 46924 ca0049946e9a
--- a/hgext/split.py	Mon Apr 12 17:51:56 2021 -0700
+++ b/hgext/split.py	Mon Apr 12 17:52:46 2021 -0700
@@ -171,9 +171,13 @@
                 b'message': header + ctx.description(),
             }
         )
+        origctx = repo[b'.']
         commands.commit(ui, repo, **pycompat.strkwargs(opts))
         newctx = repo[b'.']
-        committed.append(newctx)
+        # Ensure user didn't do a "no-op" split (such as deselecting
+        # everything).
+        if origctx.node() != newctx.node():
+            committed.append(newctx)
 
     if not committed:
         raise error.InputError(_(b'cannot split an empty revision'))