--- a/mercurial/help/internals/extensions.txt Fri Jan 18 13:32:02 2019 -0500
+++ b/mercurial/help/internals/extensions.txt Fri Jan 18 23:13:04 2019 -0500
@@ -28,11 +28,16 @@
Example using ``@command`` decorator (requires Mercurial 1.9)::
- from mercurial import cmdutil
from mercurial.i18n import _
cmdtable = {}
- command = cmdutil.command(cmdtable)
+ try:
+ from mercurial import registrar
+ command = registrar.command(cmdtable)
+ except (AttributeError, ImportError):
+ # Fallback to hg < 4.3 support
+ from mercurial import cmdutil
+ command = cmdutil.command(cmdtable)
@command('print-parents',
[('s', 'short', None, _('print short form')),