X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/a57bd72016d3cf3ee8e8fd7ae2c12e047999b602..1f3bb0172efa4e5edf43f5407306f0cf3e1b717e:/stgit/commands/export.py diff --git a/stgit/commands/export.py b/stgit/commands/export.py index fbf5690..4136b7f 100644 --- a/stgit/commands/export.py +++ b/stgit/commands/export.py @@ -23,7 +23,7 @@ from optparse import OptionParser, make_option from stgit.commands.common import * from stgit.utils import * -from stgit import stack, git, basedir +from stgit import stack, git, templates help = 'exports a series of patches to (or patches)' @@ -141,20 +141,11 @@ def func(parser, options, args): # get the template if options.template: - patch_tmpl_list = [options.template] + tmpl = file(options.template).read() else: - 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')] - tmpl = '' - for patch_tmpl in patch_tmpl_list: - if os.path.isfile(patch_tmpl): - tmpl = file(patch_tmpl).read() - break + tmpl = templates.get_template('patchexport.tmpl') + if not tmpl: + tmpl = '' # note the base commit for this series if not options.stdout: