# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-05-19 13:40:37 # Node ID c8e10565a113f994271c2d0d18355340f7db5ef6 # Parent 284b18303f61f403e5c9fc979036271a620d3856 error: add a new exception named WdirUnsupported This series intents to support wdir() predicate with different operators like ~, ^. Currently the storage class don't support wdir(). This exception is introduced so that it can be raised from places where wdir() is passed and is not supported and we can catch this where we want to support the predicate. Also throwing an error at low level and catching at some higher level is better than using if-else especially for perf. diff --git a/mercurial/error.py b/mercurial/error.py --- a/mercurial/error.py +++ b/mercurial/error.py @@ -177,6 +177,9 @@ class PushRaced(RuntimeError): class ProgrammingError(Hint, RuntimeError): """Raised if a mercurial (core or extension) developer made a mistake""" +class WdirUnsupported(Exception): + """An exception which is raised when 'wdir()' is not supported""" + # bundle2 related errors class BundleValueError(ValueError): """error raised when bundle2 cannot be processed"""