Patchwork revlog: deprecate the use of `revision(..., raw=True)`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 2, 2019, 3:07 p.m.
Message ID <9b819fcdb7a8a0f377f3.1567436820@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41467/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 2, 2019, 3:07 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.
Yuya Nishihara - Sept. 4, 2019, 11:31 p.m.
On Mon, 02 Sep 2019 17:07:00 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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)`

Queued, thanks.

Patch

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):