8ccff9378aba

cli: use unicode for comments and signoffs
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 09 Jul 2010 22:13:27 -0400
parents 5dec221dd171
children 106c2afad69b
branches/tags (none)
files review/cli.py

Changes

--- a/review/cli.py	Fri Jul 09 21:44:09 2010 -0400
+++ b/review/cli.py	Fri Jul 09 22:13:27 2010 -0400
@@ -6,7 +6,7 @@
 """
 
 import api, helps, messages
-from util import tolocal
+from util import fromlocal, tolocal
 from mercurial import help, templatefilters, util
 from mercurial.node import short
 
@@ -46,7 +46,7 @@
     style = 'markdown' if mdown or comment.style == 'markdown' else ''
 
     try:
-        rd.edit_comment(comment.identifier, message,
+        rd.edit_comment(comment.identifier, fromlocal(message),
                         filename=fnames[0], lines=lines, style=style)
     except api.FileNotInChangeset:
         raise util.Abort(messages.COMMENT_FILE_DOES_NOT_EXIST % (
@@ -66,7 +66,7 @@
 
     style = 'markdown' if mdown or signoff.style == 'markdown' else ''
 
-    rd.edit_signoff(signoff.identifier, message, opinion, style)
+    rd.edit_signoff(signoff.identifier, fromlocal(message), opinion, style)
 
 
 def _web_command(ui, repo, **opts):
@@ -127,7 +127,7 @@
 
     for fn in fnames:
         try:
-            rcset.add_comment(message=message, filename=fn, lines=lines, style=style)
+            rcset.add_comment(message=fromlocal(message), filename=fn, lines=lines, style=style)
         except api.FileNotInChangeset:
             raise util.Abort(messages.COMMENT_FILE_DOES_NOT_EXIST % (
                                      fn, repo[rev].rev()))
@@ -154,7 +154,7 @@
 
     style = mdown and 'markdown' or ''
 
-    rcset.add_signoff(message=message, opinion=opinion, style=style)
+    rcset.add_signoff(message=fromlocal(message), opinion=opinion, style=style)
 
 def _check_command(ui, repo, **opts):
     rd = _get_datastore(ui, repo)