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 |