[PATCH 1 of 5] repair: use ProgrammingError

Augie Fackler raf at durin42.com
Mon Mar 27 09:11:02 EDT 2017


On Mon, Mar 27, 2017 at 09:18:55AM +0200, Pierre-Yves David wrote:
> Sure, that seems like a good idea. Can you see to it ?

It's a good idea, but I feel like the name "ProgrammingError" alone
provides some clue as to what's going on, and the migration is good.

Queued, I wouldn't mind a followup to make the hint generic to all
ProgrammingError instances, but I'm not willing to block on it either.

> (I just replied on repair because this is the first changeset in the series)
>
> On 03/27/2017 08:57 AM, Jun Wu wrote:
> > I think ProgrammingError should all have that hint. So this is not repair.py
> > specific.
> >
> > Excerpts from Pierre-Yves David's message of 2017-03-27 08:27:51 +0200:
> > >
> > > On 03/27/2017 02:14 AM, Jun Wu wrote:
> > > > # HG changeset patch
> > > > # User Jun Wu <quark at fb.com>
> > > > # Date 1490572408 25200
> > > > #      Sun Mar 26 16:53:28 2017 -0700
> > > > # Node ID 92d7eff3f4c7e44e8aab62b486bda78a37b73b83
> > > > # Parent  e86eb75e74ce1b0803c26d86a229b9b711f6d76a
> > > > # Available At https://bitbucket.org/quark-zju/hg-draft
> > > > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r 92d7eff3f4c7
> > > > repair: use ProgrammingError
> > > >
> > > > diff --git a/mercurial/repair.py b/mercurial/repair.py
> > > > --- a/mercurial/repair.py
> > > > +++ b/mercurial/repair.py
> > > > @@ -164,6 +164,5 @@ def strip(ui, repo, nodelist, backup=Tru
> > > >      if curtr is not None:
> > > >          del curtr  # avoid carrying reference to transaction for nothing
> > > > -        msg = _('programming error: cannot strip from inside a transaction')
> > > > -        raise error.Abort(msg, hint=_('contact your extension maintainer'))
> > > > +        raise error.ProgrammingError('cannot strip from inside a transaction')
> > >
> > > AS much as I like the idea of moving to Programming error, this patches
> > > series drops an important hint. Can we have a version that preserve the
> > > hint ?
> > >
>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list