mercurial/commands.py
changeset 21237 0054a77f49df
parent 21200 a1381eea7c7d
child 21262 edac098e6a55
--- a/mercurial/commands.py	Mon May 05 21:26:40 2014 +0900
+++ b/mercurial/commands.py	Mon May 05 21:26:40 2014 +0900
@@ -5684,15 +5684,18 @@
             date = util.parsedate(date)
 
         if opts.get('edit'):
-            message = ui.edit(message, ui.username())
-            repo.savecommitmessage(message)
+            def editor(repo, ctx, subs):
+                return ui.edit(ctx.description() + "\n", ctx.user())
+        else:
+            editor = False
 
         # don't allow tagging the null rev
         if (not opts.get('remove') and
             scmutil.revsingle(repo, rev_).rev() == nullrev):
             raise util.Abort(_("cannot tag null revision"))
 
-        repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
+        repo.tag(names, r, message, opts.get('local'), opts.get('user'), date,
+                 editor=editor)
     finally:
         release(lock, wlock)