diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -36,7 +36,7 @@ def _pythonhook(ui, repo, name, hname, f d = funcname.rfind('.') if d == -1: raise error.HookLoadError( - _('%s hook is invalid ("%s" not in a module)') + _('%s hook is invalid: "%s" not in a module') % (hname, funcname)) modname = funcname[:d] oldpaths = sys.path diff --git a/tests/test-hook.t b/tests/test-hook.t --- a/tests/test-hook.t +++ b/tests/test-hook.t @@ -496,7 +496,7 @@ test python hooks $ hg pull ../a pulling from ../a searching for changes - abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module) + abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module [255] $ echo '[hooks]' > ../a/.hg/hgrc