phabricator: change conduit data format to match arcanist
The existing form isn't handled well by Phabricator for certain data types.
Differential Revision: https://phab.mercurial-scm.org/D7052
--- a/hgext/phabricator.py Thu Oct 10 18:44:58 2019 +0100
+++ b/hgext/phabricator.py Sun Oct 06 18:21:01 2019 +0100
@@ -267,8 +267,15 @@
url, authinfo = util.url(b'/'.join([host, b'api', name])).authinfo()
ui.debug(b'Conduit Call: %s %s\n' % (url, pycompat.byterepr(params)))
params = params.copy()
- params[b'api.token'] = token
- data = urlencodenested(params)
+ params[b'__conduit__'] = {
+ b'token': token,
+ }
+ rawdata = {
+ b'params': templatefilters.json(params),
+ b'output': b'json',
+ b'__conduit__': 1,
+ }
+ data = urlencodenested(rawdata)
curlcmd = ui.config(b'phabricator', b'curlcmd')
if curlcmd:
sin, sout = procutil.popen2(