##// END OF EJS Templates
tag: use the editor gotten by "getcommiteditor()" instead of "ui.edit()"...
FUJIWARA Katsunori -
r21418:d4b8fc75 default
parent child Browse files
Show More
@@ -5695,11 +5695,7 b' def tag(ui, repo, name1, *names, **opts)'
5695 5695 if date:
5696 5696 date = util.parsedate(date)
5697 5697
5698 if opts.get('edit'):
5699 def editor(repo, ctx, subs):
5700 return ui.edit(ctx.description() + "\n", ctx.user())
5701 else:
5702 editor = False
5698 editor = cmdutil.getcommiteditor(**opts)
5703 5699
5704 5700 # don't allow tagging the null rev
5705 5701 if (not opts.get('remove') and
@@ -16,7 +16,10 b''
16 16 abort: tag names cannot consist entirely of whitespace
17 17 [255]
18 18
19 $ hg tag "bleah"
19 (this tests also that editor is not invoked, if '--edit' is not
20 specified)
21
22 $ HGEDITOR=cat hg tag "bleah"
20 23 $ hg history
21 24 changeset: 1:d4f0d2909abc
22 25 tag: tip
@@ -219,6 +222,9 b' tag and branch using same name'
219 222 test custom commit messages
220 223
221 224 $ cat > editor.sh << '__EOF__'
225 > echo "==== before editing"
226 > cat "$1"
227 > echo "===="
222 228 > echo "custom tag message" > "$1"
223 229 > echo "second line" >> "$1"
224 230 > __EOF__
@@ -250,8 +256,22 b' at first, test saving last-message.txt'
250 256 > pretxncommit.unexpectedabort = false
251 257 > __EOF__
252 258
259 (this tests also that editor is invoked, if '--edit' is specified,
260 regardless of '--message')
261
253 262 $ rm -f .hg/last-message.txt
254 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
263 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e -m "foo bar"
264 ==== before editing
265 foo bar
266
267
268 HG: Enter commit message. Lines beginning with 'HG:' are removed.
269 HG: Leave message empty to abort commit.
270 HG: --
271 HG: user: test
272 HG: branch 'tag-and-branch-same-name'
273 HG: changed .hgtags
274 ====
255 275 transaction abort!
256 276 rollback completed
257 277 note: commit message saved in .hg/last-message.txt
@@ -272,6 +292,17 b' at first, test saving last-message.txt'
272 292 then, test custom commit message itself
273 293
274 294 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
295 ==== before editing
296 Added tag custom-tag for changeset 75a534207be6
297
298
299 HG: Enter commit message. Lines beginning with 'HG:' are removed.
300 HG: Leave message empty to abort commit.
301 HG: --
302 HG: user: test
303 HG: branch 'tag-and-branch-same-name'
304 HG: changed .hgtags
305 ====
275 306 $ hg log -l1 --template "{desc}\n"
276 307 custom tag message
277 308 second line
General Comments 0
You need to be logged in to leave comments. Login now