D4487: wireprotov2: add TODOs around extending changesetdata fields

2018-09-14 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG399ddd3227a4: wireprotov2: add TODOs around extending 
changesetdata fields (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4487?vs=10800=11065

REVISION DETAIL
  https://phab.mercurial-scm.org/D4487

AFFECTED FILES
  mercurial/exchangev2.py
  mercurial/wireprotov2server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -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:
diff --git a/mercurial/exchangev2.py b/mercurial/exchangev2.py
--- a/mercurial/exchangev2.py
+++ b/mercurial/exchangev2.py
@@ -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



To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D4487: wireprotov2: add TODOs around extending changesetdata fields

2018-09-05 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4487

AFFECTED FILES
  mercurial/exchangev2.py
  mercurial/wireprotov2server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -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:
diff --git a/mercurial/exchangev2.py b/mercurial/exchangev2.py
--- a/mercurial/exchangev2.py
+++ b/mercurial/exchangev2.py
@@ -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



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel