[Updated] D8804: templater: make templatepath() not return directory paths

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sun Aug 2 16:08:07 UTC 2020


Closed by commit rHG9a308336fe41: templater: make templatepath() not return directory paths (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8804?vs=22136&id=22181

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8804/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8804

AFFECTED FILES
  mercurial/templater.py
  tests/test-template-map.t

CHANGE DETAILS

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 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:
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1072,7 +1072,7 @@
     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
 



To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200802/9bbb4798/attachment-0002.html>


More information about the Mercurial-patches mailing list