changeset 12749:338b4b615d33

patchbomb: move command option help from the extension (patchbomb) to the command (email)
author timeless <timeless@gmail.com>
date Sun, 17 Oct 2010 14:00:01 +0300
parents d10369fefd01
children 05bd2658bbb3
files hgext/patchbomb.py
diffstat 1 files changed, 29 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Sun Oct 17 13:24:37 2010 -0400
+++ b/hgext/patchbomb.py	Sun Oct 17 14:00:01 2010 +0300
@@ -22,10 +22,6 @@
 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 @@
 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 @@
     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 @@
     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 @@
       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.
     '''