Show More
@@ -5695,11 +5695,7 b' def tag(ui, repo, name1, *names, **opts)' | |||||
5695 | if date: |
|
5695 | if date: | |
5696 | date = util.parsedate(date) |
|
5696 | date = util.parsedate(date) | |
5697 |
|
5697 | |||
5698 | if opts.get('edit'): |
|
5698 | editor = cmdutil.getcommiteditor(**opts) | |
5699 | def editor(repo, ctx, subs): |
|
|||
5700 | return ui.edit(ctx.description() + "\n", ctx.user()) |
|
|||
5701 | else: |
|
|||
5702 | editor = False |
|
|||
5703 |
|
5699 | |||
5704 | # don't allow tagging the null rev |
|
5700 | # don't allow tagging the null rev | |
5705 | if (not opts.get('remove') and |
|
5701 | if (not opts.get('remove') and |
@@ -16,7 +16,10 b'' | |||||
16 | abort: tag names cannot consist entirely of whitespace |
|
16 | abort: tag names cannot consist entirely of whitespace | |
17 | [255] |
|
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 | $ hg history |
|
23 | $ hg history | |
21 | changeset: 1:d4f0d2909abc |
|
24 | changeset: 1:d4f0d2909abc | |
22 | tag: tip |
|
25 | tag: tip | |
@@ -219,6 +222,9 b' tag and branch using same name' | |||||
219 | test custom commit messages |
|
222 | test custom commit messages | |
220 |
|
223 | |||
221 | $ cat > editor.sh << '__EOF__' |
|
224 | $ cat > editor.sh << '__EOF__' | |
|
225 | > echo "==== before editing" | |||
|
226 | > cat "$1" | |||
|
227 | > echo "====" | |||
222 | > echo "custom tag message" > "$1" |
|
228 | > echo "custom tag message" > "$1" | |
223 | > echo "second line" >> "$1" |
|
229 | > echo "second line" >> "$1" | |
224 | > __EOF__ |
|
230 | > __EOF__ | |
@@ -250,8 +256,22 b' at first, test saving last-message.txt' | |||||
250 | > pretxncommit.unexpectedabort = false |
|
256 | > pretxncommit.unexpectedabort = false | |
251 | > __EOF__ |
|
257 | > __EOF__ | |
252 |
|
258 | |||
|
259 | (this tests also that editor is invoked, if '--edit' is specified, | |||
|
260 | regardless of '--message') | |||
|
261 | ||||
253 | $ rm -f .hg/last-message.txt |
|
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 | transaction abort! |
|
275 | transaction abort! | |
256 | rollback completed |
|
276 | rollback completed | |
257 | note: commit message saved in .hg/last-message.txt |
|
277 | note: commit message saved in .hg/last-message.txt | |
@@ -272,6 +292,17 b' at first, test saving last-message.txt' | |||||
272 | then, test custom commit message itself |
|
292 | then, test custom commit message itself | |
273 |
|
293 | |||
274 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e |
|
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 | $ hg log -l1 --template "{desc}\n" |
|
306 | $ hg log -l1 --template "{desc}\n" | |
276 | custom tag message |
|
307 | custom tag message | |
277 | second line |
|
308 | second line |
General Comments 0
You need to be logged in to leave comments.
Login now