[PATCH] revlog: deprecate the use of `revision(..., raw=True)`

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Sep 2 11:07:00 EDT 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1567434523 -7200
#      Mon Sep 02 16:28:43 2019 +0200
# Node ID 9b819fcdb7a8a0f377f3e8944fe4b50e579ceab4
# Parent  ce6797ef6eab33f0255b940ff6b628215762a84b
# EXP-Topic rawdata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9b819fcdb7a8
revlog: deprecate the use of `revision(..., raw=True)`

We have an official `rawdata` function now.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1610,6 +1610,10 @@ class revlog(object):
         treated as raw data when applying flag transforms. 'raw' should be set
         to True when generating changegroups or in debug commands.
         """
+        if raw:
+            msg = ('revlog.revision(..., raw=True) is deprecated, '
+                   'use revlog.rawdata(...)')
+            util.nouideprecwarn(msg, '5.2', stacklevel=2)
         return self._revisiondata(nodeorrev, _df, raw=raw)
 
     def _revisiondata(self, nodeorrev, _df=None, raw=False):


More information about the Mercurial-devel mailing list