1. Jang Junseong
  2. mercurial-reviewboard

Commits

Jang Junseong  committed 8d7e263

converts field encoding from local to UTF-8 for non-ascii support

  • Participants
  • Parent commits b2a080e
  • Branches default

Comments (0)

Files changed (1)

File mercurial_reviewboard/__init__.py

View file
  • Ignore whitespace
 from distutils.version import LooseVersion
 import operator
 
-from mercurial import cmdutil, hg, ui, mdiff, patch, util
+from mercurial import cmdutil, hg, ui, mdiff, patch, util, encoding
 from mercurial.i18n import _
 
 from reviewboard import make_rbclient, ReviewBoardError
             ui.status('default summary: %s\n' % default_summary)
             ui.status('enter summary (or return for default):\n') 
             summary = readline().strip()
-            if summary:
-                fields['summary'] = summary
-            else:
-                fields['summary'] = default_summary
+            if not summary:
+                summary = default_summary
         else:
-            fields['summary'] = default_summary
+            summary = default_summary
+
+        fields['summary'] = encoding.fromlocal(summary)
 
         # description
         if interactive:
                 description += changesets_string
         else:
             description = changesets_string
-        fields['description'] = description 
+        fields['description'] = encoding.fromlocal(description)
         
-        fields['branch'] = c.branch()
+        fields['branch'] = encoding.fromlocal(c.branch())
 
     for field in ('target_groups', 'target_people', 'bugs_closed'):
         if opts.get(field):
         else:
             value = ui.config('reviewboard', field)
         if value:
-            fields[field] = value 
+            fields[field] = encoding.fromlocal(value)
     
     return fields