[PATCH 9 of 9] cmdutil: omit redundant "savecommitmessage()" in "tryimportone()"

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon May 5 07:33:09 CDT 2014


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1399292800 -32400
#      Mon May 05 21:26:40 2014 +0900
# Branch stable
# Node ID ad9e8d71ce784496fe98e5fd33f18af30787db67
# Parent  24416f80f94093cfb1f9699dfa09d794b194db53
cmdutil: omit redundant "savecommitmessage()" in "tryimportone()"

The preceding patch causes that "makememctx()" with "editor" argument
saves (manually edited) commit message into ".hg/last-message.txt":
saving itself is executed indirectly in "memctx.__init__()".

This makes it redundant to invoke "savecommitmessage()" on caller side
of "makememctx()".

This patch omits such redundant "savecommitmessage()" invocation in
"tryimportone()".

"tryimportone()" uses one of "commiteditor" or "commitforceeditor" as
"editor" argument, and this causes saving commit message always.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -654,7 +654,6 @@
                                             opts.get('date') or date,
                                             branch, files, store,
                                             editor=commiteditor)
-                repo.savecommitmessage(memctx.description())
                 n = memctx.commit()
             finally:
                 store.close()


More information about the Mercurial-devel mailing list