comparison contrib/phabricator.py @ 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 91e3dcefc9b7
children 40cfe3197bc1
comparison
equal deleted inserted replaced
33600:47829b89c8c6 33601:850d2ec2cf6a
558 meta = getdiffmeta(diffs[str(diffid)]) 558 meta = getdiffmeta(diffs[str(diffid)])
559 for k in _metanamemap.keys(): 559 for k in _metanamemap.keys():
560 if k in meta: 560 if k in meta:
561 header += '# %s %s\n' % (_metanamemap[k], meta[k]) 561 header += '# %s %s\n' % (_metanamemap[k], meta[k])
562 562
563 write(('%s%s\n%s') % (header, desc, body)) 563 content = '%s%s\n%s' % (header, desc, body)
564 write(encoding.unitolocal(content))
564 565
565 @command('phabread', 566 @command('phabread',
566 [('', 'stack', False, _('read dependencies'))], 567 [('', 'stack', False, _('read dependencies'))],
567 _('REVID [OPTIONS]')) 568 _('REVID [OPTIONS]'))
568 def phabread(ui, repo, revid, **opts): 569 def phabread(ui, repo, revid, **opts):