git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: git@vger.kernel.org, "Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH 3/9] Do not sleep after the last patch sent by e-mail
Date: Tue, 28 Apr 2009 16:09:52 +0100	[thread overview]
Message-ID: <20090428150952.27261.5637.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20090428150742.27261.19620.stgit@pc1117.cambridge.arm.com>

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
 stgit/commands/mail.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index 46e4b55..69b19fa 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -219,7 +219,7 @@ def __send_message_smtp(smtpserver, from_addr, to_addr_list, msg,
     s.quit()
 
 def __send_message(smtpserver, from_addr, to_addr_list, msg,
-                   sleep, smtpuser, smtppassword, use_tls):
+                   smtpuser, smtppassword, use_tls):
     """Message sending dispatcher.
     """
     if smtpserver.startswith('/'):
@@ -229,8 +229,6 @@ def __send_message(smtpserver, from_addr, to_addr_list, msg,
         # Use the SMTP server (we have host and port information)
         __send_message_smtp(smtpserver, from_addr, to_addr_list, msg,
                             smtpuser, smtppassword, use_tls)
-    # give recipients a chance of receiving patches in the correct order
-    time.sleep(sleep)
 
 def __build_address_headers(msg, options, extra_cc = []):
     """Build the address headers and check existing headers in the
@@ -619,7 +617,8 @@ def func(parser, options, args):
         else:
             out.start('Sending the cover message')
             __send_message(smtpserver, from_addr, to_addr_list, msg_string,
-                           sleep, smtpuser, smtppassword, smtpusetls)
+                           smtpuser, smtppassword, smtpusetls)
+            time.sleep(sleep)
             out.done()
 
     # send the patches
@@ -633,7 +632,7 @@ def func(parser, options, args):
         if not tmpl:
             raise CmdException, 'No e-mail template file found'
 
-    for (p, patch_nr) in zip(patches, range(1, len(patches) + 1)):
+    for (p, patch_nr) in zip(patches, range(1, total_nr + 1)):
         msg_id = email.Utils.make_msgid('stgit')
         msg = __build_message(tmpl, p, patch_nr, total_nr, msg_id, ref_id,
                               options)
@@ -650,5 +649,9 @@ def func(parser, options, args):
         else:
             out.start('Sending patch "%s"' % p)
             __send_message(smtpserver, from_addr, to_addr_list, msg_string,
-                           sleep, smtpuser, smtppassword, smtpusetls)
+                           smtpuser, smtppassword, smtpusetls)
+            # give recipients a chance of receiving related patches in the
+            # correct order.
+            if patch_nr < total_nr:
+                time.sleep(sleep)
             out.done()

  parent reply	other threads:[~2009-04-28 15:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 15:09 [StGit PATCH 0/9] Various StGit updates Catalin Marinas
2009-04-28 15:09 ` [StGit PATCH 1/9] Show "Pushing <patch>...done" when pushing a patch Catalin Marinas
2009-04-29  6:04   ` Karl Hasselström
2009-04-28 15:09 ` [StGit PATCH 2/9] Show some progress information when checking for upstream merges Catalin Marinas
2009-04-29  6:07   ` Karl Hasselström
2009-04-28 15:09 ` Catalin Marinas [this message]
2009-04-29  6:13   ` [StGit PATCH 3/9] Do not sleep after the last patch sent by e-mail Karl Hasselström
2009-04-28 15:09 ` [StGit PATCH 4/9] Convert 'clone' to the use stgit.lib Catalin Marinas
2009-04-29  6:21   ` Karl Hasselström
2009-05-13 16:10     ` Catalin Marinas
2009-04-28 15:10 ` [StGit PATCH 5/9] Convert 'hide' to the lib infrastructure Catalin Marinas
2009-04-29  6:27   ` Karl Hasselström
2009-05-13 16:08     ` Catalin Marinas
2009-04-28 15:10 ` [StGit PATCH 6/9] Convert 'unhide' " Catalin Marinas
2009-04-29  6:29   ` Karl Hasselström
2009-04-28 15:10 ` [StGit PATCH 7/9] Reinstate the --annotate option for refresh Catalin Marinas
2009-04-29  6:33   ` Karl Hasselström
2009-04-28 15:10 ` [StGit PATCH 8/9] Add the log --clear option Catalin Marinas
2009-04-29  6:35   ` Karl Hasselström
2009-04-28 15:10 ` [StGit PATCH 9/9] Use the default git colouring scheme rather than specific scripts Catalin Marinas
2009-04-29  6:43   ` Karl Hasselström
2009-04-29 11:48     ` Samuel Tardieu
2009-04-29 11:56       ` Samuel Tardieu
2009-04-29 14:25       ` Karl Hasselström
2009-05-04 12:48   ` Shinya Kuribayashi
2009-05-29 12:22     ` Catalin Marinas
2009-05-30  0:36       ` Shinya Kuribayashi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090428150952.27261.5637.stgit@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).