diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1672,7 +1672,7 @@ fm.write(b'templatedirs', b'checking templates (%s)...\n', p or b'') fm.condwrite(not p, b'', _(b" no template directories found\n")) if p: - m = templater.templatepath(b"map-cmdline.default") + m = templater.templatepath(b"default") if m: # template found, check if it is working err = None diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -581,9 +581,7 @@ # perhaps a stock style? if not os.path.split(tmpl)[0]: - mapname = templater.templatepath( - b'map-cmdline.' + tmpl - ) or templater.templatepath(tmpl) + mapname = templater.templatepath(tmpl) if mapname: return templatespec(topic, None, mapname) diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -628,9 +628,7 @@ if not tmpl and style: mapfile = style if not os.path.split(mapfile)[0]: - mapname = templater.templatepath( - b'map-cmdline.' + mapfile - ) or templater.templatepath(mapfile) + mapname = templater.templatepath(mapfile) if mapname: mapfile = mapname return templatespec(None, mapfile) diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1071,9 +1071,10 @@ dir = templatedir() if dir is None: return None - f = os.path.join(templatedir(), name) - if f and os.path.isfile(f): - return f + for filename in (b'map-cmdline.' + name, name): + f = os.path.join(dir, filename) + if f and os.path.isfile(f): + return f return None