Debian Codegraph @

tests/test-globalopts.t

raw
1 $ hg init a
2 $ cd a
3 $ echo a > a
4 $ hg ci -A -d'1 0' -m a
5 adding a
6
7 $ cd ..
8
9 $ hg init b
10 $ cd b
11 $ echo b > b
12 $ hg ci -A -d'1 0' -m b
13 adding b
14
15 $ cd ..
16
17 $ hg clone a c
18 updating to branch default
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ cd c
21 $ cat >> .hg/hgrc <<EOF
22 > [paths]
23 > relative = ../a
24 > EOF
25 $ hg pull -f ../b
26 pulling from ../b
27 searching for changes
28 warning: repository is unrelated
29 requesting all changes
30 adding changesets
31 adding manifests
32 adding file changes
33 added 1 changesets with 1 changes to 1 files (+1 heads)
34 new changesets b6c483daf290
35 (run 'hg heads' to see heads, 'hg merge' to merge)
36 $ hg merge
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
39
40 $ cd ..
41
42 Testing -R/--repository:
43
44 $ hg -R a tip
45 changeset: 0:8580ff50825a
46 tag: tip
47 user: test
48 date: Thu Jan 01 00:00:01 1970 +0000
49 summary: a
50
51 $ hg --repository b tip
52 changeset: 0:b6c483daf290
53 tag: tip
54 user: test
55 date: Thu Jan 01 00:00:01 1970 +0000
56 summary: b
57
58
59 -R with a URL:
60
61 $ hg -R file:a identify
62 8580ff50825a tip
63 $ hg -R file://localhost/`pwd`/a/ identify
64 8580ff50825a tip
65
66 -R with path aliases:
67
68 $ cd c
69 $ hg -R default identify
70 8580ff50825a tip
71 $ hg -R relative identify
72 8580ff50825a tip
73 $ echo '[paths]' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
75 $ hg path | grep relativetohome
76 relativetohome = $TESTTMP/a
77 $ HOME=`pwd`/../ hg path | grep relativetohome
78 relativetohome = $TESTTMP/a
79 $ HOME=`pwd`/../ hg -R relativetohome identify
80 8580ff50825a tip
81 $ cd ..
82
83 #if no-outer-repo
84
85 Implicit -R:
86
87 $ hg ann a/a
88 0: a
89 $ hg ann a/a a/a
90 0: a
91 $ hg ann a/a b/b
92 abort: no repository found in '$TESTTMP' (.hg not found)
93 [10]
94 $ hg -R b ann a/a
95 abort: a/a not under root '$TESTTMP/b'
96 (consider using '--cwd b')
97 [255]
98 $ hg log
99 abort: no repository found in '$TESTTMP' (.hg not found)
100 [10]
101
102 #endif
103
104 Abbreviation of long option:
105
106 $ hg --repo c tip
107 changeset: 1:b6c483daf290
108 tag: tip
109 parent: -1:000000000000
110 user: test
111 date: Thu Jan 01 00:00:01 1970 +0000
112 summary: b
113
114
115 earlygetopt with duplicate options (36d23de02da1):
116
117 $ hg --cwd a --cwd b --cwd c tip
118 changeset: 1:b6c483daf290
119 tag: tip
120 parent: -1:000000000000
121 user: test
122 date: Thu Jan 01 00:00:01 1970 +0000
123 summary: b
124
125 $ hg --repo c --repository b -R a tip
126 changeset: 0:8580ff50825a
127 tag: tip
128 user: test
129 date: Thu Jan 01 00:00:01 1970 +0000
130 summary: a
131
132
133 earlygetopt short option without following space:
134
135 $ hg -q -Rb tip
136 0:b6c483daf290
137
138 earlygetopt with illegal abbreviations:
139
140 $ hg --confi "foo.bar=baz"
141 abort: option --config may not be abbreviated
142 [10]
143 $ hg --config-f "foo"
144 abort: option --config-file may not be abbreviated
145 [10]
146 $ hg --cw a tip
147 abort: option --cwd may not be abbreviated
148 [10]
149 $ hg --rep a tip
150 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
151 [10]
152 $ hg --repositor a tip
153 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
154 [10]
155 $ hg -qR a tip
156 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
157 [10]
158 $ hg -qRa tip
159 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
160 [10]
161
162 Testing --cwd:
163
164 $ hg --cwd a parents
165 changeset: 0:8580ff50825a
166 tag: tip
167 user: test
168 date: Thu Jan 01 00:00:01 1970 +0000
169 summary: a
170
171
172 Testing -y/--noninteractive - just be sure it is parsed:
173
174 $ hg --cwd a tip -q --noninteractive
175 0:8580ff50825a
176 $ hg --cwd a tip -q -y
177 0:8580ff50825a
178
179 Testing -q/--quiet:
180
181 $ hg -R a -q tip
182 0:8580ff50825a
183 $ hg -R b -q tip
184 0:b6c483daf290
185 $ hg -R c --quiet parents
186 0:8580ff50825a
187 1:b6c483daf290
188
189 Testing -v/--verbose:
190
191 $ hg --cwd c head -v
192 changeset: 1:b6c483daf290
193 tag: tip
194 parent: -1:000000000000
195 user: test
196 date: Thu Jan 01 00:00:01 1970 +0000
197 files: b
198 description:
199 b
200
201
202 changeset: 0:8580ff50825a
203 user: test
204 date: Thu Jan 01 00:00:01 1970 +0000
205 files: a
206 description:
207 a
208
209
210 $ hg --cwd b tip --verbose
211 changeset: 0:b6c483daf290
212 tag: tip
213 user: test
214 date: Thu Jan 01 00:00:01 1970 +0000
215 files: b
216 description:
217 b
218
219
220
221 Testing --config:
222
223 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
224 quuxfoo
225 TODO: add rhg support for detailed exit codes
226 $ hg --cwd c --config '' tip -q
227 abort: malformed --config option: '' (use --config section.name=value)
228 [10]
229 $ hg --cwd c --config a.b tip -q
230 abort: malformed --config option: 'a.b' (use --config section.name=value)
231 [10]
232 $ hg --cwd c --config a tip -q
233 abort: malformed --config option: 'a' (use --config section.name=value)
234 [10]
235 $ hg --cwd c --config a.= tip -q
236 abort: malformed --config option: 'a.=' (use --config section.name=value)
237 [10]
238 $ hg --cwd c --config .b= tip -q
239 abort: malformed --config option: '.b=' (use --config section.name=value)
240 [10]
241
242 Testing --debug:
243
244 $ hg --cwd c log --debug
245 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
246 tag: tip
247 phase: public
248 parent: -1:0000000000000000000000000000000000000000
249 parent: -1:0000000000000000000000000000000000000000
250 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
251 user: test
252 date: Thu Jan 01 00:00:01 1970 +0000
253 files+: b
254 extra: branch=default
255 description:
256 b
257
258
259 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
260 phase: public
261 parent: -1:0000000000000000000000000000000000000000
262 parent: -1:0000000000000000000000000000000000000000
263 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
264 user: test
265 date: Thu Jan 01 00:00:01 1970 +0000
266 files+: a
267 extra: branch=default
268 description:
269 a
270
271
272
273 Testing --traceback:
274
275 #if no-chg no-rhg
276 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
277 Traceback (most recent call last):
278 Traceback (most recent call last):
279 #else
280 Traceback for '--config' errors not supported with chg.
281 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
282 [1]
283 #endif
284
285 Testing --time:
286
287 $ hg --cwd a --time id
288 8580ff50825a tip
289 time: real * (glob)
290
291 Testing --version:
292
293 $ hg --version -q
294 Mercurial Distributed SCM * (glob)
295
296 hide outer repo
297 $ hg init
298
299 Testing -h/--help:
300
301 #if no-extraextensions
302
303 $ hg -h
304 Mercurial Distributed SCM
305
306 list of commands:
307
308 Repository creation:
309
310 clone make a copy of an existing repository
311 init create a new repository in the given directory
312
313 Remote repository management:
314
315 incoming show new changesets found in source
316 outgoing show changesets not found in the destination
317 paths show aliases for remote repositories
318 pull pull changes from the specified source
319 push push changes to the specified destination
320 serve start stand-alone webserver
321
322 Change creation:
323
324 commit commit the specified files or all outstanding changes
325
326 Change manipulation:
327
328 backout reverse effect of earlier changeset
329 graft copy changes from other branches onto the current branch
330 merge merge another revision into working directory
331
332 Change organization:
333
334 bookmarks create a new bookmark or list existing bookmarks
335 branch set or show the current branch name
336 branches list repository named branches
337 phase set or show the current phase name
338 tag add one or more tags for the current or given revision
339 tags list repository tags
340
341 File content management:
342
343 annotate show changeset information by line for each file
344 cat output the current or given revision of files
345 copy mark files as copied for the next commit
346 diff diff repository (or selected files)
347 grep search for a pattern in specified files
348
349 Change navigation:
350
351 bisect subdivision search of changesets
352 heads show branch heads
353 identify identify the working directory or specified revision
354 log show revision history of entire repository or files
355
356 Working directory management:
357
358 add add the specified files on the next commit
359 addremove add all new files, delete all missing files
360 files list tracked files
361 forget forget the specified files on the next commit
362 purge removes files not tracked by Mercurial
363 remove remove the specified files on the next commit
364 rename rename files; equivalent of copy + remove
365 resolve redo merges or set/view the merge status of files
366 revert restore files to their checkout state
367 root print the root (top) of the current working directory
368 shelve save and set aside changes from the working directory
369 status show changed files in the working directory
370 summary summarize working directory state
371 unshelve restore a shelved change to the working directory
372 update update working directory (or switch revisions)
373
374 Change import/export:
375
376 archive create an unversioned archive of a repository revision
377 bundle create a bundle file
378 export dump the header and diffs for one or more changesets
379 import import an ordered set of patches
380 unbundle apply one or more bundle files
381
382 Repository maintenance:
383
384 admin::verify
385 verify the integrity of the repository
386 manifest output the current or given revision of the project manifest
387 recover roll back an interrupted transaction
388 verify verify the integrity of the repository
389
390 Help:
391
392 config show combined config settings from all hgrc files
393 help show help for a given topic or a help overview
394 version output version and copyright information
395
396 additional help topics:
397
398 Mercurial identifiers:
399
400 filesets Specifying File Sets
401 hgignore Syntax for Mercurial Ignore Files
402 patterns File Name Patterns
403 revisions Specifying Revisions
404 urls URL Paths
405
406 Mercurial output:
407
408 color Colorizing Outputs
409 dates Date Formats
410 diffs Diff Formats
411 templating Template Usage
412
413 Mercurial configuration:
414
415 config Configuration Files
416 environment Environment Variables
417 extensions Using Additional Features
418 flags Command-line flags
419 hgweb Configuring hgweb
420 merge-tools Merge Tools
421 pager Pager Support
422 rust Rust in Mercurial
423
424 Concepts:
425
426 bundlespec Bundle File Formats
427 evolution Safely rewriting history (EXPERIMENTAL)
428 glossary Glossary
429 phases Working with Phases
430 subrepos Subrepositories
431
432 Miscellaneous:
433
434 deprecated Deprecated Features
435 internals Technical implementation topics
436 scripting Using Mercurial from scripts and automation
437
438 (use 'hg help -v' to show built-in aliases and global options)
439
440 $ hg --help
441 Mercurial Distributed SCM
442
443 list of commands:
444
445 Repository creation:
446
447 clone make a copy of an existing repository
448 init create a new repository in the given directory
449
450 Remote repository management:
451
452 incoming show new changesets found in source
453 outgoing show changesets not found in the destination
454 paths show aliases for remote repositories
455 pull pull changes from the specified source
456 push push changes to the specified destination
457 serve start stand-alone webserver
458
459 Change creation:
460
461 commit commit the specified files or all outstanding changes
462
463 Change manipulation:
464
465 backout reverse effect of earlier changeset
466 graft copy changes from other branches onto the current branch
467 merge merge another revision into working directory
468
469 Change organization:
470
471 bookmarks create a new bookmark or list existing bookmarks
472 branch set or show the current branch name
473 branches list repository named branches
474 phase set or show the current phase name
475 tag add one or more tags for the current or given revision
476 tags list repository tags
477
478 File content management:
479
480 annotate show changeset information by line for each file
481 cat output the current or given revision of files
482 copy mark files as copied for the next commit
483 diff diff repository (or selected files)
484 grep search for a pattern in specified files
485
486 Change navigation:
487
488 bisect subdivision search of changesets
489 heads show branch heads
490 identify identify the working directory or specified revision
491 log show revision history of entire repository or files
492
493 Working directory management:
494
495 add add the specified files on the next commit
496 addremove add all new files, delete all missing files
497 files list tracked files
498 forget forget the specified files on the next commit
499 purge removes files not tracked by Mercurial
500 remove remove the specified files on the next commit
501 rename rename files; equivalent of copy + remove
502 resolve redo merges or set/view the merge status of files
503 revert restore files to their checkout state
504 root print the root (top) of the current working directory
505 shelve save and set aside changes from the working directory
506 status show changed files in the working directory
507 summary summarize working directory state
508 unshelve restore a shelved change to the working directory
509 update update working directory (or switch revisions)
510
511 Change import/export:
512
513 archive create an unversioned archive of a repository revision
514 bundle create a bundle file
515 export dump the header and diffs for one or more changesets
516 import import an ordered set of patches
517 unbundle apply one or more bundle files
518
519 Repository maintenance:
520
521 admin::verify
522 verify the integrity of the repository
523 manifest output the current or given revision of the project manifest
524 recover roll back an interrupted transaction
525 verify verify the integrity of the repository
526
527 Help:
528
529 config show combined config settings from all hgrc files
530 help show help for a given topic or a help overview
531 version output version and copyright information
532
533 additional help topics:
534
535 Mercurial identifiers:
536
537 filesets Specifying File Sets
538 hgignore Syntax for Mercurial Ignore Files
539 patterns File Name Patterns
540 revisions Specifying Revisions
541 urls URL Paths
542
543 Mercurial output:
544
545 color Colorizing Outputs
546 dates Date Formats
547 diffs Diff Formats
548 templating Template Usage
549
550 Mercurial configuration:
551
552 config Configuration Files
553 environment Environment Variables
554 extensions Using Additional Features
555 flags Command-line flags
556 hgweb Configuring hgweb
557 merge-tools Merge Tools
558 pager Pager Support
559 rust Rust in Mercurial
560
561 Concepts:
562
563 bundlespec Bundle File Formats
564 evolution Safely rewriting history (EXPERIMENTAL)
565 glossary Glossary
566 phases Working with Phases
567 subrepos Subrepositories
568
569 Miscellaneous:
570
571 deprecated Deprecated Features
572 internals Technical implementation topics
573 scripting Using Mercurial from scripts and automation
574
575 (use 'hg help -v' to show built-in aliases and global options)
576
577 #endif
578
579 Not tested: --debugger
580