##// END OF EJS Templates
tests: unify test-globalopts
Adrian Buehlmann -
r12194:9e40ea08 default
parent child Browse files
Show More
@@ -1,96 +1,387 b''
1 #!/bin/sh
1 $ "$TESTDIR/hghave" no-outer-repo || exit 80
2
3 $ hg init a
4 $ cd a
5 $ echo a > a
6 $ hg ci -A -d'1 0' -m a
7 adding a
2
8
3 "$TESTDIR/hghave" no-outer-repo || exit 80
9 $ cd ..
10
11 $ hg init b
12 $ cd b
13 $ echo b > b
14 $ hg ci -A -d'1 0' -m b
15 adding b
16
17 $ cd ..
4
18
5 hg init a
19 $ hg clone a c
6 cd a
20 updating to branch default
7 echo a > a
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8 hg ci -A -d'1 0' -m a
22 $ cd c
23 $ hg pull -f ../b
24 pulling from ../b
25 searching for changes
26 warning: repository is unrelated
27 adding changesets
28 adding manifests
29 adding file changes
30 added 1 changesets with 1 changes to 1 files (+1 heads)
31 (run 'hg heads' to see heads, 'hg merge' to merge)
32 $ hg merge
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 (branch merge, don't forget to commit)
9
35
10 cd ..
36 $ cd ..
37
38 Testing -R/--repository:
11
39
12 hg init b
40 $ hg -R a tip
13 cd b
41 changeset: 0:8580ff50825a
14 echo b > b
42 tag: tip
15 hg ci -A -d'1 0' -m b
43 user: test
44 date: Thu Jan 01 00:00:01 1970 +0000
45 summary: a
46
47 $ hg --repository b tip
48 changeset: 0:b6c483daf290
49 tag: tip
50 user: test
51 date: Thu Jan 01 00:00:01 1970 +0000
52 summary: b
53
54
55 Implicit -R:
56
57 $ hg ann a/a
58 0: a
59 $ hg ann a/a a/a
60 0: a
61 $ hg ann a/a b/b
62 abort: There is no Mercurial repository here (.hg not found)!
63 $ hg -R b ann a/a
64 abort: a/a not under root
65 $ hg log
66 abort: There is no Mercurial repository here (.hg not found)!
16
67
17 cd ..
68 Abbreviation of long option:
69
70 $ hg --repo c tip
71 changeset: 1:b6c483daf290
72 tag: tip
73 parent: -1:000000000000
74 user: test
75 date: Thu Jan 01 00:00:01 1970 +0000
76 summary: b
77
78
79 earlygetopt with duplicate options (36d23de02da1):
18
80
19 hg clone a c
81 $ hg --cwd a --cwd b --cwd c tip
20 cd c
82 changeset: 1:b6c483daf290
21 hg pull -f ../b
83 tag: tip
22 hg merge
84 parent: -1:000000000000
85 user: test
86 date: Thu Jan 01 00:00:01 1970 +0000
87 summary: b
88
89 $ hg --repo c --repository b -R a tip
90 changeset: 0:8580ff50825a
91 tag: tip
92 user: test
93 date: Thu Jan 01 00:00:01 1970 +0000
94 summary: a
95
23
96
24 cd ..
97 earlygetopt short option without following space:
98
99 $ hg -q -Rb tip
100 0:b6c483daf290
101
102 earlygetopt with illegal abbreviations:
103
104 $ hg --confi "foo.bar=baz"
105 abort: option --config may not be abbreviated!
106 $ hg --cw a tip
107 abort: option --cwd may not be abbreviated!
108 $ hg --rep a tip
109 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
110 $ hg --repositor a tip
111 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
112 $ hg -qR a tip
113 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
114 $ hg -qRa tip
115 abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
116
117 Testing --cwd:
25
118
26 echo %% -R/--repository
119 $ hg --cwd a parents
27 hg -R a tip
120 changeset: 0:8580ff50825a
28 hg --repository b tip
121 tag: tip
122 user: test
123 date: Thu Jan 01 00:00:01 1970 +0000
124 summary: a
125
126
127 Testing -y/--noninteractive - just be sure it is parsed:
128
129 $ hg --cwd a tip -q --noninteractive
130 0:8580ff50825a
131 $ hg --cwd a tip -q -y
132 0:8580ff50825a
133
134 Testing -q/--quiet:
135
136 $ hg -R a -q tip
137 0:8580ff50825a
138 $ hg -R b -q tip
139 0:b6c483daf290
140 $ hg -R c --quiet parents
141 0:8580ff50825a
142 1:b6c483daf290
29
143
30 echo %% implicit -R
144 Testing -v/--verbose:
31 hg ann a/a
32 hg ann a/a a/a
33 hg ann a/a b/b
34 hg -R b ann a/a
35 hg log
36
145
37 echo %% abbrev of long option
146 $ hg --cwd c head -v
38 hg --repo c tip
147 changeset: 1:b6c483daf290
148 tag: tip
149 parent: -1:000000000000
150 user: test
151 date: Thu Jan 01 00:00:01 1970 +0000
152 files: b
153 description:
154 b
155
156
157 changeset: 0:8580ff50825a
158 user: test
159 date: Thu Jan 01 00:00:01 1970 +0000
160 files: a
161 description:
162 a
163
164
165 $ hg --cwd b tip --verbose
166 changeset: 0:b6c483daf290
167 tag: tip
168 user: test
169 date: Thu Jan 01 00:00:01 1970 +0000
170 files: b
171 description:
172 b
173
174
39
175
40 echo "%% earlygetopt with duplicate options (36d23de02da1)"
176 Testing --config:
41 hg --cwd a --cwd b --cwd c tip
42 hg --repo c --repository b -R a tip
43
177
44 echo "%% earlygetopt short option without following space"
178 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
45 hg -q -Rb tip
179 quuxfoo
180 $ hg --cwd c --config '' tip -q
181 abort: malformed --config option: '' (use --config section.name=value)
182 $ hg --cwd c --config a.b tip -q
183 abort: malformed --config option: 'a.b' (use --config section.name=value)
184 $ hg --cwd c --config a tip -q
185 abort: malformed --config option: 'a' (use --config section.name=value)
186 $ hg --cwd c --config a.= tip -q
187 abort: malformed --config option: 'a.=' (use --config section.name=value)
188 $ hg --cwd c --config .b= tip -q
189 abort: malformed --config option: '.b=' (use --config section.name=value)
190
191 Testing --debug:
46
192
47 echo "%% earlygetopt with illegal abbreviations"
193 $ hg --cwd c log --debug
48 hg --confi "foo.bar=baz"
194 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
49 hg --cw a tip
195 tag: tip
50 hg --rep a tip
196 parent: -1:0000000000000000000000000000000000000000
51 hg --repositor a tip
197 parent: -1:0000000000000000000000000000000000000000
52 hg -qR a tip
198 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
53 hg -qRa tip
199 user: test
54
200 date: Thu Jan 01 00:00:01 1970 +0000
55 echo %% --cwd
201 files+: b
56 hg --cwd a parents
202 extra: branch=default
203 description:
204 b
205
206
207 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
208 parent: -1:0000000000000000000000000000000000000000
209 parent: -1:0000000000000000000000000000000000000000
210 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
211 user: test
212 date: Thu Jan 01 00:00:01 1970 +0000
213 files+: a
214 extra: branch=default
215 description:
216 a
217
218
57
219
58 echo %% -y/--noninteractive - just be sure it is parsed
220 Testing --traceback:
59 hg --cwd a tip -q --noninteractive
221
60 hg --cwd a tip -q -y
222 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
223 Traceback (most recent call last):
224
225 Testing --time:
61
226
62 echo %% -q/--quiet
227 $ hg --cwd a --time id
63 hg -R a -q tip
228 8580ff50825a tip
64 hg -R b -q tip
229 Time: real .*
65 hg -R c --quiet parents
66
230
67 echo %% -v/--verbose
231 Testing --version:
68 hg --cwd c head -v
232
69 hg --cwd b tip --verbose
233 $ hg --version -q
234 Mercurial Distributed SCM .*
235
236 Testing -h/--help:
70
237
71 echo %% --config
238 $ hg -h
72 hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
239 Mercurial Distributed SCM
73 hg --cwd c --config '' tip -q
240
74 hg --cwd c --config a.b tip -q
241 list of commands:
75 hg --cwd c --config a tip -q
242
76 hg --cwd c --config a.= tip -q
243 add add the specified files on the next commit
77 hg --cwd c --config .b= tip -q
244 addremove add all new files, delete all missing files
78
245 annotate show changeset information by line for each file
79 echo %% --debug
246 archive create an unversioned archive of a repository revision
80 hg --cwd c log --debug
247 backout reverse effect of earlier changeset
248 bisect subdivision search of changesets
249 branch set or show the current branch name
250 branches list repository named branches
251 bundle create a changegroup file
252 cat output the current or given revision of files
253 clone make a copy of an existing repository
254 commit commit the specified files or all outstanding changes
255 copy mark files as copied for the next commit
256 diff diff repository (or selected files)
257 export dump the header and diffs for one or more changesets
258 forget forget the specified files on the next commit
259 grep search for a pattern in specified files and revisions
260 heads show current repository heads or show branch heads
261 help show help for a given topic or a help overview
262 identify identify the working copy or specified revision
263 import import an ordered set of patches
264 incoming show new changesets found in source
265 init create a new repository in the given directory
266 locate locate files matching specific patterns
267 log show revision history of entire repository or files
268 manifest output the current or given revision of the project manifest
269 merge merge working directory with another revision
270 outgoing show changesets not found in the destination
271 parents show the parents of the working directory or revision
272 paths show aliases for remote repositories
273 pull pull changes from the specified source
274 push push changes to the specified destination
275 recover roll back an interrupted transaction
276 remove remove the specified files on the next commit
277 rename rename files; equivalent of copy + remove
278 resolve redo merges or set/view the merge status of files
279 revert restore individual files or directories to an earlier state
280 rollback roll back the last transaction (dangerous)
281 root print the root (top) of the current working directory
282 serve start stand-alone webserver
283 showconfig show combined config settings from all hgrc files
284 status show changed files in the working directory
285 summary summarize working directory state
286 tag add one or more tags for the current or given revision
287 tags list repository tags
288 tip show the tip revision
289 unbundle apply one or more changegroup files
290 update update working directory (or switch revisions)
291 verify verify the integrity of the repository
292 version output version and copyright information
293
294 additional help topics:
295
296 config Configuration Files
297 dates Date Formats
298 patterns File Name Patterns
299 environment Environment Variables
300 revisions Specifying Single Revisions
301 multirevs Specifying Multiple Revisions
302 revsets Specifying Revision Sets
303 diffs Diff Formats
304 templating Template Usage
305 urls URL Paths
306 extensions Using additional features
307 hgweb Configuring hgweb
308 glossary Glossary
309
310 use "hg -v help" to show aliases and global options
81
311
82 echo %% --traceback
312 $ hg --help
83 hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
313 Mercurial Distributed SCM
84
314
85 echo %% --time
315 list of commands:
86 hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
316
317 add add the specified files on the next commit
318 addremove add all new files, delete all missing files
319 annotate show changeset information by line for each file
320 archive create an unversioned archive of a repository revision
321 backout reverse effect of earlier changeset
322 bisect subdivision search of changesets
323 branch set or show the current branch name
324 branches list repository named branches
325 bundle create a changegroup file
326 cat output the current or given revision of files
327 clone make a copy of an existing repository
328 commit commit the specified files or all outstanding changes
329 copy mark files as copied for the next commit
330 diff diff repository (or selected files)
331 export dump the header and diffs for one or more changesets
332 forget forget the specified files on the next commit
333 grep search for a pattern in specified files and revisions
334 heads show current repository heads or show branch heads
335 help show help for a given topic or a help overview
336 identify identify the working copy or specified revision
337 import import an ordered set of patches
338 incoming show new changesets found in source
339 init create a new repository in the given directory
340 locate locate files matching specific patterns
341 log show revision history of entire repository or files
342 manifest output the current or given revision of the project manifest
343 merge merge working directory with another revision
344 outgoing show changesets not found in the destination
345 parents show the parents of the working directory or revision
346 paths show aliases for remote repositories
347 pull pull changes from the specified source
348 push push changes to the specified destination
349 recover roll back an interrupted transaction
350 remove remove the specified files on the next commit
351 rename rename files; equivalent of copy + remove
352 resolve redo merges or set/view the merge status of files
353 revert restore individual files or directories to an earlier state
354 rollback roll back the last transaction (dangerous)
355 root print the root (top) of the current working directory
356 serve start stand-alone webserver
357 showconfig show combined config settings from all hgrc files
358 status show changed files in the working directory
359 summary summarize working directory state
360 tag add one or more tags for the current or given revision
361 tags list repository tags
362 tip show the tip revision
363 unbundle apply one or more changegroup files
364 update update working directory (or switch revisions)
365 verify verify the integrity of the repository
366 version output version and copyright information
367
368 additional help topics:
369
370 config Configuration Files
371 dates Date Formats
372 patterns File Name Patterns
373 environment Environment Variables
374 revisions Specifying Single Revisions
375 multirevs Specifying Multiple Revisions
376 revsets Specifying Revision Sets
377 diffs Diff Formats
378 templating Template Usage
379 urls URL Paths
380 extensions Using additional features
381 hgweb Configuring hgweb
382 glossary Glossary
383
384 use "hg -v help" to show aliases and global options
87
385
88 echo %% --version
386 Not tested: --debugger
89 hg --version -q | sed 's/version [^)]*/version xxx/'
90
387
91 echo %% -h/--help
92 hg -h
93 hg --help
94
95 echo %% not tested: --debugger
96
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now