{"thread":{"id":"20313","subject":"[StGit PATCH] stgit new: Do not open editor if --save-template was specified","startedAt":"2009-07-31T09:48:29Z","lastAt":"2009-07-31T09:48:29Z","messageCount":1,"participants":["Gustav Hållberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119228","messageId":"20090731094718.4516.20444.stgit@lux.e.vtech","threadId":"20313","inReplyTo":null,"subject":"[StGit PATCH] stgit new: Do not open editor if --save-template was specified","fromName":"Gustav Hållberg","fromEmail":"gustav@virtutech.com","sentAt":"2009-07-31T09:48:29Z","receivedAt":"2009-07-31T09:48:29Z","isPatch":true,"sender":{"key":"gustav@virtutech.com","avatar":null},"body":"Fixes side-effect of e58f264a3e59a0887c7aaa1e3227cff108ac840d\n\nI'm not sure this is the right way to fix the problem, but an editor\nshould not be opened if \"--save-template\" was specified to \"stg new\",\nas it is used for batch processes.\n\nSigned-off-by: Gustav Hållberg <gustav@virtutech.com>\n---\n stgit/commands/new.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/new.py b/stgit/commands/new.py\nindex 9fd51c3..158193e 100644\n--- a/stgit/commands/new.py\n+++ b/stgit/commands/new.py\n@@ -67,7 +67,8 @@ def func(parser, options, args):\n     cd = gitlib.CommitData(\n         tree = stack.head.data.tree, parents = [stack.head], message = '',\n         author = gitlib.Person.author(), committer = gitlib.Person.committer())\n-    cd = common.update_commit_data(cd, options, allow_edit = True)\n+    cd = common.update_commit_data(cd, options,\n+                                   allow_edit = not options.save_template)\n \n     if options.save_template:\n         options.save_template(cd.message)\n"}]}