Show More
@@ -1,89 +1,170 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ cat >> $HGRCPATH <<EOF | |
|
2 | > [alias] | |
|
3 | > myinit = init | |
|
4 | > cleanstatus = status -c | |
|
5 | > unknown = bargle | |
|
6 | > ambiguous = s | |
|
7 | > recursive = recursive | |
|
8 | > nodefinition = | |
|
9 | > no--cwd = status --cwd elsewhere | |
|
10 | > no-R = status -R elsewhere | |
|
11 | > no--repo = status --repo elsewhere | |
|
12 | > no--repository = status --repository elsewhere | |
|
13 | > mylog = log | |
|
14 | > lognull = log -r null | |
|
15 | > shortlog = log --template '{rev} {node|short} | {date|isodate}\n' | |
|
16 | > dln = lognull --debug | |
|
17 | > nousage = rollback | |
|
18 | > put = export -r 0 -o "\$FOO/%R.diff" | |
|
19 | > echo = !echo | |
|
20 | > rt = root | |
|
21 | > | |
|
22 | > [defaults] | |
|
23 | > mylog = -q | |
|
24 | > lognull = -q | |
|
25 | > log = -v | |
|
26 | > EOF | |
|
27 | ||
|
28 | ||
|
29 | basic | |
|
30 | ||
|
31 | $ hg myinit alias | |
|
32 | ||
|
33 | ||
|
34 | unknown | |
|
35 | ||
|
36 | $ hg unknown | |
|
37 | alias 'unknown' resolves to unknown command 'bargle' | |
|
38 | $ hg help unknown | |
|
39 | alias 'unknown' resolves to unknown command 'bargle' | |
|
40 | ||
|
2 | 41 | |
|
3 | cat >> $HGRCPATH <<EOF | |
|
4 | [alias] | |
|
5 | myinit = init | |
|
6 | cleanstatus = status -c | |
|
7 | unknown = bargle | |
|
8 | ambiguous = s | |
|
9 | recursive = recursive | |
|
10 | nodefinition = | |
|
11 | no--cwd = status --cwd elsewhere | |
|
12 | no-R = status -R elsewhere | |
|
13 | no--repo = status --repo elsewhere | |
|
14 | no--repository = status --repository elsewhere | |
|
15 | mylog = log | |
|
16 | lognull = log -r null | |
|
17 | shortlog = log --template '{rev} {node|short} | {date|isodate}\n' | |
|
18 | dln = lognull --debug | |
|
19 | nousage = rollback | |
|
20 | put = export -r 0 -o "\$FOO/%R.diff" | |
|
21 | echo = !echo | |
|
22 | rt = root | |
|
42 | ambiguous | |
|
43 | ||
|
44 | $ hg ambiguous | |
|
45 | alias 'ambiguous' resolves to ambiguous command 's' | |
|
46 | $ hg help ambiguous | |
|
47 | alias 'ambiguous' resolves to ambiguous command 's' | |
|
48 | ||
|
49 | ||
|
50 | recursive | |
|
51 | ||
|
52 | $ hg recursive | |
|
53 | alias 'recursive' resolves to unknown command 'recursive' | |
|
54 | $ hg help recursive | |
|
55 | alias 'recursive' resolves to unknown command 'recursive' | |
|
56 | ||
|
57 | ||
|
58 | no definition | |
|
23 | 59 | |
|
24 | [defaults] | |
|
25 | mylog = -q | |
|
26 | lognull = -q | |
|
27 | log = -v | |
|
28 | EOF | |
|
60 | $ hg nodef | |
|
61 | no definition for alias 'nodefinition' | |
|
62 | $ hg help nodef | |
|
63 | no definition for alias 'nodefinition' | |
|
29 | 64 | |
|
30 | echo '% basic' | |
|
31 | hg myinit alias | |
|
65 | ||
|
66 | invalid options | |
|
32 | 67 | |
|
33 | echo '% unknown' | |
|
34 | hg unknown | |
|
35 |
hg help |
|
|
36 | ||
|
37 | echo '% ambiguous' | |
|
38 | hg ambiguous | |
|
39 | hg help ambiguous | |
|
40 | ||
|
41 | echo '% recursive' | |
|
42 | hg recursive | |
|
43 | hg help recursive | |
|
68 | $ hg no--cwd | |
|
69 | error in definition for alias 'no--cwd': --cwd may only be given on the command line | |
|
70 | $ hg help no--cwd | |
|
71 | error in definition for alias 'no--cwd': --cwd may only be given on the command line | |
|
72 | $ hg no-R | |
|
73 | error in definition for alias 'no-R': -R may only be given on the command line | |
|
74 | $ hg help no-R | |
|
75 | error in definition for alias 'no-R': -R may only be given on the command line | |
|
76 | $ hg no--repo | |
|
77 | error in definition for alias 'no--repo': --repo may only be given on the command line | |
|
78 | $ hg help no--repo | |
|
79 | error in definition for alias 'no--repo': --repo may only be given on the command line | |
|
80 | $ hg no--repository | |
|
81 | error in definition for alias 'no--repository': --repository may only be given on the command line | |
|
82 | $ hg help no--repository | |
|
83 | error in definition for alias 'no--repository': --repository may only be given on the command line | |
|
44 | 84 | |
|
45 | echo '% no definition' | |
|
46 | hg nodef | |
|
47 | hg help nodef | |
|
85 | $ cd alias | |
|
86 | ||
|
87 | ||
|
88 | no usage | |
|
89 | ||
|
90 | $ hg nousage | |
|
91 | no rollback information available | |
|
92 | ||
|
93 | $ echo foo > foo | |
|
94 | $ hg ci -Amfoo | |
|
95 | adding foo | |
|
96 | ||
|
97 | ||
|
98 | with opts | |
|
48 | 99 | |
|
49 | echo '% invalid options' | |
|
50 | hg no--cwd | |
|
51 | hg help no--cwd | |
|
52 | hg no-R | |
|
53 | hg help no-R | |
|
54 | hg no--repo | |
|
55 | hg help no--repo | |
|
56 | hg no--repository | |
|
57 | hg help no--repository | |
|
100 | $ hg cleanst | |
|
101 | C foo | |
|
102 | ||
|
103 | ||
|
104 | with opts and whitespace | |
|
105 | ||
|
106 | $ hg shortlog | |
|
107 | 0 e63c23eaa88a | 1970-01-01 00:00 +0000 | |
|
108 | ||
|
58 | 109 | |
|
59 | cd alias | |
|
110 | interaction with defaults | |
|
60 | 111 | |
|
61 | echo '% no usage' | |
|
62 | hg nousage | |
|
112 | $ hg mylog | |
|
113 | 0:e63c23eaa88a | |
|
114 | $ hg lognull | |
|
115 | -1:000000000000 | |
|
63 | 116 | |
|
64 | echo foo > foo | |
|
65 | hg ci -Amfoo | |
|
117 | ||
|
118 | properly recursive | |
|
66 | 119 | |
|
67 | echo '% with opts' | |
|
68 | hg cleanst | |
|
120 | $ hg dln | |
|
121 | changeset: -1:0000000000000000000000000000000000000000 | |
|
122 | parent: -1:0000000000000000000000000000000000000000 | |
|
123 | parent: -1:0000000000000000000000000000000000000000 | |
|
124 | manifest: -1:0000000000000000000000000000000000000000 | |
|
125 | user: | |
|
126 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
127 | extra: branch=default | |
|
128 | ||
|
69 | 129 | |
|
70 | echo '% with opts and whitespace' | |
|
71 | hg shortlog | |
|
72 | 130 | |
|
73 | echo '% interaction with defaults' | |
|
74 | hg mylog | |
|
75 | hg lognull | |
|
131 | path expanding | |
|
76 | 132 | |
|
77 | echo '% properly recursive' | |
|
78 | hg dln | |
|
133 | $ FOO=`pwd` hg put | |
|
134 | $ cat 0.diff | |
|
135 | # HG changeset patch | |
|
136 | # User test | |
|
137 | # Date 0 0 | |
|
138 | # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0 | |
|
139 | # Parent 0000000000000000000000000000000000000000 | |
|
140 | foo | |
|
141 | ||
|
142 | diff -r 000000000000 -r e63c23eaa88a foo | |
|
143 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
144 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
|
145 | @@ -0,0 +1,1 @@ | |
|
146 | +foo | |
|
79 | 147 | |
|
80 | echo '% path expanding' | |
|
81 | FOO=`pwd` hg put | |
|
82 | cat 0.diff | |
|
148 | ||
|
149 | shell aliases | |
|
83 | 150 | |
|
84 | echo '% shell aliases' | |
|
85 |
|
|
|
86 | echo '% invalid arguments' | |
|
87 | hg rt foo | |
|
151 | $ hg echo foo | |
|
152 | foo | |
|
153 | ||
|
154 | invalid arguments | |
|
88 | 155 | |
|
89 | exit 0 | |
|
156 | $ hg rt foo | |
|
157 | hg rt: invalid arguments | |
|
158 | hg rt | |
|
159 | ||
|
160 | alias for: hg root | |
|
161 | ||
|
162 | print the root (top) of the current working directory | |
|
163 | ||
|
164 | Print the root directory of the current repository. | |
|
165 | ||
|
166 | Returns 0 on success. | |
|
167 | ||
|
168 | use "hg -v help rt" to show global options | |
|
169 | ||
|
170 | $ exit 0 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now