##// END OF EJS Templates
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)...
FUJIWARA Katsunori -
r21421:4941caa9 default
parent child Browse files
Show More
@@ -1081,17 +1081,18 b' class queue(object):'
1081 p.write("# Date %s %s\n\n" % date)
1081 p.write("# Date %s %s\n\n" % date)
1082
1082
1083 defaultmsg = "[mq]: %s" % patchfn
1083 defaultmsg = "[mq]: %s" % patchfn
1084 editor = False
1084 editor = cmdutil.getcommiteditor()
1085 if edit:
1085 if edit:
1086 def desceditor(repo, ctx, subs):
1086 def finishdesc(desc):
1087 desc = self.ui.edit(ctx.description() + "\n",
1088 ctx.user())
1089 if desc.rstrip():
1087 if desc.rstrip():
1090 return desc
1088 return desc
1091 else:
1089 else:
1092 return defaultmsg
1090 return defaultmsg
1091 # i18n: this message is shown in editor with "HG: " prefix
1092 extramsg = _('Leave message empty to use default message.')
1093 editor = cmdutil.getcommiteditor(finishdesc=finishdesc,
1094 extramsg=extramsg)
1093 commitmsg = msg
1095 commitmsg = msg
1094 editor = desceditor
1095 else:
1096 else:
1096 commitmsg = msg or defaultmsg
1097 commitmsg = msg or defaultmsg
1097
1098
@@ -284,9 +284,17 b' Test saving last-message.txt'
284 > EOF
284 > EOF
285
285
286 $ rm -f .hg/last-message.txt
286 $ rm -f .hg/last-message.txt
287 $ hg status
287 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
288 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
288 ==== before editing
289 ==== before editing
289
290
291
292 HG: Enter commit message. Lines beginning with 'HG:' are removed.
293 HG: Leave message empty to use default message.
294 HG: --
295 HG: user: test
296 HG: branch 'default'
297 HG: no files changed
290 ====
298 ====
291 transaction abort!
299 transaction abort!
292 rollback completed
300 rollback completed
@@ -295,6 +303,7 b' Test saving last-message.txt'
295 [255]
303 [255]
296 $ cat .hg/last-message.txt
304 $ cat .hg/last-message.txt
297
305
306
298 test saving last-message.txt
307 test saving last-message.txt
299
308
300 $ cat >> .hg/hgrc <<EOF
309 $ cat >> .hg/hgrc <<EOF
@@ -314,9 +323,17 b' Test handling default message with the p'
314 > EOF
323 > EOF
315
324
316 $ rm -f .hg/last-message.txt
325 $ rm -f .hg/last-message.txt
326 $ hg status
317 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e "patch "
327 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e "patch "
318 ==== before editing
328 ==== before editing
319
329
330
331 HG: Enter commit message. Lines beginning with 'HG:' are removed.
332 HG: Leave message empty to use default message.
333 HG: --
334 HG: user: test
335 HG: branch 'default'
336 HG: no files changed
320 ====
337 ====
321 $ cat ".hg/patches/patch "
338 $ cat ".hg/patches/patch "
322 # HG changeset patch
339 # HG changeset patch
General Comments 0
You need to be logged in to leave comments. Login now