[PATCH] patchbomb: move command option help from the extension (patchbomb) to the command (email)

timeless timeless at gmail.com
Sun Oct 17 06:09:22 CDT 2010


# HG changeset patch
# User timeless <timeless at gmail.com>
# Date 1287313201 -10800
# Node ID 59c6181297239a77aae0b68b7d57bd82e1192b03
# Parent  8b438cb84c5746bea2bd8ec6cc3e98f6d1086173
patchbomb: move command option help from the extension (patchbomb) to the command (email)

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -22,10 +22,6 @@ Each message refers to the first in the 
 and References headers, so they will show up as a sequence in threaded
 mail and news readers, and in mail archives.
 
-With the -d/--diffstat or -c/--confirm options, you will be presented
-with a final summary of all messages and asked for confirmation before
-the messages are sent.
-
 To configure other defaults, add a section like this to your hgrc
 file::
 
@@ -42,30 +38,6 @@ override global ``[email]`` address sett
 Then you can use the :hg:`email` command to mail a series of
 changesets as a patchbomb.
 
-To avoid sending patches prematurely, it is a good idea to first run
-the :hg:`email` command with the "-n" option (test only). You will be
-prompted for an email recipient address, a subject and an introductory
-message describing the patches of your patchbomb. Then when all is
-done, patchbomb messages are displayed. If the PAGER environment
-variable is set, your pager will be fired up once for each patchbomb
-message, so you can verify everything is alright.
-
-The -m/--mbox option is also very useful. Instead of previewing each
-patchbomb message in a pager or sending the messages directly, it will
-create a UNIX mailbox file with the patch emails. This mailbox file
-can be previewed with any mail user agent which supports UNIX mbox
-files, e.g. with mutt::
-
-  % mutt -R -f mbox
-
-When you are previewing the patchbomb messages, you can use ``formail``
-(a utility that is commonly installed as part of the procmail
-package), to send each message out::
-
-  % formail -s sendmail -bm -t < mbox
-
-That should be all. Now your patchbomb is on its way out.
-
 You can also either configure the method option in the email section
 to be a sendmail compatible mailer or fill out the [smtp] section so
 that the patchbomb extension can automatically send patchbombs
@@ -184,10 +156,16 @@ def patchbomb(ui, repo, *revs, **opts):
     Each patch email has a Subject line of "[PATCH M of N] ...", using
     the first line of the changeset description as the subject text.
     The message contains two or three parts. First, the changeset
-    description. Next, (optionally) if the diffstat program is
-    installed and -d/--diffstat is used, the result of running
-    diffstat on the patch. Finally, the patch itself, as generated by
-    :hg:`export`.
+    description.
+
+    With the -d/--diffstat option, if the diffstat program is
+    installed, the result of running diffstat on the patch is inserted.
+
+    Finally, the patch itself, as generated by :hg:`export`.
+
+    With the -d/--diffstat or -c/--confirm options, you will be presented
+    with a final summary of all messages and asked for confirmation before
+    the messages are sent.
 
     By default the patch is included as text in the email body for
     easy reviewing. Using the -a/--attach option will instead create
@@ -202,6 +180,19 @@ def patchbomb(ui, repo, *revs, **opts):
     single email containing a binary Mercurial bundle as an attachment
     will be sent.
 
+    With -m/--mbox, instead of previewing each patchbomb message in a
+    pager or sending the messages directly, it will create a UNIX
+    mailbox file with the patch emails. This mailbox file can be
+    previewed with any mail user agent which supports UNIX mbox
+    files.
+
+    With -n/--test, all steps will run, but mail will not be sent.
+    You will be prompted for an email recipient address, a subject and
+    an introductory message describing the patches of your patchbomb.
+    Then when all is done, patchbomb messages are displayed. If the
+    PAGER environment variable is set, your pager will be fired up once
+    for each patchbomb message, so you can verify everything is alright.
+
     Examples::
 
       hg email -r 3000          # send patch 3000 only
@@ -219,6 +210,12 @@ def patchbomb(ui, repo, *revs, **opts):
       hg email -b -r 3000       # bundle of all ancestors of 3000 not in default
       hg email -b -r 3000 DEST  # bundle of all ancestors of 3000 not in DEST
 
+      hg email -o -m mbox &&    # generate an mbox file...
+        mutt -R -f mbox         # ... and view it with mutt
+      hg email -o -m mbox &&    # generate an mbox file ...
+        formail -s sendmail \   # ... and use formail to send from the mbox
+          -bm -t < mbox         # ... using sendmail
+
     Before using this command, you will need to enable email in your
     hgrc. See the [email] section in hgrc(5) for details.
     '''


More information about the Mercurial-devel mailing list