comparison tests/test-extension.t @ 16853:7863ff383894

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.
author Olav Reinert <seroton10@gmail.com>
date Sat, 02 Jun 2012 11:25:40 +0200
parents 1c9f58a6c8f1
children 50fbe9063ff2
comparison
equal deleted inserted replaced
16852:af69b2b64d6e 16853:7863ff383894
176 $ hg --verbose help debugextension 176 $ hg --verbose help debugextension
177 debugextension extension - only debugcommands 177 debugextension extension - only debugcommands
178 178
179 list of commands: 179 list of commands:
180 180
181 foo: 181 foo yet another foo command
182 yet another foo command
183 182
184 global options: 183 global options:
185 184
186 -R --repository REPO repository root directory or name of overlay bundle 185 -R --repository REPO repository root directory or name of overlay bundle
187 file 186 file
206 $ hg --debug help debugextension 205 $ hg --debug help debugextension
207 debugextension extension - only debugcommands 206 debugextension extension - only debugcommands
208 207
209 list of commands: 208 list of commands:
210 209
211 debugfoobar: 210 debugfoobar yet another debug command
212 yet another debug command 211 foo yet another foo command
213 foo:
214 yet another foo command
215 212
216 global options: 213 global options:
217 214
218 -R --repository REPO repository root directory or name of overlay bundle 215 -R --repository REPO repository root directory or name of overlay bundle
219 file 216 file
326 running the external diff program will actually be pretty fast (at least 323 running the external diff program will actually be pretty fast (at least
327 faster than having to compare the entire tree). 324 faster than having to compare the entire tree).
328 325
329 list of commands: 326 list of commands:
330 327
331 extdiff use external program to diff repository (or selected files) 328 extdiff use external program to diff repository (or selected files)
332 329
333 use "hg -v help extdiff" to show builtin aliases and global options 330 use "hg -v help extdiff" to show builtin aliases and global options
334 331
335 $ echo 'extdiff = !' >> $HGRCPATH 332 $ echo 'extdiff = !' >> $HGRCPATH
336 333