mercurial/dispatch.py
changeset 28623 38dc3f28f478
parent 28622 527cf881d000
child 28692 6b3b958daf03
equal deleted inserted replaced
28622:527cf881d000 28623:38dc3f28f478
   745         d = lambda: fn(ui, *args[1:])
   745         d = lambda: fn(ui, *args[1:])
   746         return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d,
   746         return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d,
   747                                   [], {})
   747                                   [], {})
   748 
   748 
   749 def _cmdattr(ui, cmd, func, attr):
   749 def _cmdattr(ui, cmd, func, attr):
   750     return getattr(func, attr)
   750     try:
       
   751         return getattr(func, attr)
       
   752     except AttributeError:
       
   753         ui.deprecwarn("missing attribute '%s', use @command decorator "
       
   754                       "to register '%s'" % (attr, cmd), '3.8')
       
   755         return False
   751 
   756 
   752 _loaded = set()
   757 _loaded = set()
   753 
   758 
   754 # list of (objname, loadermod, loadername) tuple:
   759 # list of (objname, loadermod, loadername) tuple:
   755 # - objname is the name of an object in extension module, from which
   760 # - objname is the name of an object in extension module, from which