Fix "mail" command when description contains "From"
[stgit] / stgit / commands / mail.py
index 6be00fc..45b2ca8 100644 (file)
@@ -97,7 +97,9 @@ options = [make_option('-a', '--all',
            make_option('-u', '--smtp-user', metavar = 'USER',
                        help = 'username for SMTP authentication'),
            make_option('-p', '--smtp-password', metavar = 'PASSWORD',
-                       help = 'username for SMTP authentication')]
+                       help = 'username for SMTP authentication'),
+           make_option('-b', '--branch',
+                       help = 'use BRANCH instead of the default one')]
 
 
 def __get_maintainer():
@@ -125,7 +127,7 @@ def __parse_addresses(string):
         elif re.match('(to|cc|bcc):\s+', line, re.I):
             to_addr_list += __addr_list(line)
 
-    if len(from_addr_list) != 1:
+    if len(from_addr_list) == 0:
         raise CmdException, 'No "From" address'
     if len(to_addr_list) == 0:
         raise CmdException, 'No "To/Cc/Bcc" addresses'