[PATCH 5 of 7] templater: don't search randomly for templates - trust util.datapath
Mads Kiilerich
mads at kiilerich.com
Sun Sep 28 15:03:02 UTC 2014
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1411916257 -7200
# Sun Sep 28 16:57:37 2014 +0200
# Node ID 8ab3da1c749ebbb3a1b7111ebccbffb2a497b600
# Parent bfb29147145157d7f8f0c312867cddda4f0ab72d
templater: don't search randomly for templates - trust util.datapath
The search was introduced in 2653740d8118. It might have been necessary back
then when using __file__ directly and frozen-ness wasn't considered. Now we
should know exactly where the templates can be found.
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -711,7 +711,7 @@ class templater(object):
def templatepaths():
'''return locations used for template files.'''
- pathsrel = ['templates', '../templates']
+ pathsrel = ['templates']
paths = [os.path.normpath(os.path.join(util.datapath, f))
for f in pathsrel]
return [p for p in paths if os.path.isdir(p)]
More information about the Mercurial-devel
mailing list