[PATCH] templater: add os.path.expanduser('~/.hgtemplates') to path

Dale Wijnand dale.wijnand at gmail.com
Fri Oct 15 12:13:13 UTC 2010


# HG changeset patch
# User Dale Wijnand <dale.wijnand at gmail.com>
# Date 1287140714 -7200
# Node ID d65e497b5c708b746c428c751394ea9c8c30e9d9
# Parent  80a3d1121c106fd972fa84423f55b2ce2e9407c9
templater: add os.path.expanduser('~/.hgtemplates') to path

This adds ~/.hgtemplates to the paths searched for templates. It allows for users without superuser priviledges to add templates which are easily accessable (without having to give the full path to the template.)

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -9,7 +9,7 @@
 import sys, os
 import util, config, templatefilters
 
-path = ['templates', '../templates']
+path = ['templates', '../templates', os.path.expanduser('~/.hgtemplates')]
 stringify = templatefilters.stringify
 
 def _flatten(thing):



More information about the Mercurial-devel mailing list