5682 date = opts.get('date') |
5682 date = opts.get('date') |
5683 if date: |
5683 if date: |
5684 date = util.parsedate(date) |
5684 date = util.parsedate(date) |
5685 |
5685 |
5686 if opts.get('edit'): |
5686 if opts.get('edit'): |
5687 message = ui.edit(message, ui.username()) |
5687 def editor(repo, ctx, subs): |
5688 repo.savecommitmessage(message) |
5688 return ui.edit(ctx.description() + "\n", ctx.user()) |
|
5689 else: |
|
5690 editor = False |
5689 |
5691 |
5690 # don't allow tagging the null rev |
5692 # don't allow tagging the null rev |
5691 if (not opts.get('remove') and |
5693 if (not opts.get('remove') and |
5692 scmutil.revsingle(repo, rev_).rev() == nullrev): |
5694 scmutil.revsingle(repo, rev_).rev() == nullrev): |
5693 raise util.Abort(_("cannot tag null revision")) |
5695 raise util.Abort(_("cannot tag null revision")) |
5694 |
5696 |
5695 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date) |
5697 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date, |
|
5698 editor=editor) |
5696 finally: |
5699 finally: |
5697 release(lock, wlock) |
5700 release(lock, wlock) |
5698 |
5701 |
5699 @command('tags', [], '') |
5702 @command('tags', [], '') |
5700 def tags(ui, repo, **opts): |
5703 def tags(ui, repo, **opts): |