wireprotov2: add TODOs around extending changesetdata fields
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 22 Aug 2018 14:51:11 -0700
changeset 39652 399ddd3227a4
parent 39651 349482d726ee
child 39653 c7a7c7e844e5
wireprotov2: add TODOs around extending changesetdata fields Extensions will inevitably want to extend the set of changeset data/fields that can be requested. We'll need to implement support for extending this in the future. Add some TODOs to track that. Differential Revision: https://phab.mercurial-scm.org/D4487
mercurial/exchangev2.py
mercurial/wireprotov2server.py
--- a/mercurial/exchangev2.py	Wed Aug 29 17:03:19 2018 -0700
+++ b/mercurial/exchangev2.py	Wed Aug 22 14:51:11 2018 -0700
@@ -147,6 +147,9 @@
             for mark in cset.get(b'bookmarks', []):
                 remotebookmarks[mark] = node
 
+            # TODO add mechanism for extensions to examine records so they
+            # can siphon off custom data fields.
+
             # Some entries might only be metadata only updates.
             if b'revisionsize' not in cset:
                 continue
--- a/mercurial/wireprotov2server.py	Wed Aug 29 17:03:19 2018 -0700
+++ b/mercurial/wireprotov2server.py	Wed Aug 22 14:51:11 2018 -0700
@@ -397,6 +397,8 @@
         'framingmediatypes': [FRAMINGTYPE],
     }
 
+    # TODO expose available changesetdata fields.
+
     for command, entry in COMMANDS.items():
         caps['commands'][command] = {
             'args': entry.args,
@@ -474,6 +476,8 @@
 def changesetdata(repo, proto, noderange=None, nodes=None, fields=None):
     fields = fields or set()
 
+    # TODO look for unknown fields and abort when they can't be serviced.
+
     if noderange is None and nodes is None:
         raise error.WireprotoCommandError(
             'noderange or nodes must be defined')
@@ -563,6 +567,9 @@
             revisiondata = cl.revision(node, raw=True)
             d[b'revisionsize'] = len(revisiondata)
 
+        # TODO make it possible for extensions to wrap a function or register
+        # a handler to service custom fields.
+
         yield d
 
         if revisiondata is not None: