phabricator: update the protocol documentation
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 26 Feb 2020 14:43:02 -0500
changeset 44393 adb93aa98c78
parent 44392 efd73cdcfbac
child 44394 5e3402a0b868
phabricator: update the protocol documentation The `branch` property wasn't added to the `hg:meta` example when it was added to the metadata in d49ab47be8a6. Additionally, `properties` in the Differential Revision dict is a dinctionary, not a list. While here, also alphabetize the responses from Phabricator because that's how it is being printed with `hg debugcallconduit`, and this makes it easier to compare. Differential Revision: https://phab.mercurial-scm.org/D8170
hgext/phabricator.py
--- a/hgext/phabricator.py	Wed Feb 26 10:56:27 2020 -0500
+++ b/hgext/phabricator.py	Wed Feb 26 14:43:02 2020 -0500
@@ -1407,39 +1407,42 @@
     A "Differential Revision dict" looks like:
 
         {
-            "id": "2",
-            "phid": "PHID-DREV-672qvysjcczopag46qty",
-            "title": "example",
-            "uri": "https://phab.example.com/D2",
+            "activeDiffPHID": "PHID-DIFF-xoqnjkobbm6k4dk6hi72",
+            "authorPHID": "PHID-USER-tv3ohwc4v4jeu34otlye",
+            "auxiliary": {
+              "phabricator:depends-on": [
+                "PHID-DREV-gbapp366kutjebt7agcd"
+              ]
+              "phabricator:projects": [],
+            },
+            "branch": "default",
+            "ccs": [],
+            "commits": [],
             "dateCreated": "1499181406",
             "dateModified": "1499182103",
-            "authorPHID": "PHID-USER-tv3ohwc4v4jeu34otlye",
-            "status": "0",
-            "statusName": "Needs Review",
-            "properties": [],
-            "branch": null,
-            "summary": "",
-            "testPlan": "",
-            "lineCount": "2",
-            "activeDiffPHID": "PHID-DIFF-xoqnjkobbm6k4dk6hi72",
             "diffs": [
               "3",
               "4",
             ],
-            "commits": [],
+            "hashes": [],
+            "id": "2",
+            "lineCount": "2",
+            "phid": "PHID-DREV-672qvysjcczopag46qty",
+            "properties": {},
+            "repositoryPHID": "PHID-REPO-hub2hx62ieuqeheznasv",
             "reviewers": [],
-            "ccs": [],
-            "hashes": [],
-            "auxiliary": {
-              "phabricator:projects": [],
-              "phabricator:depends-on": [
-                "PHID-DREV-gbapp366kutjebt7agcd"
-              ]
-            },
-            "repositoryPHID": "PHID-REPO-hub2hx62ieuqeheznasv",
             "sourcePath": null
+            "status": "0",
+            "statusName": "Needs Review",
+            "summary": "",
+            "testPlan": "",
+            "title": "example",
+            "uri": "https://phab.example.com/D2",
         }
     """
+    # TODO: replace differential.query and differential.querydiffs with
+    # differential.diff.search because the former (and their output) are
+    # frozen, and planned to be deprecated and removed.
 
     def fetch(params):
         """params -> single drev or None"""
@@ -1544,6 +1547,7 @@
 
         "properties": {
           "hg:meta": {
+            "branch": "default",
             "date": "1499571514 25200",
             "node": "98c08acae292b2faf60a279b4189beb6cff1414d",
             "user": "Foo Bar <foo@example.com>",
@@ -1557,16 +1561,16 @@
           "local:commits": {
             "98c08acae292b2faf60a279b4189beb6cff1414d": {
               "author": "Foo Bar",
-              "time": 1499546314,
+              "authorEmail": "foo@example.com"
               "branch": "default",
-              "tag": "",
               "commit": "98c08acae292b2faf60a279b4189beb6cff1414d",
+              "local": "1000",
+              "message": "...",
+              "parents": ["6d0abad76b30e4724a37ab8721d630394070fe16"],
               "rev": "98c08acae292b2faf60a279b4189beb6cff1414d",
-              "local": "1000",
-              "parents": ["6d0abad76b30e4724a37ab8721d630394070fe16"],
               "summary": "...",
-              "message": "...",
-              "authorEmail": "foo@example.com"
+              "tag": "",
+              "time": 1499546314,
             }
           }
         }