##// END OF EJS Templates
tag: add -e/--edit option for modifying the commit message
Steve Losh -
r11185:6d7cf824 default
parent child Browse files
Show More
@@ -3394,6 +3394,9 b' def tag(ui, repo, name1, *names, **opts)'
3394 if date:
3394 if date:
3395 date = util.parsedate(date)
3395 date = util.parsedate(date)
3396
3396
3397 if opts.get('edit'):
3398 message = ui.edit(message, ui.username())
3399
3397 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
3400 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
3398
3401
3399 def tags(ui, repo):
3402 def tags(ui, repo):
@@ -4038,6 +4041,7 b' table = {'
4038 ('r', 'rev', '', _('revision to tag')),
4041 ('r', 'rev', '', _('revision to tag')),
4039 ('', 'remove', None, _('remove a tag')),
4042 ('', 'remove', None, _('remove a tag')),
4040 # -l/--local is already there, commitopts cannot be used
4043 # -l/--local is already there, commitopts cannot be used
4044 ('e', 'edit', None, _('edit commit message')),
4041 ('m', 'message', '', _('use <text> as commit message')),
4045 ('m', 'message', '', _('use <text> as commit message')),
4042 ] + commitopts2,
4046 ] + commitopts2,
4043 _('[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...')),
4047 _('[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...')),
@@ -223,7 +223,7 b' revert: all, date, rev, no-backup, inclu'
223 rollback: dry-run
223 rollback: dry-run
224 root:
224 root:
225 showconfig: untrusted
225 showconfig: untrusted
226 tag: force, local, rev, remove, message, date, user
226 tag: force, local, rev, remove, edit, message, date, user
227 tags:
227 tags:
228 tip: patch, git, style, template
228 tip: patch, git, style, template
229 unbundle: update
229 unbundle: update
@@ -73,3 +73,13 b' echo % tag and branch using same name'
73 hg branch tag-and-branch-same-name
73 hg branch tag-and-branch-same-name
74 hg ci -m"discouraged"
74 hg ci -m"discouraged"
75 hg tag tag-and-branch-same-name
75 hg tag tag-and-branch-same-name
76
77 echo '% test custom commit messages'
78 cat > $HGTMP/editor <<'__EOF__'
79 #!/bin/sh
80 echo "custom tag message" > "$1"
81 echo "second line" >> "$1"
82 __EOF__
83 chmod +x "$HGTMP"/editor
84 HGEDITOR="'$HGTMP'"/editor hg tag custom-tag -e
85 hg log -l1 --template "{desc}\n"
@@ -97,3 +97,6 b' 6ae703d793c8b1f097116869275ecd97b2977a2b'
97 % tag and branch using same name
97 % tag and branch using same name
98 marked working directory as branch tag-and-branch-same-name
98 marked working directory as branch tag-and-branch-same-name
99 warning: tag tag-and-branch-same-name conflicts with existing branch name
99 warning: tag tag-and-branch-same-name conflicts with existing branch name
100 % test custom commit messages
101 custom tag message
102 second line
General Comments 0
You need to be logged in to leave comments. Login now