D6808: revlog: introduce a `sidedata` method
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sat Sep 7 09:28:16 UTC 2019
marmoute created this revision.
marmoute added reviewers: yuja, durin42.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The method give access to extra information related to the revision. Such data
will not be part of the hash be strongly related to the revision. Having them
stored at the revlog level helps the storage consistency story and simplify
various things.
Example of data we could store there:
- copy tracing related informations
- graph structure related information (useful for discovery)
- unresolved conflict data
The full implementation will be introduced gradually in the coming changesets.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D6808
AFFECTED FILES
mercurial/revlog.py
CHANGE DETAILS
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1612,6 +1612,16 @@
"""
return self._revisiondata(nodeorrev, _df, raw=raw)
+ def sidedata(self, nodeorrev, _df=None):
+ """a map of extra data related to the changeset but not part of the hash
+
+ This function currently return a dictionary. However, more advanced
+ mapping object will likely be used in the future for a more
+ efficient/lazy code.
+ """
+ # XXX will actualy return data once storage is implemented.
+ return {}
+
def _revisiondata(self, nodeorrev, _df=None, raw=False):
# deal with <nodeorrev> argument type
if isinstance(nodeorrev, int):
To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list