changeset 22585:15282c6612fb

help: support OS-specific help sections Containers of the form: .. container:: verbose.<os> are shown by default on the given OS (or with -v).
author Matt Mackall <mpm@selenic.com>
date Tue, 30 Sep 2014 15:51:22 -0500
parents 19bd8bda6bb2
children 6e5657ce9e8c
files mercurial/commands.py
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Sep 30 15:48:43 2014 -0500
+++ b/mercurial/commands.py	Tue Sep 30 15:51:22 2014 -0500
@@ -3821,7 +3821,19 @@
 
     textwidth = min(ui.termwidth(), 80) - 2
 
-    keep = ui.verbose and ['verbose'] or []
+    keep = []
+    if ui.verbose:
+        keep.append('verbose')
+    if sys.platform.startswith('win'):
+        keep.append('windows')
+    elif sys.platform == 'OpenVMS':
+        keep.append('vms')
+    elif sys.platform == 'plan9':
+        keep.append('plan9')
+    else:
+        keep.append('unix')
+        keep.append(sys.platform.lower())
+
     text = help.help_(ui, name, **opts)
 
     formatted, pruned = minirst.format(text, textwidth, keep=keep)