changeset 43261:f5aa4a53acd1

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
author Ian Moody <moz-ian@perix.co.uk>
date Sun, 06 Oct 2019 18:21:01 +0100
parents ec4dfcc39638
children af067d29b19e
files hgext/phabricator.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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(