changeset 33601:850d2ec2cf6a stable

phabricator: convert unicode to binary when writing patches This is a quick fix to make `hg phabread D189` work. It seems we might want to replace all `r''` to `u''`, and add more `encoding.*to*` to be more explicit when interacting with `json` module. Differential Revision: https://phab.mercurial-scm.org/D192
author Jun Wu <quark@fb.com>
date Thu, 27 Jul 2017 12:03:01 -0700
parents 47829b89c8c6
children 27fbca750b4d a00580bc135f
files contrib/phabricator.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/phabricator.py	Thu Jul 27 23:15:14 2017 +0900
+++ b/contrib/phabricator.py	Thu Jul 27 12:03:01 2017 -0700
@@ -560,7 +560,8 @@
             if k in meta:
                 header += '# %s %s\n' % (_metanamemap[k], meta[k])
 
-        write(('%s%s\n%s') % (header, desc, body))
+        content = '%s%s\n%s' % (header, desc, body)
+        write(encoding.unitolocal(content))
 
 @command('phabread',
          [('', 'stack', False, _('read dependencies'))],