Patchwork sparse: raise a move verbose index error from the C code

login
register
mail settings
Submitter Boris Feld
Date Nov. 28, 2018, 6:36 p.m.
Message ID <237d0b9e6b0474084593.1543430206@pc62.home>
Download mbox | patch
Permalink /patch/36828/
State Accepted
Headers show

Comments

Boris Feld - Nov. 28, 2018, 6:36 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1543281014 -3600
#      Tue Nov 27 02:10:14 2018 +0100
# Node ID 237d0b9e6b04740845930e1322bde978bab7da92
# Parent  0800d9e6e216b2ca59f05788b288685b8d7b2d93
# EXP-Topic sparse-cext
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 237d0b9e6b04
sparse: raise a move verbose index error from the C code

If we don't like a value we should print it.
Yuya Nishihara - Nov. 29, 2018, 11:44 a.m.
On Wed, 28 Nov 2018 19:36:46 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1543281014 -3600
> #      Tue Nov 27 02:10:14 2018 +0100
> # Node ID 237d0b9e6b04740845930e1322bde978bab7da92
> # Parent  0800d9e6e216b2ca59f05788b288685b8d7b2d93
> # EXP-Topic sparse-cext
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 237d0b9e6b04
> sparse: raise a move verbose index error from the C code

Queued, thanks.

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1182,7 +1182,7 @@  static PyObject *index_slicechunktodensi
 			goto bail;
 		}
 		if (revnum < 0 || revnum >= idxlen) {
-			PyErr_SetString(PyExc_IndexError, "index out of range");
+			PyErr_Format(PyExc_IndexError, "index out of range: %zd", revnum);
 			goto bail;
 		}
 		revs[i] = revnum;