changeset 42980:0d1272783f24

revlog: introduce a `sidedata` method 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. Differential Revision: https://phab.mercurial-scm.org/D6808
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 03 Sep 2019 22:36:27 +0200
parents b4093d1d3b18
children 35ab2c1a58aa
files mercurial/revlog.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Sep 25 14:35:08 2019 -0700
+++ b/mercurial/revlog.py	Tue Sep 03 22:36:27 2019 +0200
@@ -1616,6 +1616,16 @@
             util.nouideprecwarn(msg, '5.2', stacklevel=2)
         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):