[PATCH evolve-ext] split: reuse the pre-split commit message for the split ones

Jordi Gutiérrez Hermoso jordigh at octave.org
Sun Mar 20 22:18:53 UTC 2016


# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh at octave.org>
# Date 1458511862 14400
#      Sun Mar 20 18:11:02 2016 -0400
# Node ID f3c32a01d13f8bf64d29a758c6deb6dc8ee90466
# Parent  9bcb24c3ba8d2b5a7082ae61ac2193e867234822
split: reuse the pre-split commit message for the split ones

The original commit message is probably relevant in some way for the
split commit messages. It is helpful for the user to have access to
the pre-split commit message, so we provide the original commit
message. This is more helpful than completely dropping the original
commit message during a split.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2766,6 +2766,16 @@ def cmdsplit(ui, repo, *revs, **opts):
         r = ctx.rev()
         disallowunstable = not obsolete.isenabled(repo,
                                                   obsolete.allowunstableopt)
+
+        # We'll re-use the same commit message for all split commits,
+        # as it's a reasonable starting point for writing the commit
+        # messages for each chunk.
+        opts['message'] = (
+            "HG: This is the original pre-split commit message. "
+            "Edit it as appropriate.\n\n%s"
+        ) % ctx.description()
+        opts['edit'] = True
+
         if disallowunstable:
             # XXX We should check head revs
             if repo.revs("(%d::) - %d", rev, rev):


More information about the Mercurial-devel mailing list