# HG changeset patch # User Mads Kiilerich # Date 2014-09-28 14:57:37 # Node ID 660861a6fad4ffa859b6b17504181ef07b6b82bc # Parent e48a5d3996c21b813f5243b265ab3e5a5fdf162d templater: inline global 'path' list in templatepaths diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -553,7 +553,6 @@ funcs = { # template engine -path = ['templates', '../templates'] stringify = templatefilters.stringify def _flatten(thing): @@ -712,16 +711,10 @@ class templater(object): def templatepaths(): '''return locations used for template files.''' - normpaths = [] - for f in path: - if f.startswith('/'): - p = f - else: - fl = f.split('/') - p = os.path.join(util.datapath, *fl) - if os.path.isdir(p): - normpaths.append(os.path.normpath(p)) - return normpaths + pathsrel = ['templates', '../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)] def templatepath(name): '''return location of template file. returns None if not found.'''