Add the "smtpdelay" config option
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
This option is similar to the --sleep option for the mail command, i.e. the
number of seconds between sending two consecutive patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
examples/stgitrc
stgit/commands/mail.py
stgit/config.py

index d9bd6ca..fdb11b1 100644 (file)
@@ -17,6 +17,9 @@ smtpserver: localhost:25
 #smtpuser: username
 #smtppassword: password
 
+# delay between messages in seconds (defaults to 2)
+#smtpdelay: 2
+
 # stg will look for this first, then look for the EDITOR environmental
 # variable, then default to using 'vi'
 #editor: /usr/bin/vi
index 88e9241..456c4b1 100644 (file)
@@ -426,7 +426,7 @@ def func(parser, options, args):
     if options.sleep != None:
         sleep = options.sleep
     else:
-        sleep = 2
+        sleep = config.getint('stgit', 'smtpdelay')
 
     # send the cover message (if any)
     if options.cover or options.edit:
index a124cb7..e6c9538 100644 (file)
@@ -32,6 +32,7 @@ config = ConfigParser.RawConfigParser()
 config.add_section('stgit')
 config.set('stgit', 'autoresolved', 'no')
 config.set('stgit', 'smtpserver', 'localhost:25')
+config.set('stgit', 'smtpdelay', '2')
 config.set('stgit', 'merger',
            'diff3 -L local -L older -L remote -m -E ' \
            '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"')