diff --git a/mercurial/registrar.py b/mercurial/registrar.py --- a/mercurial/registrar.py +++ b/mercurial/registrar.py @@ -8,6 +8,7 @@ from __future__ import absolute_import from . import ( + error, pycompat, util, ) @@ -50,6 +51,10 @@ class _funcregistrarbase(object): def _doregister(self, func, decl, *args, **kwargs): name = self._getname(decl) + if name in self._table: + msg = 'duplicate registration for name: "%s"' % name + raise error.ProgrammingError(msg) + if func.__doc__ and not util.safehasattr(func, '_origdoc'): doc = func.__doc__.strip() func._origdoc = doc