mercurial/fancyopts.py
changeset 36383 24b481668293
parent 36353 cc9d0763c8e9
child 37092 ef6215df2402
equal deleted inserted replaced
36382:b4d1c09b754b 36383:24b481668293
     7 
     7 
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
    10 import abc
    10 import abc
    11 import functools
    11 import functools
    12 import types
       
    13 
    12 
    14 from .i18n import _
    13 from .i18n import _
    15 from . import (
    14 from . import (
    16     error,
    15     error,
    17     pycompat,
    16     pycompat,
   220 
   219 
   221         On failure, abort can be called with a string error message."""
   220         On failure, abort can be called with a string error message."""
   222 
   221 
   223 class _simpleopt(customopt):
   222 class _simpleopt(customopt):
   224     def _isboolopt(self):
   223     def _isboolopt(self):
   225         return isinstance(self.defaultvalue, (bool, types.NoneType))
   224         return isinstance(self.defaultvalue, (bool, type(None)))
   226 
   225 
   227     def newstate(self, oldstate, newparam, abort):
   226     def newstate(self, oldstate, newparam, abort):
   228         return newparam
   227         return newparam
   229 
   228 
   230 class _callableopt(customopt):
   229 class _callableopt(customopt):