# HG changeset patch # User Jun Wu # Date 2017-07-27 19:03:01 # Node ID 850d2ec2cf6a266987a401752c909f95dd8c4c53 # Parent 47829b89c8c6ccaab6916ec0fa34880f114a58f0 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 diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -560,7 +560,8 @@ def readpatch(repo, params, write, stack 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'))],