cmdutil: omit redundant "savecommitmessage()" in "tryimportone()"
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Mon, 05 May 2014 21:26:40 +0900
changeset 21241 244b177a152e
parent 21240 1a833fcf5a14
child 21242 4c94229c51fb
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.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Mon May 05 21:26:40 2014 +0900
+++ b/mercurial/cmdutil.py	Mon May 05 21:26:40 2014 +0900
@@ -654,7 +654,6 @@
                                             opts.get('date') or date,
                                             branch, files, store,
                                             editor=commiteditor)
-                repo.savecommitmessage(memctx.description())
                 n = memctx.commit()
             finally:
                 store.close()