[Request] [+ ] D8805: formatter: remove now-unnecessary check for file-ness
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Fri Jul 24 06:01:54 UTC 2020
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
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]
To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200724/94cd0595/attachment.html>
More information about the Mercurial-patches
mailing list