sapling/mercurial
Olav Reinert 54cafa029d help: format command and option list help using RST
This patch changes the function which generates help text about commands and
options to use RST formatting. Tables describing options have been formatted
using RST table markup for some time already, so their appearance does not
change. Command lists, however, change appearance.

To format non-verbose command lists, RST field list markup was chosen, because
it resembles the old format:

<http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists>

In the old (hand-coded) format of non-verbose command lists, the left column is
12 characters wide. Our minirst implementation formats field lists with a left
column 14 characters wide, so this patch changes the appearance of help output
correspondingly:

<http://markmail.org/message/krl4cxopsnii7s6z?q=mercurial+reinert+from:%22Olav+Reinert%22&page=2>

The minirst markup most closely resembling the old verbose command lists is
definition lists. But using it would cause a blank line to be inserted between
each command definition, making the output excessively long, and no more
useful than before. To avoid this, I chose to use field lists also for verbose
command help, resulting in output like this example:

 add           add the specified files on the next commit
 annotate, blame
               show changeset information by line for each file
 clone         make a copy of an existing repository
 commit, ci    commit the specified files or all outstanding changes
 diff          diff repository (or selected files)
 export        dump the header and diffs for one or more changesets
 forget        forget the specified files on the next commit
 init          create a new repository in the given directory
 log, history  show revision history of entire repository or files
 merge         merge working directory with another revision
 phase         set or show the current phase name
 pull          pull changes from the specified source
 push          push changes to the specified destination
 qdiff         diff of the current patch and subsequent modifications
 qinit         init a new queue repository (DEPRECATED)
 qnew          create a new patch
 qpop          pop the current patch off the stack
 qpush         push the next patch onto the stack
 qrefresh      update the current patch
 remove, rm    remove the specified files on the next commit
 serve         start stand-alone webserver
 status, st    show changed files in the working directory
 summary, sum  summarize working directory state
 update, up, checkout, co
               update working directory (or switch revisions)

This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:25:40 +02:00
..
help help: include bookmarks in 'help revisions' and simplify wording 2012-05-16 10:29:11 -05:00
hgweb hgweb: make graph data suitable for template usage 2012-05-21 00:20:05 +02:00
httpclient httpclient: omit tests for the client since we don't run them anyway 2012-05-19 09:34:25 -05:00
pure cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
templates hgweb: make graph data suitable for template usage 2012-05-21 00:20:05 +02:00
__init__.py Add back links from file revisions to changeset revisions 2005-05-03 13:16:10 -08:00
ancestor.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
archival.py atomictempfile: make close() consistent with other file-like objects. 2011-08-25 20:21:04 -04:00
base85.c base85: cast Py_ssize_t values to int (issue3481) 2012-06-04 16:59:34 +02:00
bdiff.c bdiff: check and cast first parameter value on putbe32() calls 2012-05-15 22:36:47 +02:00
bookmarks.py localrepo: add branchtip() method for faster single-branch lookups 2012-05-13 14:04:04 +02:00
bundlerepo.py cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
byterange.py Remove FSF mailing address from GPL headers 2012-01-06 16:27:13 +01:00
changegroup.py changegroup: decompress GZ algorithm in larger chunks for better performance 2012-04-29 20:58:50 +02:00
changelog.py changelog: ensure that nodecache is valid (issue3428) 2012-05-11 01:55:33 -07:00
cmdutil.py cmdutil: use filectx.cmp() in amend() 2012-05-13 13:19:46 +02:00
commands.py help: format command and option list help using RST 2012-06-02 11:25:40 +02:00
commandserver.py cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
config.py config: discard UTF-8 BOM if found 2012-04-03 11:35:04 -05:00
context.py context: grudging accept longs in constructor 2012-05-21 16:32:50 -05:00
copies.py merge: show renamed on one and deleted on the other side in debug output 2012-05-23 21:34:29 +02:00
dagparser.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
dagutil.py cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
demandimport.py demandimport: determine at load time if __import__ has level argument 2011-08-22 22:50:52 +02:00
diffhelpers.c diffhelpers: use Py_ssize_t in testhunk() 2012-05-12 14:00:51 +02:00
dirstate.py cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
discovery.py merge with stable 2012-05-17 15:52:14 -05:00
dispatch.py dispatch: tolerate non-standard version strings in tuplever() (issue3470) 2012-05-25 14:24:07 +02:00
encoding.py encoding: protect against non-ascii default encoding 2012-04-22 21:27:52 -04:00
error.py wireproto: add out-of-band error class to allow remote repo to report errors 2011-08-02 15:21:10 -04:00
extensions.py extensions.disabled: return {} instead of None no extensions are disabled 2012-05-13 04:06:07 -05:00
fancyopts.py globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__') 2011-07-25 16:24:37 -05:00
filelog.py filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
filemerge.py merge with stable 2012-03-13 16:29:13 -05:00
fileset.py fileset: add "subrepo" fileset symbol 2012-03-22 21:12:15 +01:00
formatter.py formatter: add basic formatters 2012-02-20 16:42:47 -06:00
graphmod.py graphmod: add config cache 2012-02-17 13:53:41 -06:00
hbisect.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
help.py help: fix search with -k option in non-ASCII locales 2012-06-04 10:45:56 +04:00
hg.py check-code: ignore naked excepts with a "re-raise" comment 2012-05-13 13:18:06 +02:00
hook.py hooks: prioritize run order of hooks 2012-01-15 13:50:12 -07:00
httpconnection.py Use explicit integer division 2012-01-08 18:15:54 +01:00
httprepo.py httprepo: make __del__ more stable in error situations 2011-10-13 04:27:49 +02:00
i18n.py i18n: use getattr instead of hasattr 2011-07-25 20:46:30 -05:00
ignore.py misc: adding missing file close() calls 2011-11-03 11:24:55 -05:00
keepalive.py check-code: ignore naked excepts with a "re-raise" comment 2012-05-13 13:18:06 +02:00
localrepo.py localrepo: move filecache clearing into invalidate 2012-06-01 23:44:10 -05:00
lock.py lock: change name of release chain 2011-11-30 16:53:44 -06:00
lsprof.py lsprof: report units correctly 2012-05-30 13:57:41 -07:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py mail: use quoted-printable for mime encoding to avoid too long lines (issue3075) 2011-11-23 02:44:11 +01:00
manifest.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
match.py match: make 'match.files()' return list object always 2012-05-23 00:25:29 +09:00
mdiff.py mdiff: fix diff header generation for files with spaces (issue3357) 2012-04-05 15:39:07 +02:00
merge.py merge: warn about file deleted in one branch and renamed in other (issue3074) 2012-05-23 20:50:16 +02:00
minirst.py minirst: generate tables as a list of joined lines 2012-06-01 11:58:23 +02:00
mpatch.c mpatch: use Py_ssize_t for string length 2012-05-20 01:28:31 +02:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
osutil.c osutil: handle deletion race with readdir/stat (issue3463) 2012-05-18 14:34:33 -05:00
parser.py parsers: fix localization markup of parser errors 2011-06-21 00:17:52 +02:00
parsers.c parsers: cache the result of index_headrevs 2012-05-19 20:21:48 -07:00
patch.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
phases.py phases: wrap docstrings at 70 characters 2012-05-13 12:07:49 +02:00
posix.py posix: workaround lack of TIOCGWINSZ on Irix (issue3449) 2012-05-14 13:25:42 +01:00
pushkey.py phases: add basic pushkey support 2011-12-15 11:24:26 +01:00
pvec.py pvec: introduce pvecs 2012-03-12 13:37:39 -05:00
py3kcompat.py py3kcompat: added fake ord implementation for py3k 2010-08-07 16:38:38 -03:00
repair.py branchcache: backout 29529231e17d 2012-05-17 15:34:59 -05:00
repo.py Make sure bundlerepo doesn't leak temp files (issue2491) 2011-02-12 10:58:11 +01:00
revlog.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
revset.py revset: cache alias expansions 2012-05-24 13:05:06 +02:00
scmutil.py merge with stable 2012-06-01 15:14:29 -05:00
setdiscovery.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
similar.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
simplemerge.py cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
sshrepo.py cleanup: replace naked excepts with more specific ones 2012-05-12 16:02:45 +02:00
sshserver.py addchangegroup: remove the lock argument on the addchangegroup methods 2011-11-28 01:32:13 +01:00
sslutil.py ui: optionally quiesce ssl verification warnings on python 2.5 2012-04-09 14:36:16 -07:00
statichttprepo.py scmutil: update cached copy when filecached attribute is assigned (issue3263) 2012-02-15 20:02:35 +02:00
store.py store: speed up read and write of large fncache files 2012-04-12 15:21:54 -07:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: make subrepo.subrepo(<not a subrepo path>) fail 2012-05-20 21:11:34 +03:00
tags.py tags: short-circuit if no tags have ever been committed 2012-05-13 12:01:52 +02:00
templatefilters.py cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
templatekw.py templatekw: fix phase keywords 2012-01-20 13:10:01 -02:00
templater.py cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
transaction.py cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
treediscovery.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
ui.py ui: add _isatty method to easily disable cooked I/O 2012-05-20 14:31:56 -05:00
url.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
util.h parser: use PyInt_FromSsize_t in index_stats 2012-05-09 09:58:50 +02:00
util.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
verify.py cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
win32.py win32: move lookupreg() to windows.py 2012-05-27 11:29:52 +02:00
windows.py win32: move lookupreg() to windows.py 2012-05-27 11:29:52 +02:00
wireproto.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00