[PATCH 1 of 3] error: add a new exception named WdirRevNotSupportedError

Yuya Nishihara yuya at tcha.org
Sun May 21 08:00:33 EDT 2017


On Fri, 19 May 2017 20:37:52 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1495201237 -19800
> #      Fri May 19 19:10:37 2017 +0530
> # Node ID 10bab5388a7f11060a76c10d28d60578b428fdb0
> # Parent  67026d65a4fcea1a121930b9736469687c095e3e
> error: add a new exception named WdirRevNotSupportedError

general direction seems fine and is quite similar to my draft patches.
Can you include more details in commit message? (e.g. why it makes sense
to raise an exception.)

> --- a/mercurial/error.py
> +++ b/mercurial/error.py
> @@ -177,6 +177,9 @@
>  class ProgrammingError(RuntimeError):
>      """Raised if a mercurial (core or extension) developer made a mistake"""
>  
> +class WdirRevNotSupportedError(IndexError):
> +    """An exception which is raised when 'wdir()' is not supported"""

Nit: Strictly speaking, this isn't an error but an indication that a storage
class can't process wdir() so upper layer should do in place. So I would name
it WdirUnsupported or something, and make it not be inherited from IndexError.


More information about the Mercurial-devel mailing list