# HG changeset patch # User Martin von Zweigbergk # Date 2020-07-24 05:47:55 # Node ID 9a308336fe41946b111a9fed17d2cc0341ee4694 # Parent 46c8db8d4e03aa55e3415dc07c20187b1884279d templater: make templatepath() not return directory paths The previous patch added a test showing an unusal error message. This make it more like other error messages. Differential Revision: https://phab.mercurial-scm.org/D8804 diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1072,7 +1072,7 @@ def templatepath(name): if dir is None: return None f = os.path.join(templatedir(), name) - if f and os.path.exists(f): + if f and os.path.isfile(f): return f return None diff --git a/tests/test-template-map.t b/tests/test-template-map.t --- a/tests/test-template-map.t +++ b/tests/test-template-map.t @@ -1284,7 +1284,8 @@ Error if style is a directory: Error if style is a directory whose name is a built-in style: $ hg log --style coal - abort: Is a directory: '*/mercurial/templates/coal' (glob) + abort: style 'coal' not found + (available styles: bisect, changelog, compact, default, phases, show, status, xml) [255] Error if style missing key: