+ # send the cover message (if any)
+ if options.cover or options.edit:
+ # find the template file
+ if options.cover:
+ tfile_list = [options.cover]
+ else:
+ tfile_list = [os.path.join(git.base_dir, 'covermail.tmpl'),
+ os.path.join(sys.prefix,
+ 'share/stgit/templates/covermail.tmpl')]
+
+ tmpl = None
+ for tfile in tfile_list:
+ if os.path.isfile(tfile):
+ tmpl = file(tfile).read()
+ break
+ if not tmpl:
+ raise CmdException, 'No cover message template file found'