Patchwork D8805: formatter: remove now-unnecessary check for file-ness

login
register
mail settings
Submitter phabricator
Date July 24, 2020, 6:01 a.m.
Message ID <differential-rev-PHID-DREV-5nvy77fyuz4emwvuygbf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46857/
State Superseded
Headers show

Comments

phabricator - July 24, 2020, 6:01 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `templater.templatepath()` now returns non-`None` only for files, so
  the caller doesn't have to check.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/formatter.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -584,7 +584,7 @@ 
         mapname = templater.templatepath(
             b'map-cmdline.' + tmpl
         ) or templater.templatepath(tmpl)
-        if mapname and os.path.isfile(mapname):
+        if mapname:
             return templatespec(topic, None, mapname)
 
     # perhaps it's a reference to [templates]