annotate tests/test-manifest.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 e0348815e806
children 91dc9587862e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15441
e0348815e806 tests: use 'hghave symlink' for tests using symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 14399
diff changeset
1 $ "$TESTDIR/hghave" symlink || exit 80
e0348815e806 tests: use 'hghave symlink' for tests using symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 14399
diff changeset
2
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
3 Source bundle was generated with the following script:
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
4
5406
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
5 # hg init
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
6 # echo a > a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
7 # ln -s a l
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
8 # hg ci -Ama -d'0 0'
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
9 # mkdir b
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
10 # echo a > b/a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
11 # chmod +x b/a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
12 # hg ci -Amb -d'1 0'
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
13
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
14 $ hg init
14116
cd3032437064 tests: move test bundles in a bundles/ subdirectory
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12346
diff changeset
15 $ hg -q pull "$TESTDIR/bundles/test-manifest.hg"
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
16
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
17 The next call is expected to return nothing:
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
18
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
19 $ hg manifest
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
20
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
21 $ hg co
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
5406
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
23
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
24 $ hg manifest
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
25 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
26 b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
27 l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
28
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
29 $ hg manifest -v
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
30 644 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
31 755 * b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
32 644 @ l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
33
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
34 $ hg manifest --debug
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
35 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
36 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
37 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
6737
7239e06e58e9 context: consistently return p1 context for None
Matt Mackall <mpm@selenic.com>
parents: 5406
diff changeset
38
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
39 $ hg manifest -r 0
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
40 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
41 l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
42
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
43 $ hg manifest -r 1
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
44 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
45 b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
46 l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
47
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
48 $ hg manifest -r tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
49 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
50 b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
51 l
5155
13d23d66a6cd manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
52
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
53 $ hg manifest tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
54 a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
55 b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
56 l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
57
14399
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
58 $ hg manifest --all
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
59 a
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
60 b/a
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
61 l
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
62
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
63 The next two calls are expected to abort:
5155
13d23d66a6cd manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
64
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
65 $ hg manifest -r 2
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
66 abort: unknown revision '2'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12253
diff changeset
67 [255]
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
68
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
69 $ hg manifest -r tip tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
70 abort: please specify just one revision
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12253
diff changeset
71 [255]