[PATCH 1 of 5] repair: use ProgrammingError

Jun Wu quark at fb.com
Mon Mar 27 02:57:48 EDT 2017


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 ?
> 


More information about the Mercurial-devel mailing list