I'm trying to follow the sample code for writing Mercurial extensions. This is a minimal sample, copied verbatim from the sample code:
from mercurial import cmdutil
from mercurial.i18n import _
cmdtable = {}
command = cmdutil.command(cmdtable)
I save this to a file and install the extension in my .hgrc
file like so:
[extensions]
myext=C:\foo\myext.py
Any subsequently issued command, like e.g. hg init
now results in the following error message:
*** failed to import extension myext from C:\foo\myext.py: 'module' object has no attribute 'command'
Could this possibly be caused by a faulty environment, e.g. missing environment variables?
I'm using Mercurial 4.7 on Windows 10, installed by the TortoiseHg installer (tortoisehg-4.7.0-x64). Mercurial uses Python 2.7.13, also installed by the TortoiseHg installer.