Mercurial > hg
comparison tests/test-dispatch.t @ 12157:88250a460bf8
tests: unify test-dispatch
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 02 Sep 2010 17:13:23 +0200 |
parents | tests/test-dispatch@21984c1c83d4 |
children | 4134686b83e1 |
comparison
equal
deleted
inserted
replaced
12156:4c94b6d0fb1c | 12157:88250a460bf8 |
---|---|
1 test command parsing and dispatch | |
2 | |
3 $ "$TESTDIR/hghave" no-outer-repo || exit 80 | |
4 | |
5 $ dir=`pwd` | |
6 | |
7 $ hg init a | |
8 $ cd a | |
9 $ echo a > a | |
10 $ hg ci -Ama | |
11 adding a | |
12 | |
13 Missing arg: | |
14 | |
15 $ hg cat | |
16 hg cat: invalid arguments | |
17 hg cat [OPTION]... FILE... | |
18 | |
19 output the current or given revision of files | |
20 | |
21 Print the specified files as they were at the given revision. If no | |
22 revision is given, the parent of the working directory is used, or tip if | |
23 no revision is checked out. | |
24 | |
25 Output may be to a file, in which case the name of the file is given using | |
26 a format string. The formatting rules are the same as for the export | |
27 command, with the following additions: | |
28 | |
29 "%s" basename of file being printed | |
30 "%d" dirname of file being printed, or '.' if in repository root | |
31 "%p" root-relative path name of file being printed | |
32 | |
33 Returns 0 on success. | |
34 | |
35 options: | |
36 | |
37 -o --output FORMAT print output to file with formatted name | |
38 -r --rev REV print the given revision | |
39 --decode apply any matching decode filter | |
40 -I --include PATTERN [+] include names matching the given patterns | |
41 -X --exclude PATTERN [+] exclude names matching the given patterns | |
42 | |
43 [+] marked option can be specified multiple times | |
44 | |
45 use "hg -v help cat" to show global options | |
46 | |
47 [defaults] | |
48 | |
49 $ hg cat a | |
50 a | |
51 $ cat >> $HGRCPATH <<EOF | |
52 > [defaults] | |
53 > cat = -r null | |
54 > EOF | |
55 $ hg cat a | |
56 a: no such file in rev 000000000000 | |
57 | |
58 No repo: | |
59 | |
60 $ cd $dir | |
61 $ hg cat | |
62 abort: There is no Mercurial repository here (.hg not found)! | |
63 | |
64 $ exit 0 | |
65 |