diff mercurial/commands.py @ 15125:bdc595059108

minirst: end all blocks with newlines Formerly RST blocks were formatted without a trailing newline, which wasn't particularly helpful. Now everything that comes back from the formatter has a trailing newline so remove all the extra ones added by users.
author Matt Mackall <mpm@selenic.com>
date Sat, 17 Sep 2011 14:17:09 -0500
parents ac46a9cdf6e6
children d3ad0e9d4be2
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 19 14:19:26 2011 +0200
+++ b/mercurial/commands.py	Sat Sep 17 14:17:09 2011 -0500
@@ -2782,7 +2782,7 @@
             doc = doc.splitlines()[0]
         keep = ui.verbose and ['verbose'] or []
         formatted, pruned = minirst.format(doc, textwidth, keep=keep)
-        ui.write("\n%s\n" % formatted)
+        ui.write("\n%s" % formatted)
         if pruned:
             ui.write(_('\nuse "hg -v help %s" to show verbose help\n') % name)
 
@@ -2862,7 +2862,7 @@
             doc = doc()
 
         ui.write("%s\n\n" % header)
-        ui.write("%s\n" % minirst.format(doc, textwidth, indent=4))
+        ui.write("%s" % minirst.format(doc, textwidth, indent=4))
         try:
             cmdutil.findcmd(name, table)
             ui.write(_('\nuse "hg help -c %s" to see help for '
@@ -2887,7 +2887,7 @@
         ui.write(_('%s extension - %s\n\n') % (name.split('.')[-1], head))
         if tail:
             ui.write(minirst.format(tail, textwidth))
-            ui.status('\n\n')
+            ui.status('\n')
 
         if mod:
             try:
@@ -2907,7 +2907,7 @@
         msg = help.listexts(_("'%s' is provided by the following "
                               "extension:") % cmd, {ext: doc}, indent=4)
         ui.write(minirst.format(msg, textwidth))
-        ui.write('\n\n')
+        ui.write('\n')
         ui.write(_('use "hg help extensions" for information on enabling '
                    'extensions\n'))
 
@@ -2946,7 +2946,7 @@
         if name != 'shortlist':
             text = help.listexts(_('enabled extensions:'), extensions.enabled())
             if text:
-                ui.write("\n%s\n" % minirst.format(text, textwidth))
+                ui.write("\n%s" % minirst.format(text, textwidth))
 
     if not name:
         ui.write(_("\nadditional help topics:\n\n"))