Patchwork [1,of,2] nodemap: use bytes for the error message

login
register
mail settings
Submitter Pierre-Yves David
Date Nov. 10, 2019, 5:26 p.m.
Message ID <26c342b1b1e492b5b3c0.1573406817@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/43104/
State Accepted
Headers show

Comments

Pierre-Yves David - Nov. 10, 2019, 5:26 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1573405970 -3600
#      Sun Nov 10 18:12:50 2019 +0100
# Node ID 26c342b1b1e492b5b3c08c0dcc71492784dc766c
# Parent  494731e060b7ebb613546f71127d4ffbc5e40019
# EXP-Topic nodemap-preparation
# Available At https://dev.heptapod.net/octobus/mercurial-devel/
#              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 26c342b1b1e4
nodemap: use bytes for the error message

Spotted by Yuya Nishihara.
Yuya Nishihara - Nov. 10, 2019, 11:33 p.m.
On Sun, 10 Nov 2019 18:26:57 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1573405970 -3600
> #      Sun Nov 10 18:12:50 2019 +0100
> # Node ID 26c342b1b1e492b5b3c08c0dcc71492784dc766c
> # Parent  494731e060b7ebb613546f71127d4ffbc5e40019
> # EXP-Topic nodemap-preparation
> # Available At https://dev.heptapod.net/octobus/mercurial-devel/
> #              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 26c342b1b1e4
> nodemap: use bytes for the error message

Queued, thanks.

> --- a/mercurial/revlogutils/__init__.py
> +++ b/mercurial/revlogutils/__init__.py
> @@ -11,4 +11,4 @@ from .. import error
>  
>  class NodeMap(dict):
>      def __missing__(self, x):
> -        raise error.RevlogError('unknown node: %s' % x)
> +        raise error.RevlogError(b'unknown node: %s' % x)

Perhaps, 'x' is a binary node id.

Patch

diff --git a/mercurial/revlogutils/__init__.py b/mercurial/revlogutils/__init__.py
--- a/mercurial/revlogutils/__init__.py
+++ b/mercurial/revlogutils/__init__.py
@@ -11,4 +11,4 @@  from .. import error
 
 class NodeMap(dict):
     def __missing__(self, x):
-        raise error.RevlogError('unknown node: %s' % x)
+        raise error.RevlogError(b'unknown node: %s' % x)