git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/6] stg mail: reorder __build_[message|cover] parameters

From
ACAlex Chiang <achiang@hp.com>
Date
Nov 28, 2009, 19:50 UTC
Message-ID
<20091128195021.949.83804.stgit@bob.kio>
In-Reply-To
<20091128194056.949.88791.stgit@bob.kio>
Reorder the argument lists for both __build_cover and __build_message.
This change will aid readability of a subsequent refactoring patch.
Cc: Karl Wiberg <kha@treskal.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
---
 stgit/commands/mail.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index 3978f5e..b6fc3d9 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -370,7 +370,7 @@ def __edit_message(msg):
 
     return msg
 
-def __build_cover(tmpl, patches, msg_id, options):
+def __build_cover(tmpl, msg_id, options, patches):
     """Build the cover message (series description) to be sent via SMTP
     """
     sender = __get_sender()
@@ -439,7 +439,7 @@ def __build_cover(tmpl, patches, msg_id, options):
 
     return msg
 
-def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
+def __build_message(tmpl, msg_id, options, patch, patch_nr, total_nr, ref_id):
     """Build the message to be sent via SMTP
     """
     p = crt_series.get_patch(patch)
@@ -600,7 +600,7 @@ def func(parser, options, args):
                 raise CmdException, 'No cover message template file found'
 
         msg_id = email.Utils.make_msgid('stgit')
-        msg = __build_cover(tmpl, patches, msg_id, options)
+        msg = __build_cover(tmpl, msg_id, options, patches)
         from_addr, to_addr_list = __parse_addresses(msg)
 
         msg_string = msg.as_string(options.mbox)
@@ -630,8 +630,8 @@ def func(parser, options, args):
 
     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)
+        msg = __build_message(tmpl, msg_id, options, p, patch_nr, total_nr,
+                              ref_id)
         from_addr, to_addr_list = __parse_addresses(msg)
 
         msg_string = msg.as_string(options.mbox)
Previous: Alex ChiangNext: Alex Chiang
Message 5 of 18 in “add support for git send-email”
  1. 0/6 add support for git send-emailAlex Chiang, Nov 28, 2009
  2. 1/6 stg mail: Refactor __send_message and friendsAlex Chiang, Nov 28, 2009
  3. Karl WibergNov 29, 2009
  4. Alex ChiangNov 30, 2009
  5. 2/6 stg mail: reorder __build_[message|cover] parametersAlex Chiang, Nov 28, 2009
  6. 3/6 stg mail: make __send_message do moreAlex Chiang, Nov 28, 2009
  7. Karl WibergNov 29, 2009
  8. Alex ChiangNov 30, 2009
  9. Karl WibergDec 1, 2009
  10. 4/6 stg mail: factor out __update_headerAlex Chiang, Nov 28, 2009
  11. 5/6 stg mail: add basic support for git send-emailAlex Chiang, Nov 28, 2009
  12. Karl WibergNov 29, 2009
  13. Alex ChiangDec 1, 2009
  14. Karl WibergDec 1, 2009
  15. 6/6 stg mail: don't parse To/Cc/Bcc in --git modeAlex Chiang, Nov 28, 2009
  16. Karl WibergNov 29, 2009
  17. Alex ChiangDec 1, 2009
  18. Karl WibergDec 1, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.