##// END OF EJS Templates
updated manpage on global options and typo fix.
TK Soh -
r1084:069b4311 default
parent child Browse files
Show More
@@ -1,662 +1,683 b''
1 1 HG(1)
2 2 =====
3 3 Matt Mackall <mpm@selenic.com>
4 4
5 5 NAME
6 6 ----
7 7 hg - Mercurial source code management system
8 8
9 9 SYNOPSIS
10 10 --------
11 11 'hg' [-v -d -q -y] <command> [command options] [files]
12 12
13 13 DESCRIPTION
14 14 -----------
15 15 The hg(1) command provides a command line interface to the Mercurial system.
16 16
17 17 OPTIONS
18 18 -------
19 19
20 --debug, -d::
21 enable debugging output
20 -R, --repository::
21 repository root directory
22
23 --cwd::
24 change working directory
22 25
23 --quiet, -q::
26 -y, --noninteractive::
27 do not prompt, assume 'yes' for any required answers
28
29 -q, --quiet::
24 30 suppress output
25 31
26 --verbose, -v::
32 -v, --verbose::
27 33 enable additional output
28 34
29 --noninteractive, -y::
30 do not prompt, assume 'yes' for any required answers
35 --debug::
36 enable debugging output
37
38 --traceback::
39 print traceback on exception
40
41 --time::
42 time how long the command takes
43
44 --profile::
45 print command execution profile
46
47 --version::
48 output version information and exit
49
50 -h, --help::
51 display help and exit
31 52
32 53 COMMAND ELEMENTS
33 54 ----------------
34 55
35 56 files ...::
36 57 indicates one or more filename or relative path filenames; see
37 58 "FILE NAME PATTERNS" for information on pattern matching
38 59
39 60 path::
40 61 indicates a path on the local machine
41 62
42 63 revision::
43 64 indicates a changeset which can be specified as a changeset revision
44 65 number, a tag, or a unique substring of the changeset hash value
45 66
46 67 repository path::
47 68 either the pathname of a local repository or the URI of a remote
48 69 repository. There are two available URI protocols, http:// which is
49 70 fast and the old-http:// protocol which is much slower but does not
50 71 require a special server on the web host.
51 72
52 73 COMMANDS
53 74 --------
54 75
55 76 add [options] [files ...]::
56 77 Schedule files to be version controlled and added to the repository.
57 78
58 79 The files will be added to the repository at the next commit.
59 80
60 81 If no names are given, add all files in the current directory and
61 82 its subdirectories.
62 83
63 84 addremove [options] [files ...]::
64 85 Add all new files and remove all missing files from the repository.
65 86
66 87 New files are ignored if they match any of the patterns in .hgignore. As
67 88 with add, these changes take effect at the next commit.
68 89
69 90 annotate [-r <rev> -u -n -c] [files ...]::
70 91 List changes in files, showing the revision id responsible for each line
71 92
72 93 This command is useful to discover who did a change or when a change took
73 94 place.
74 95
75 96 Without the -a option, annotate will avoid processing files it
76 97 detects as binary. With -a, annotate will generate an annotation
77 98 anyway, probably with undesirable results.
78 99
79 100 options:
80 101 -a, --text treat all files as text
81 102 -I, --include <pat> include names matching the given patterns
82 103 -X, --exclude <pat> exclude names matching the given patterns
83 104 -r, --revision <rev> annotate the specified revision
84 105 -u, --user list the author
85 106 -c, --changeset list the changeset
86 107 -n, --number list the revision number (default)
87 108
88 109 cat <file> [revision]::
89 110 Output to stdout the given revision for the specified file.
90 111
91 112 If no revision is given then the tip is used.
92 113
93 114 clone [-U] <source> [dest]::
94 115 Create a copy of an existing repository in a new directory.
95 116
96 117 If no destination directory name is specified, it defaults to the
97 118 basename of the source.
98 119
99 120 The source is added to the new repository's .hg/hgrc file to be used in
100 121 future pulls.
101 122
102 123 For efficiency, hardlinks are used for cloning whenever the
103 124 source and destination are on the same filesystem.
104 125
105 126 options:
106 127 -U, --noupdate do not update the new working directory
107 128 -e, --ssh specify ssh command to use
108 129 --remotecmd specify hg command to run on the remote side
109 130
110 131 commit [options] [files...]::
111 132 Commit changes to the given files into the repository.
112 133
113 134 If a list of files is omitted, all changes reported by "hg status"
114 135 from the root of the repository will be commited.
115 136
116 137 The HGEDITOR or EDITOR environment variables are used to start an
117 138 editor to add a commit comment.
118 139
119 140 Options:
120 141
121 142 -A, --addremove run addremove during commit
122 143 -I, --include <pat> include names matching the given patterns
123 144 -X, --exclude <pat> exclude names matching the given patterns
124 145 -m, --message <text> use <text> as commit message
125 -l, --logfile <file> show the commit message for the given file
146 -l, --logfile <file> read the commit message from <file>
126 147 -d, --date <datecode> record datecode as commit date
127 148 -u, --user <user> record user as commiter
128 149
129 150 aliases: ci
130 151
131 152 copy <source> <dest>::
132 153 Mark <dest> file as a copy or rename of a <source> one
133 154
134 155 This command takes effect for the next commit.
135 156
136 157 diff [-a] [-r revision] [-r revision] [files ...]::
137 158 Show differences between revisions for the specified files.
138 159
139 160 Differences between files are shown using the unified diff format.
140 161
141 162 When two revision arguments are given, then changes are shown
142 163 between those revisions. If only one revision is specified then
143 164 that revision is compared to the working directory, and, when no
144 165 revisions are specified, the working directory files are compared
145 166 to its parent.
146 167
147 168 Without the -a option, diff will avoid generating diffs of files
148 169 it detects as binary. With -a, diff will generate a diff anyway,
149 170 probably with undesirable results.
150 171
151 172 options:
152 173 -a, --text treat all files as text
153 174 -I, --include <pat> include names matching the given patterns
154 175 -X, --exclude <pat> exclude names matching the given patterns
155 176
156 177 export [-o filespec] [revision] ...::
157 178 Print the changeset header and diffs for one or more revisions.
158 179
159 180 The information shown in the changeset header is: author,
160 181 changeset hash, parent and commit comment.
161 182
162 183 Output may be to a file, in which case the name of the file is
163 184 given using a format string. The formatting rules are as follows:
164 185
165 186 %% literal "%" character
166 187 %H changeset hash (40 bytes of hexadecimal)
167 188 %N number of patches being generated
168 189 %R changeset revision number
169 190 %b basename of the exporting repository
170 191 %h short-form changeset hash (12 bytes of hexadecimal)
171 192 %n zero-padded sequence number, starting at 1
172 193 %r zero-padded changeset revision number
173 194
174 195 Without the -a option, export will avoid generating diffs of files
175 196 it detects as binary. With -a, export will generate a diff anyway,
176 197 probably with undesirable results.
177 198
178 199 options:
179 200 -a, --text treat all files as text
180 201 -o, --output <filespec> print output to file with formatted named
181 202
182 203 forget [options] [files]::
183 204 Undo an 'hg add' scheduled for the next commit.
184 205
185 206 options:
186 207 -I, --include <pat> include names matching the given patterns
187 208 -X, --exclude <pat> exclude names matching the given patterns
188 209
189 210 heads::
190 211 Show all repository head changesets.
191 212
192 213 Repository "heads" are changesets that don't have children
193 214 changesets. They are where development generally takes place and
194 215 are the usual targets for update and merge operations.
195 216
196 217 identify::
197 218 Print a short summary of the current state of the repo.
198 219
199 220 This summary identifies the repository state using one or two parent
200 221 hash identifiers, followed by a "+" if there are uncommitted changes
201 222 in the working directory, followed by a list of tags for this revision.
202 223
203 224 aliases: id
204 225
205 226 import [-p <n> -b <base> -f] <patches>::
206 227 Import a list of patches and commit them individually.
207 228
208 229 options:
209 230 -p, --strip <n> directory strip option for patch. This has the same
210 231 meaning as the corresponding patch option
211 232 -b <path> base directory to read patches from
212 233 -f, --force skip check for outstanding uncommitted changes
213 234
214 235 aliases: patch
215 236
216 237 incoming [source]::
217 238 Show new changesets found in the specified repo or the default
218 239 pull repo. These are the changesets that would be pulled if a pull
219 240 was requested.
220 241
221 242 Currently only local repositories are supported.
222 243
223 244 aliases: in
224 245
225 246 init [dest]::
226 247 Initialize a new repository in the given directory. If the given
227 248 directory does not exist, it is created.
228 249
229 250 If no directory is given, the current directory is used.
230 251
231 252 locate [options] [files]::
232 253 Print all files under Mercurial control whose names match the
233 254 given patterns.
234 255
235 256 This command searches the current directory and its
236 257 subdirectories. To search an entire repository, move to the root
237 258 of the repository.
238 259
239 260 If no patterns are given to match, this command prints all file
240 261 names.
241 262
242 263 If you want to feed the output of this command into the "xargs"
243 264 command, use the "-0" option to both this command and "xargs".
244 265 This will avoid the problem of "xargs" treating single filenames
245 266 that contain white space as multiple file names.
246 267
247 268 options:
248 269
249 270 -0, --print0 end filenames with NUL, for use with xargs
250 271 -f, --fullpath print complete paths from the filesystem root
251 272 -I, --include <pat> include names matching the given patterns
252 273 -r, --rev <rev> search the repository as it stood at rev
253 274 -X, --exclude <pat> exclude names matching the given patterns
254 275
255 276 log [-r revision ...] [-p] [files]::
256 277 Print the revision history of the specified files or the entire project.
257 278
258 279 By default this command outputs: changeset id and hash, tags,
259 280 parents, user, date and time, and a summary for each commit. The
260 281 -v switch adds some more detail, such as changed files, manifest
261 282 hashes or message signatures.
262 283
263 284 options:
264 285 -I, --include <pat> include names matching the given patterns
265 286 -X, --exclude <pat> exclude names matching the given patterns
266 287 -r, --rev <A> show the specified revision or range
267 288 -p, --patch show patch
268 289
269 290 aliases: history
270 291
271 292 manifest [revision]::
272 293 Print a list of version controlled files for the given revision.
273 294
274 295 The manifest is the list of files being version controlled. If no revision
275 296 is given then the tip is used.
276 297
277 298 outgoing [dest]::
278 299 Show changesets not found in the specified destination repo or the
279 300 default push repo. These are the changesets that would be pushed
280 301 if a push was requested.
281 302
282 303 aliases: out
283 304
284 305 parents::
285 306 Print the working directory's parent revisions.
286 307
287 308 paths [NAME]::
288 309 Show definition of symbolic path name NAME. If no name is given, show
289 310 definition of available names.
290 311
291 312 Path names are defined in the [paths] section of /etc/mercurial/hgrc
292 313 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
293 314
294 315 pull <repository path>::
295 316 Pull changes from a remote repository to a local one.
296 317
297 318 This finds all changes from the repository at the specified path
298 319 or URL and adds them to the local repository. By default, this
299 320 does not update the copy of the project in the working directory.
300 321
301 322 Valid URLs are of the form:
302 323
303 324 local/filesystem/path
304 325 http://[user@]host[:port][/path]
305 326 https://[user@]host[:port][/path]
306 327 ssh://[user@]host[:port][/path]
307 328
308 329 SSH requires an accessible shell account on the destination
309 330 machine and a copy of hg in the remote path.
310 331
311 332 options:
312 333 -u, --update update the working directory to tip after pull
313 334 -e, --ssh specify ssh command to use
314 335 --remotecmd specify hg command to run on the remote side
315 336
316 337 push <destination>::
317 338 Push changes from the local repository to the given destination.
318 339
319 340 This is the symmetrical operation for pull. It helps to move
320 341 changes from the current repository to a different one. If the
321 342 destination is local this is identical to a pull in that directory
322 343 from the current one.
323 344
324 345 By default, push will refuse to run if it detects the result would
325 346 increase the number of remote heads. This generally indicates the
326 347 the client has forgotten to sync and merge before pushing.
327 348
328 349 Valid URLs are of the form:
329 350
330 351 local/filesystem/path
331 352 ssh://[user@]host[:port][/path]
332 353
333 354 SSH requires an accessible shell account on the destination
334 355 machine and a copy of hg in the remote path.
335 356
336 357 options:
337 358
338 359 -f, --force force update
339 360 -e, --ssh specify ssh command to use
340 361 --remotecmd specify hg command to run on the remote side
341 362
342 363 rawcommit [-p -d -u -F -m -l]::
343 364 Lowlevel commit, for use in helper scripts.
344 365
345 366 This command is not intended to be used by normal users, as it is
346 367 primarily useful for importing from other SCMs.
347 368
348 369 recover::
349 370 Recover from an interrupted commit or pull.
350 371
351 372 This command tries to fix the repository status after an interrupted
352 373 operation. It should only be necessary when Mercurial suggests it.
353 374
354 375 remove [files ...]::
355 376 Schedule the indicated files for removal from the repository.
356 377
357 378 This command schedules the files to be removed at the next commit.
358 379 This only removes files from the current branch, not from the
359 380 entire project history.
360 381
361 382 aliases: rm
362 383
363 384 revert [names ...]::
364 385 Revert any uncommitted modifications made to the named files or
365 386 directories. This restores the contents of the affected files to
366 387 an unmodified state.
367 388
368 389 If a file has been deleted, it is recreated. If the executable
369 390 mode of a file was changed, it is reset.
370 391
371 392 If a directory is given, all files in that directory and its
372 393 subdirectories are reverted.
373 394
374 395 If no arguments are given, all files in the current directory and
375 396 its subdirectories are reverted.
376 397
377 398 options:
378 399 -r, --rev <rev> revision to revert to
379 400 -n, --nonrecursive do not recurse into subdirectories
380 401
381 402 root::
382 403 Print the root directory of the current repository.
383 404
384 405 serve [options]::
385 406 Start a local HTTP repository browser and pull server.
386 407
387 408 By default, the server logs accesses to stdout and errors to
388 409 stderr. Use the "-A" and "-E" options to log to files.
389 410
390 411 options:
391 412 -A, --accesslog <file> name of access log file to write to
392 413 -E, --errorlog <file> name of error log file to write to
393 414 -a, --address <addr> address to use
394 415 -p, --port <n> port to use (default: 8000)
395 416 -n, --name <name> name to show in web pages (default: working dir)
396 417 -t, --templatedir <path> web templates to use
397 418 -6, --ipv6 use IPv6 in addition to IPv4
398 419
399 420 status [options] [files]::
400 421 Show changed files in the working directory. If no names are
401 422 given, all files are shown. Otherwise, only files matching the
402 423 given names are shown.
403 424
404 425 The codes used to show the status of files are:
405 426
406 427 M = changed
407 428 A = added
408 429 R = removed
409 430 ? = not tracked
410 431
411 432 options:
412 433
413 434 -m, --modified show only modified files
414 435 -a, --added show only added files
415 436 -r, --removed show only removed files
416 437 -u, --unknown show only unknown (not tracked) files
417 438 -I, --include <pat> include names matching the given patterns
418 439 -X, --exclude <pat> exclude names matching the given patterns
419 440
420 441 tag [-l -m <text> -d <datecode> -u <user>] <name> [revision]::
421 442 Name a particular revision using <name>.
422 443
423 444 Tags are used to name particular revisions of the repository and are
424 445 very useful to compare different revision, to go back to significant
425 446 earlier versions or to mark branch points as releases, etc.
426 447
427 448 If no revision is given, the tip is used.
428 449
429 450 To facilitate version control, distribution, and merging of tags,
430 451 they are stored as a file named ".hgtags" which is managed
431 452 similarly to other project files and can be hand-edited if
432 453 necessary.
433 454
434 455 options:
435 456 -l, --local make the tag local
436 457 -m, --message <text> message for tag commit log entry
437 458 -d, --date <datecode> datecode for commit
438 459 -u, --user <user> user for commit
439 460
440 461 Note: Local tags are not version-controlled or distributed and are
441 462 stored in the .hg/localtags file. If there exists a local tag and
442 463 a public tag with the same name, local tag is used.
443 464
444 465 tags::
445 466 List the repository tags.
446 467
447 468 This lists both regular and local tags.
448 469
449 470 tip::
450 471 Show the tip revision.
451 472
452 473 undo::
453 474 Undo the last commit or pull transaction.
454 475
455 476 Roll back the last pull or commit transaction on the
456 477 repository, restoring the project to its earlier state.
457 478
458 479 This command should be used with care. There is only one level of
459 480 undo and there is no redo.
460 481
461 482 This command is not intended for use on public repositories. Once
462 483 a change is visible for pull by other users, undoing it locally is
463 484 ineffective.
464 485
465 486 update [-m -C] [revision]::
466 487 Update the working directory to the specified revision.
467 488
468 489 By default, update will refuse to run if doing so would require
469 490 merging or discarding local changes.
470 491
471 492 With the -m option, a merge will be performed.
472 493
473 494 With the -C option, local changes will be lost.
474 495
475 496 options:
476 497 -m, --merge allow merging of branches
477 498 -C, --clean overwrite locally modified files
478 499
479 500 aliases: up checkout co
480 501
481 502 verify::
482 503 Verify the integrity of the current repository.
483 504
484 505 This will perform an extensive check of the repository's
485 506 integrity, validating the hashes and checksums of each entry in
486 507 the changelog, manifest, and tracked files, as well as the
487 508 integrity of their crosslinks and indices.
488 509
489 510 FILE NAME PATTERNS
490 511 ------------------
491 512
492 513 Mercurial accepts several notations for identifying one or more
493 514 file at a time.
494 515
495 516 By default, Mercurial treats file names as shell-style extended
496 517 glob patterns.
497 518
498 519 Alternate pattern notations must be specified explicitly.
499 520
500 521 To use a plain path name without any pattern matching, start a
501 522 name with "path:". These path names must match completely, from
502 523 the root of the current repository.
503 524
504 525 To use an extended glob, start a name with "glob:". Globs are
505 526 rooted at the current directory; a glob such as "*.c" will match
506 527 files ending in ".c" in the current directory only.
507 528
508 529 The supported glob syntax extensions are "**" to match any string
509 530 across path separators, and "{a,b}" to mean "a or b".
510 531
511 532 To use a Perl/Python regular expression, start a name with "re:".
512 533 Regexp pattern matching is anchored at the root of the repository.
513 534
514 535 Plain examples:
515 536
516 537 path:foo/bar a name bar in a directory named foo in the root of
517 538 the repository
518 539 path:path:name a file or directory named "path:name"
519 540
520 541 Glob examples:
521 542
522 543 glob:*.c any name ending in ".c" in the current directory
523 544 *.c any name ending in ".c" in the current directory
524 545 **.c any name ending in ".c" in the current directory, or
525 546 any subdirectory
526 547 foo/*.c any name ending in ".c" in the directory foo
527 548 foo/**.c any name ending in ".c" in the directory foo, or any
528 549 subdirectory
529 550
530 551 Regexp examples:
531 552
532 553 re:.*\.c$ any name ending in ".c", anywhere in the repository
533 554
534 555
535 556 SPECIFYING SINGLE REVISIONS
536 557 ---------------------------
537 558
538 559 Mercurial accepts several notations for identifying individual
539 560 revisions.
540 561
541 562 A plain integer is treated as a revision number. Negative
542 563 integers are treated as offsets from the tip, with -1 denoting the
543 564 tip.
544 565
545 566 A 40-digit hexadecimal string is treated as a unique revision
546 567 identifier.
547 568
548 569 A hexadecimal string less than 40 characters long is treated as a
549 570 unique revision identifier, and referred to as a short-form
550 571 identifier. A short-form identifier is only valid if it is the
551 572 prefix of one full-length identifier.
552 573
553 574 Any other string is treated as a tag name, which is a symbolic
554 575 name associated with a revision identifier. Tag names may not
555 576 contain the ":" character.
556 577
557 578 The reserved name "tip" is a special tag that always identifies
558 579 the most recent revision.
559 580
560 581 SPECIFYING MULTIPLE REVISIONS
561 582 -----------------------------
562 583
563 584 When Mercurial accepts more than one revision, they may be
564 585 specified individually, or provided as a continuous range,
565 586 separated by the ":" character.
566 587
567 588 The syntax of range notation is [BEGIN]:[END], where BEGIN and END
568 589 are revision identifiers. Both BEGIN and END are optional. If
569 590 BEGIN is not specified, it defaults to revision number 0. If END
570 591 is not specified, it defaults to the tip. The range ":" thus
571 592 means "all revisions".
572 593
573 594 If BEGIN is greater than END, revisions are treated in reverse
574 595 order.
575 596
576 597 A range acts as a closed interval. This means that a range of 3:5
577 598 gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2.
578 599
579 600 ENVIRONMENT VARIABLES
580 601 ---------------------
581 602
582 603 HGEDITOR::
583 604 This is the name of the editor to use when committing. Defaults to the
584 605 value of EDITOR.
585 606
586 607 (deprecated, use .hgrc)
587 608
588 609 HGMERGE::
589 610 An executable to use for resolving merge conflicts. The program
590 611 will be executed with three arguments: local file, remote file,
591 612 ancestor file.
592 613
593 614 The default program is "hgmerge", which is a shell script provided
594 615 by Mercurial with some sensible defaults.
595 616
596 617 (deprecated, use .hgrc)
597 618
598 619 HGUSER::
599 620 This is the string used for the author of a commit.
600 621
601 622 (deprecated, use .hgrc)
602 623
603 624 EMAIL::
604 625 If HGUSER is not set, this will be used as the author for a commit.
605 626
606 627 LOGNAME::
607 628 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
608 629 '@hostname' appended) as the author value for a commit.
609 630
610 631 EDITOR::
611 632 This is the name of the editor used in the hgmerge script. It will be
612 633 used for commit messages if HGEDITOR isn't set. Defaults to 'vi'.
613 634
614 635 PYTHONPATH::
615 636 This is used by Python to find imported modules and may need to be set
616 637 appropriately if Mercurial is not installed system-wide.
617 638
618 639 FILES
619 640 -----
620 641 .hgignore::
621 642 This file contains regular expressions (one per line) that describe file
622 643 names that should be ignored by hg.
623 644
624 645 .hgtags::
625 646 This file contains changeset hash values and text tag names (one of each
626 647 separated by spaces) that correspond to tagged versions of the repository
627 648 contents.
628 649
629 650 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc::
630 651 This file contains defaults and configuration. Values in .hg/hgrc
631 652 override those in $HOME/.hgrc, and these override settings made in the
632 653 global /etc/mercurial/hgrc configuration. See hgrc(5) for details of
633 654 the contents and format of these files.
634 655
635 656 BUGS
636 657 ----
637 658 Probably lots, please post them to the mailing list (See Resources below)
638 659 when you find them.
639 660
640 661 SEE ALSO
641 662 --------
642 663 hgrc(5)
643 664
644 665 AUTHOR
645 666 ------
646 667 Written by Matt Mackall <mpm@selenic.com>
647 668
648 669 RESOURCES
649 670 ---------
650 671 http://selenic.com/mercurial[Main Web Site]
651 672
652 673 http://www.serpentine.com/mercurial[Wiki site]
653 674
654 675 http://selenic.com/hg[Source code repository]
655 676
656 677 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
657 678
658 679 COPYING
659 680 -------
660 681 Copyright (C) 2005 Matt Mackall.
661 682 Free use of this software is granted under the terms of the GNU General
662 683 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now