From 94d1886878f54807b7c2be9eec9410723c04f2f2 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 16 Apr 2006 12:52:46 +0200 Subject: [PATCH] Look for templates in ~/.stgit/templates as well This can be quite useful to avoid adding one's sig again and again to ever covermail, and to use a patchmail template that insert Signed-off-by lines, for those of us who prefer this to adding them to commits. Also make sure to use os.path.join() instead of hardcoded slashes. Signed-off-by: Yann Dirson --- stgit/commands/export.py | 9 ++++++--- stgit/commands/mail.py | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/stgit/commands/export.py b/stgit/commands/export.py index e7de902a..fbf5690a 100644 --- a/stgit/commands/export.py +++ b/stgit/commands/export.py @@ -31,8 +31,9 @@ usage = """%prog [options] [] Export the applied patches into a given directory (defaults to 'patches') in a standard unified GNU diff format. A template file -(defaulting to '.git/patchexport.tmpl or -/usr/share/stgit/templates/patchexport.tmpl') can be used for the +(defaulting to '.git/patchexport.tmpl' or +'~/.stgit/templates/patchexport.tmpl' or +'/usr/share/stgit/templates/patchexport.tmpl') can be used for the patch format. The following variables are supported in the template file: @@ -145,8 +146,10 @@ def func(parser, options, args): patch_tmpl_list = [] patch_tmpl_list += [os.path.join(basedir.get(), 'patchexport.tmpl'), + os.path.join(os.path.expanduser('~'), '.stgit', 'templates', + 'patchexport.tmpl'), os.path.join(sys.prefix, - 'share/stgit/templates/patchexport.tmpl')] + 'share', 'stgit', 'templates', 'patchexport.tmpl')] tmpl = '' for patch_tmpl in patch_tmpl_list: if os.path.isfile(patch_tmpl): diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 470cf655..5e01ea1e 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -30,16 +30,18 @@ usage = """%prog [options] [ [