equal
deleted
inserted
replaced
8 |
8 |
9 from . import ( |
9 from . import ( |
10 configitems, |
10 configitems, |
11 error, |
11 error, |
12 pycompat, |
12 pycompat, |
13 util, |
|
14 ) |
13 ) |
15 |
14 |
16 # unlike the other registered items, config options are neither functions or |
15 # unlike the other registered items, config options are neither functions or |
17 # classes. Registering the option is just small function call. |
16 # classes. Registering the option is just small function call. |
18 # |
17 # |
62 |
61 |
63 if name in self._table: |
62 if name in self._table: |
64 msg = b'duplicate registration for name: "%s"' % name |
63 msg = b'duplicate registration for name: "%s"' % name |
65 raise error.ProgrammingError(msg) |
64 raise error.ProgrammingError(msg) |
66 |
65 |
67 if func.__doc__ and not util.safehasattr(func, '_origdoc'): |
66 if func.__doc__ and not hasattr(func, '_origdoc'): |
68 func._origdoc = func.__doc__.strip() |
67 func._origdoc = func.__doc__.strip() |
69 doc = pycompat.sysbytes(func._origdoc) |
68 doc = pycompat.sysbytes(func._origdoc) |
70 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) |
69 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) |
71 |
70 |
72 self._table[name] = func |
71 self._table[name] = func |