[PATCH] import: --no-commit should update .hg/last-message.txt

steve at borho.org steve at borho.org
Thu Oct 21 16:06:32 CDT 2010


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1287695074 18000
# Branch stable
# Node ID 9b1026dc2da28ac4681d5d67ceaad9406e6b0d5e
# Parent  3d6ba8c2b1b857f77a8f265b71fa2db35c9fba67
import: --no-commit should update .hg/last-message.txt

The patch parser goes through all of that trouble extracting the
commit message from the patch file.  It seems such a waste not to
use it.

diff -r 3d6ba8c2b1b8 -r 9b1026dc2da2 mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2302,7 +2302,10 @@
             finally:
                 files = cmdutil.updatedir(ui, repo, files,
                                           similarity=sim / 100.0)
-            if not opts.get('no_commit'):
+            if opts.get('no_commit'):
+                if message:
+                    repo.opener('last-message.txt', 'wb').write(message)
+            else:
                 if opts.get('exact'):
                     m = None
                 else:


More information about the Mercurial-devel mailing list