[PATCH 1 of 5] repair: use ProgrammingError

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Mar 27 02:27:51 EDT 2017



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


More information about the Mercurial-devel mailing list