chiark / gitweb /
Have mail take the default for --prefix from stgit.mail.prefix.
authorYann Dirson <ydirson@altern.org>
Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)
It is more convenient to set the prefix once and for all in the config
file than each time on command line.

stgit/commands/mail.py

index cec1828bce44bc3ecfdb803bedbda4b77b0a6b8c..899cb1a24ace4b7091ffa06ce4c22b772a1ce741 100644 (file)
@@ -296,7 +296,11 @@ def __build_cover(tmpl, total_nr, msg_id, options):
     if options.prefix:
         prefix_str = options.prefix + ' '
     else:
-        prefix_str = ''
+        confprefix = config.get('stgit.mail.prefix')
+        if confprefix:
+            prefix_str = confprefix + ' '
+        else:
+            prefix_str = ''
         
     total_nr_str = str(total_nr)
     patch_nr_str = '0'.zfill(len(total_nr_str))
@@ -374,7 +378,11 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
     if options.prefix:
         prefix_str = options.prefix + ' '
     else:
-        prefix_str = ''
+        confprefix = config.get('stgit.mail.prefix')
+        if confprefix:
+            prefix_str = confprefix + ' '
+        else:
+            prefix_str = ''
         
     if options.diff_opts:
         diff_flags = options.diff_opts.split()