Show More
@@ -1,29 +1,65 b'' | |||
|
1 | #!/bin/sh | |
|
2 | # test command parsing and dispatch | |
|
1 | test command parsing and dispatch | |
|
3 | 2 | |
|
4 | "$TESTDIR/hghave" no-outer-repo || exit 80 | |
|
3 | $ "$TESTDIR/hghave" no-outer-repo || exit 80 | |
|
5 | 4 | |
|
6 | dir=`pwd` | |
|
5 | $ dir=`pwd` | |
|
7 | 6 | |
|
8 | hg init a | |
|
9 | cd a | |
|
10 | echo a > a | |
|
11 | hg ci -Ama | |
|
7 | $ hg init a | |
|
8 | $ cd a | |
|
9 | $ echo a > a | |
|
10 | $ hg ci -Ama | |
|
11 | adding a | |
|
12 | 12 | |
|
13 |
|
|
|
14 | hg cat | |
|
13 | Missing arg: | |
|
15 | 14 | |
|
16 | echo '% [defaults]' | |
|
17 | hg cat a | |
|
18 | cat >> $HGRCPATH <<EOF | |
|
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 | ||
|
19 | 47 | [defaults] |
|
20 | cat = -r null | |
|
21 | EOF | |
|
22 | hg cat a | |
|
23 | 48 | |
|
24 | echo '% no repo' | |
|
25 | cd $dir | |
|
26 | hg cat | |
|
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 | |
|
27 | 57 | |
|
28 | exit 0 | |
|
58 | No repo: | |
|
29 | 59 | |
|
60 | $ cd $dir | |
|
61 | $ hg cat | |
|
62 | abort: There is no Mercurial repository here (.hg not found)! | |
|
63 | ||
|
64 | $ exit 0 | |
|
65 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now