From patchwork Mon May 5 12:33:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [9, of, 9] cmdutil: omit redundant "savecommitmessage()" in "tryimportone()" From: Katsunori FUJIWARA X-Patchwork-Id: 4640 Message-Id: To: mercurial-devel@selenic.com Date: Mon, 05 May 2014 21:33:09 +0900 # HG changeset patch # User FUJIWARA Katsunori # 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()