Add --template option to export
authorCatalin Marinas <catalin.marinas@gmail.com>
Mon, 11 Jul 2005 17:44:40 +0000 (18:44 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 11 Jul 2005 17:44:40 +0000 (18:44 +0100)
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
ChangeLog
stgit/main.py

index 30c4b93..5b7e9d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-11  Catalin Marinas  <catalin.marinas@gmail.com>
+
+       * stgit/main.py (export): Add --template option to use a different
+       file as the export template rather than the default one
+
 2005-07-09  Catalin Marinas  <catalin.marinas@gmail.com>
 
        * Release 0.4
index 16d58a9..d93f2eb 100644 (file)
@@ -684,7 +684,10 @@ def export(parser, options, args):
         print >> series, pname
 
         # get the template
-        patch_tmpl = os.path.join(git.base_dir, 'patchexport.tmpl')
+        if options.template:
+            patch_tmpl = options.template
+        else:
+            patch_tmpl = os.path.join(git.base_dir, 'patchexport.tmpl')
         if os.path.isfile(patch_tmpl):
             tmpl = file(patch_tmpl).read()
         else:
@@ -734,7 +737,9 @@ export_cmd = \
                                 action = 'store_true'),
                     make_option('-d', '--diff',
                                 help = 'append .diff to the patch names',
-                                action = 'store_true')])
+                                action = 'store_true'),
+                    make_option('-t', '--template', metavar = 'FILE',
+                                help = 'Use FILE as a template')])
 
 #
 # The commands map