1HG(1) HG(1)
2
3
4
6 hg - Mercurial source code management system
7
9 hg [global option]... <command> [command/global option]...
10 [argument]...
11
12
14 The hg(1) command provides a command line interface to the Mercurial
15 system.
16
17
19 files ...
20 indicates one or more filename or relative path filenames; see
21 "FILE NAME PATTERNS" for information on pattern matching
22
23 path
24 indicates a path on the local machine
25
26 revision
27 indicates a changeset which can be specified as a changeset
28 revision number, a tag, or a unique substring of the changeset hash
29 value
30
31 repository path
32 either the pathname of a local repository or the URI of a remote
33 repository. There are two available URI protocols, http:// which is
34 fast and the static-http:// protocol which is much slower but does
35 not require a special server on the web host.
36
38 -R, --repository
39 repository root directory or symbolic path name
40
41 --cwd
42 change working directory
43
44 -y, --noninteractive
45 do not prompt, assume yes for any required answers
46
47 -q, --quiet
48 suppress output
49
50 -v, --verbose
51 enable additional output
52
53 --config
54 set/override config option
55
56 --debug
57 enable debugging output
58
59 --debugger
60 start debugger
61
62 --encoding
63 set the charset encoding (default: UTF-8)
64
65 --encodingmode
66 set the charset encoding mode (default: strict)
67
68 --lsprof
69 print improved command execution profile
70
71 --traceback
72 print traceback on exception
73
74 --time
75 time how long the command takes
76
77 --profile
78 print command execution profile
79
80 --version
81 output version information and exit
82
83 -h, --help
84 display help and exit
85
87 add [OPTION]... [FILE]...
88 Schedule files to be version controlled and added to the
89 repository.
90
91 The files will be added to the repository at the next commit. To
92 undo an add before that, see hg revert.
93
94 If no names are given, add all files in the repository.
95
96 options:
97 -I, --include include names matching the given patterns
98 -X, --exclude exclude names matching the given patterns
99 -n, --dry-run do not perform actions, just print output
100
101 addremove [OPTION]... [FILE]...
102 Add all new files and remove all missing files from the repository.
103
104 New files are ignored if they match any of the patterns in .hgignore. As
105 with add, these changes take effect at the next commit.
106
107 Use the -s option to detect renamed files. With a parameter > 0,
108 this compares every removed file with every added file and records
109 those similar enough as renames. This option takes a percentage
110 between 0 (disabled) and 100 (files must be identical) as its
111 parameter. Detecting renamed files this way can be expensive.
112
113 options:
114 -s, --similarity guess renamed files by similarity (0<=s<=100)
115 -I, --include include names matching the given patterns
116 -X, --exclude exclude names matching the given patterns
117 -n, --dry-run do not perform actions, just print output
118
119 annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] FILE...
120 List changes in files, showing the revision id responsible for each
121 line
122
123 This command is useful to discover who did a change or when a change took
124 place.
125
126 Without the -a option, annotate will avoid processing files it
127 detects as binary. With -a, annotate will generate an annotation
128 anyway, probably with undesirable results.
129
130 options:
131 -r, --rev annotate the specified revision
132 -f, --follow follow file copies and renames
133 -a, --text treat all files as text
134 -u, --user list the author
135 -d, --date list the date
136 -n, --number list the revision number (default)
137 -c, --changeset list the changeset
138 -I, --include include names matching the given patterns
139 -X, --exclude exclude names matching the given patterns
140
141 archive [OPTION]... DEST
142 By default, the revision used is the parent of the working
143 directory; use "-r" to specify a different revision.
144
145 To specify the type of archive to create, use "-t". Valid
146 types are:
147
148 "files" (default): a directory full of files
149 "tar": tar archive, uncompressed
150 "tbz2": tar archive, compressed using bzip2
151 "tgz": tar archive, compressed using gzip
152 "uzip": zip archive, uncompressed
153 "zip": zip archive, compressed using deflate
154
155 The exact name of the destination archive or directory is given
156 using a format string; see "hg help export" for details.
157
158 Each member added to an archive file has a directory prefix
159 prepended. Use "-p" to specify a format string for the prefix.
160 The default is the basename of the archive, with suffixes removed.
161
162 options:
163 --no-decode do not pass files through decoders
164 -p, --prefix directory prefix for files in archive
165 -r, --rev revision to distribute
166 -t, --type type of distribution to create
167 -I, --include include names matching the given patterns
168 -X, --exclude exclude names matching the given patterns
169
170 backout [OPTION]... [-r] REV
171 Commit the backed out changes as a new changeset. The new changeset
172 is a child of the backed out changeset.
173
174 If you back out a changeset other than the tip, a new head is
175 created. This head is the parent of the working directory. If
176 you back out an old changeset, your working directory will appear
177 old after the backout. You should merge the backout changeset
178 with another head.
179
180 The --merge option remembers the parent of the working directory
181 before starting the backout, then merges the new head with that
182 changeset afterwards. This saves you from doing the merge by
183 hand. The result of this merge is not committed, as for a normal
184 merge.
185
186 options:
187 --merge merge with old dirstate parent after backout
188 -d, --date record datecode as commit date
189 --parent parent to choose when backing out merge
190 -u, --user record user as committer
191 -r, --rev revision to backout
192 -I, --include include names matching the given patterns
193 -X, --exclude exclude names matching the given patterns
194 -m, --message use <text> as commit message
195 -l, --logfile read commit message from <file>
196
197 branch [NAME]
198 With no argument, show the current branch name. With one argument,
199 set the working directory branch name (the branch does not exist in
200 the repository until the next commit).
201
202 Unless --force is specified, branch will not let you set a
203 branch name that shadows an existing branch.
204
205 options:
206 -f, --force set branch name even if it shadows an existing branch
207
208 branches [-a]
209 List the repository's named branches, indicating which ones are
210 inactive. If active is specified, only show active branches.
211
212 A branch is considered active if it contains unmerged heads.
213
214 options:
215 -a, --active show only branches that have unmerged heads
216
217 bundle [-f] [-r REV]... [--base REV]... FILE [DEST]
218 Generate a compressed changegroup file collecting changesets not
219 found in the other repository.
220
221 If no destination repository is specified the destination is assumed
222 to have all the nodes specified by one or more --base parameters.
223
224 The bundle file can then be transferred using conventional means and
225 applied to another repository with the unbundle or pull command.
226 This is useful when direct push and pull are not available or when
227 exporting an entire repository is undesirable.
228
229 Applying bundles preserves all changeset contents including
230 permissions, copy/rename information, and revision history.
231
232 options:
233 -f, --force run even when remote repository is unrelated
234 -r, --rev a changeset you would like to bundle
235 --base a base changeset to specify instead of a destination
236 -e, --ssh specify ssh command to use
237 --remotecmd specify hg command to run on the remote side
238
239 cat [OPTION]... FILE...
240 Print the specified files as they were at the given revision. If no
241 revision is given, the parent of the working directory is used, or
242 tip if no revision is checked out.
243
244 Output may be to a file, in which case the name of the file is
245 given using a format string. The formatting rules are the same as
246 for the export command, with the following additions:
247
248 %s basename of file being printed
249 %d dirname of file being printed, or '.' if in repo root
250 %p root-relative path name of file being printed
251
252 options:
253 -o, --output print output to file with formatted name
254 -r, --rev print the given revision
255 -I, --include include names matching the given patterns
256 -X, --exclude exclude names matching the given patterns
257
258 clone [OPTION]... SOURCE [DEST]
259 Create a copy of an existing repository in a new directory.
260
261 If no destination directory name is specified, it defaults to the
262 basename of the source.
263
264 The location of the source is added to the new repository's
265 .hg/hgrc file, as the default to be used for future pulls.
266
267 For efficiency, hardlinks are used for cloning whenever the source
268 and destination are on the same filesystem (note this applies only
269 to the repository data, not to the checked out files). Some
270 filesystems, such as AFS, implement hardlinking incorrectly, but
271 do not report errors. In these cases, use the --pull option to
272 avoid hardlinking.
273
274 You can safely clone repositories and checked out files using full
275 hardlinks with
276
277 $ cp -al REPO REPOCLONE
278
279 which is the fastest way to clone. However, the operation is not
280 atomic (making sure REPO is not modified during the operation is
281 up to you) and you have to make sure your editor breaks hardlinks
282 (Emacs and most Linux Kernel tools do so).
283
284 If you use the -r option to clone up to a specific revision, no
285 subsequent revisions will be present in the cloned repository.
286 This option implies --pull, even on local repositories.
287
288 See pull for valid source format details.
289
290 It is possible to specify an ssh:// URL as the destination, but no
291 .hg/hgrc and working directory will be created on the remote side.
292 Look at the help text for the pull command for important details
293 about ssh:// URLs.
294
295 options:
296 -U, --noupdate do not update the new working directory
297 -r, --rev a changeset you would like to have after cloning
298 --pull use pull protocol to copy metadata
299 --uncompressed use uncompressed transfer (fast over LAN)
300 -e, --ssh specify ssh command to use
301 --remotecmd specify hg command to run on the remote side
302
303 commit [OPTION]... [FILE]...
304 Commit changes to the given files into the repository.
305
306 If a list of files is omitted, all changes reported by "hg status"
307 will be committed.
308
309 If no commit message is specified, the editor configured in your hgrc
310 or in the EDITOR environment variable is started to enter a message.
311
312 options:
313 -A, --addremove mark new/missing files as added/removed before
314 committing
315 -d, --date record datecode as commit date
316 -u, --user record user as commiter
317 -I, --include include names matching the given patterns
318 -X, --exclude exclude names matching the given patterns
319 -m, --message use <text> as commit message
320 -l, --logfile read commit message from <file>
321
322 aliases: ci
323
324 copy [OPTION]... [SOURCE]... DEST
325 Mark dest as having copies of source files. If dest is a directory,
326 copies are put in that directory. If dest is a file, there can only
327 be one source.
328
329 By default, this command copies the contents of files as they
330 stand in the working directory. If invoked with --after, the
331 operation is recorded, but no copying is performed.
332
333 This command takes effect in the next commit. To undo a copy
334 before that, see hg revert.
335
336 options:
337 -A, --after record a copy that has already occurred
338 -f, --force forcibly copy over an existing managed file
339 -I, --include include names matching the given patterns
340 -X, --exclude exclude names matching the given patterns
341 -n, --dry-run do not perform actions, just print output
342
343 aliases: cp
344
345 diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
346 Show differences between revisions for the specified files.
347
348 Differences between files are shown using the unified diff format.
349
350 NOTE: diff may generate unexpected results for merges, as it will
351 default to comparing against the working directory's first parent
352 changeset if no revisions are specified.
353
354 When two revision arguments are given, then changes are shown
355 between those revisions. If only one revision is specified then
356 that revision is compared to the working directory, and, when no
357 revisions are specified, the working directory files are compared
358 to its parent.
359
360 Without the -a option, diff will avoid generating diffs of files
361 it detects as binary. With -a, diff will generate a diff anyway,
362 probably with undesirable results.
363
364 options:
365 -r, --rev revision
366 -a, --text treat all files as text
367 -p, --show-function show which function each change is in
368 -g, --git use git extended diff format
369 --nodates don't include dates in diff headers
370 -w, --ignore-all-space ignore white space when comparing lines
371 -b, --ignore-space-change ignore changes in the amount of white
372 space
373 -B, --ignore-blank-lines ignore changes whose lines are all
374 blank
375 -I, --include include names matching the given
376 patterns
377 -X, --exclude exclude names matching the given
378 patterns
379
380 export [OPTION]... [-o OUTFILESPEC] REV...
381 Print the changeset header and diffs for one or more revisions.
382
383 The information shown in the changeset header is: author,
384 changeset hash, parent(s) and commit comment.
385
386 NOTE: export may generate unexpected diff output for merge changesets,
387 as it will compare the merge changeset against its first parent only.
388
389 Output may be to a file, in which case the name of the file is
390 given using a format string. The formatting rules are as follows:
391
392 %% literal "%" character
393 %H changeset hash (40 bytes of hexadecimal)
394 %N number of patches being generated
395 %R changeset revision number
396 %b basename of the exporting repository
397 %h short-form changeset hash (12 bytes of hexadecimal)
398 %n zero-padded sequence number, starting at 1
399 %r zero-padded changeset revision number
400
401 Without the -a option, export will avoid generating diffs of files
402 it detects as binary. With -a, export will generate a diff anyway,
403 probably with undesirable results.
404
405 With the --switch-parent option, the diff will be against the second
406 parent. It can be useful to review a merge.
407
408 options:
409 -o, --output print output to file with formatted name
410 -a, --text treat all files as text
411 -g, --git use git extended diff format
412 --nodates don't include dates in diff headers
413 --switch-parent diff against the second parent
414
415 grep [OPTION]... PATTERN [FILE]...
416 Search revisions of files for a regular expression.
417
418 This command behaves differently than Unix grep. It only accepts
419 Python/Perl regexps. It searches repository history, not the
420 working directory. It always prints the revision number in which
421 a match appears.
422
423 By default, grep only prints output for the first revision of a
424 file in which it finds a match. To get it to print every revision
425 that contains a change in match status ("-" for a match that
426 becomes a non-match, or "+" for a non-match that becomes a match),
427 use the --all flag.
428
429 options:
430 -0, --print0 end fields with NUL
431 --all print all revisions that match
432 -f, --follow follow changeset history, or file
433 history across copies and renames
434 -i, --ignore-case ignore case when matching
435 -l, --files-with-matches print only filenames and revs that match
436 -n, --line-number print matching line numbers
437 -r, --rev search in given revision range
438 -u, --user print user who committed change
439 -I, --include include names matching the given
440 patterns
441 -X, --exclude exclude names matching the given
442 patterns
443
444 heads [-r REV] [REV]...
445 With no arguments, show all repository head changesets.
446
447 If branch or revisions names are given this will show the heads of
448 the specified branches or the branches those revisions are tagged
449 with.
450
451 Repository "heads" are changesets that don't have child
452 changesets. They are where development generally takes place and
453 are the usual targets for update and merge operations.
454
455 Branch heads are changesets that have a given branch tag, but have
456 no child changesets with that tag. They are usually where
457 development on the given branch takes place.
458
459 options:
460 --style display using template map file
461 -r, --rev show only heads which are descendants of rev
462 --template display with template
463
464 help [COMMAND]
465 With no arguments, print a list of commands and short help.
466
467 Given a command name, print help for that command.
468
469 Given an extension name, print help for that extension, and the
470 commands it provides.
471
472 identify [-nibt] [-r REV] [SOURCE]
473 With no revision, print a summary of the current state of the repo.
474
475 With a path, do a lookup in another repository.
476
477 This summary identifies the repository state using one or two parent
478 hash identifiers, followed by a "+" if there are uncommitted changes
479 in the working directory, a list of tags for this revision and a branch
480 name for non-default branches.
481
482 options:
483 -r, --rev identify the specified rev
484 -n, --num show local revision number
485 -i, --id show global revision id
486 -b, --branch show branch
487 -t, --tags show tags
488
489 aliases: id
490
491 import [-p NUM] [-m MESSAGE] [-f] PATCH...
492 Import a list of patches and commit them individually.
493
494 If there are outstanding changes in the working directory, import
495 will abort unless given the -f flag.
496
497 You can import a patch straight from a mail message. Even patches
498 as attachments work (body part must be type text/plain or
499 text/x-patch to be used). From and Subject headers of email
500 message are used as default committer and commit message. All
501 text/plain body parts before first diff are added to commit
502 message.
503
504 If the imported patch was generated by hg export, user and description
505 from patch override values from message headers and body. Values
506 given on command line with -m and -u override these.
507
508 If --exact is specified, import will set the working directory
509 to the parent of each patch before applying it, and will abort
510 if the resulting changeset has a different ID than the one
511 recorded in the patch. This may happen due to character set
512 problems or other deficiencies in the text patch format.
513
514 To read a patch from standard input, use patch name "-".
515
516 options:
517 -p, --strip directory strip option for patch. This has the
518 same meaning as the corresponding patch option
519 (default: 1)
520 -b, --base base path
521 -f, --force skip check for outstanding uncommitted changes
522 --exact apply patch to the nodes from which it was
523 generated
524 --import-branch Use any branch information in patch (implied by
525 --exact)
526 -m, --message use <text> as commit message
527 -l, --logfile read commit message from <file>
528
529 aliases: patch
530
531 incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
532 Show new changesets found in the specified path/URL or the default
533 pull location. These are the changesets that would be pulled if a
534 pull was requested.
535
536 For remote repository, using --bundle avoids downloading the changesets
537 twice if the incoming is followed by a pull.
538
539 See pull for valid source format details.
540
541 options:
542 -M, --no-merges do not show merges
543 -f, --force run even when remote repository is unrelated
544 --style display using template map file
545 -n, --newest-first show newest record first
546 --bundle file to store the bundles into
547 -p, --patch show patch
548 -r, --rev a specific revision up to which you would like
549 to pull
550 --template display with template
551 -e, --ssh specify ssh command to use
552 --remotecmd specify hg command to run on the remote side
553
554 aliases: in
555
556 init [-e CMD] [--remotecmd CMD] [DEST]
557 Initialize a new repository in the given directory. If the given
558 directory does not exist, it is created.
559
560 If no directory is given, the current directory is used.
561
562 It is possible to specify an ssh:// URL as the destination.
563 Look at the help text for the pull command for important details
564 about ssh:// URLs.
565
566 options:
567 -e, --ssh specify ssh command to use
568 --remotecmd specify hg command to run on the remote side
569
570 locate [OPTION]... [PATTERN]...
571 Print all files under Mercurial control whose names match the given
572 patterns.
573
574 This command searches the entire repository by default. To search
575 just the current directory and its subdirectories, use
576 "--include .".
577
578 If no patterns are given to match, this command prints all file
579 names.
580
581 If you want to feed the output of this command into the "xargs"
582 command, use the "-0" option to both this command and "xargs".
583 This will avoid the problem of "xargs" treating single filenames
584 that contain white space as multiple filenames.
585
586 options:
587 -r, --rev search the repository as it stood at rev
588 -0, --print0 end filenames with NUL, for use with xargs
589 -f, --fullpath print complete paths from the filesystem root
590 -I, --include include names matching the given patterns
591 -X, --exclude exclude names matching the given patterns
592
593 log [OPTION]... [FILE]
594 Print the revision history of the specified files or the entire
595 project.
596
597 File history is shown without following rename or copy history of
598 files. Use -f/--follow with a file name to follow history across
599 renames and copies. --follow without a file name will only show
600 ancestors or descendants of the starting revision. --follow-first
601 only follows the first parent of merge revisions.
602
603 If no revision range is specified, the default is tip:0 unless
604 --follow is set, in which case the working directory parent is
605 used as the starting revision.
606
607 By default this command outputs: changeset id and hash, tags,
608 non-trivial parents, user, date and time, and a summary for each
609 commit. When the -v/--verbose switch is used, the list of changed
610 files and full commit message is shown.
611
612 NOTE: log -p may generate unexpected diff output for merge
613 changesets, as it will compare the merge changeset against its
614 first parent only. Also, the files: list will only reflect files
615 that are different from BOTH parents.
616
617 options:
618 -f, --follow follow changeset history, or file history
619 across copies and renames
620 --follow-first only follow the first parent of merge
621 changesets
622 -d, --date show revs matching date spec
623 -C, --copies show copied files
624 -k, --keyword do case-insensitive search for a keyword
625 -l, --limit limit number of changes displayed
626 -r, --rev show the specified revision or range
627 --removed include revs where files were removed
628 -M, --no-merges do not show merges
629 --style display using template map file
630 -m, --only-merges show only merges
631 -p, --patch show patch
632 -P, --prune do not display revision or any of its ancestors
633 --template display with template
634 -I, --include include names matching the given patterns
635 -X, --exclude exclude names matching the given patterns
636
637 aliases: history
638
639 manifest [REV]
640 Print a list of version controlled files for the given revision. If
641 no revision is given, the parent of the working directory is used,
642 or tip if no revision is checked out.
643
644 The manifest is the list of files being version controlled. If no revision
645 is given then the first parent of the working directory is used.
646
647 With -v flag, print file permissions. With --debug flag, print
648 file revision hashes.
649
650 merge [-f] [[-r] REV]
651 Merge the contents of the current working directory and the
652 requested revision. Files that changed between either parent are
653 marked as changed for the next commit and a commit must be
654 performed before any further updates are allowed.
655
656 If no revision is specified, the working directory's parent is a
657 head revision, and the repository contains exactly one other head,
658 the other head is merged with by default. Otherwise, an explicit
659 revision to merge with must be provided.
660
661 options:
662 -f, --force force a merge with outstanding changes
663 -r, --rev revision to merge
664
665 outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
666 Show changesets not found in the specified destination repository
667 or the default push location. These are the changesets that would
668 be pushed if a push was requested.
669
670 See pull for valid destination format details.
671
672 options:
673 -M, --no-merges do not show merges
674 -f, --force run even when remote repository is unrelated
675 -p, --patch show patch
676 --style display using template map file
677 -r, --rev a specific revision you would like to push
678 -n, --newest-first show newest record first
679 --template display with template
680 -e, --ssh specify ssh command to use
681 --remotecmd specify hg command to run on the remote side
682
683 aliases: out
684
685 parents [-r REV] [FILE]
686 Print the working directory's parent revisions. If a revision is
687 given via --rev, the parent of that revision will be printed. If a
688 file argument is given, revision in which the file was last changed
689 (before the working directory revision or the argument to --rev if
690 given) is printed.
691
692 options:
693 -r, --rev show parents from the specified rev
694 --style display using template map file
695 --template display with template
696
697 paths [NAME]
698 Show definition of symbolic path name NAME. If no name is given,
699 show definition of available names.
700
701 Path names are defined in the [paths] section of /etc/mercurial/hgrc
702 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
703
704 pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
705 Pull changes from a remote repository to a local one.
706
707 This finds all changes from the repository at the specified path
708 or URL and adds them to the local repository. By default, this
709 does not update the copy of the project in the working directory.
710
711 Valid URLs are of the form:
712
713 local/filesystem/path (or file://local/filesystem/path)
714 http://[user@]host[:port]/[path]
715 https://[user@]host[:port]/[path]
716 ssh://[user@]host[:port]/[path]
717 static-http://host[:port]/[path]
718
719 Paths in the local filesystem can either point to Mercurial
720 repositories or to bundle files (as created by 'hg bundle' or
721 ´hg incoming --bundle'). The static-http:// protocol, albeit slow,
722 allows access to a Mercurial repository where you simply use a web
723 server to publish the .hg directory as static content.
724
725 An optional identifier after # indicates a particular branch, tag,
726 or changeset to pull.
727
728 Some notes about using SSH with Mercurial:
729 - SSH requires an accessible shell account on the destination machine
730 and a copy of hg in the remote path or specified with as remotecmd.
731 - path is relative to the remote user's home directory by default.
732 Use an extra slash at the start of a path to specify an absolute path:
733 ssh://example.com//tmp/repository
734 - Mercurial doesn't use its own compression via SSH; the right thing
735 to do is to configure it in your ~/.ssh/config, e.g.:
736 Host *.mylocalnetwork.example.com
737 Compression no
738 Host *
739 Compression yes
740 Alternatively specify "ssh -C" as your ssh command in your hgrc or
741 with the --ssh command line option.
742
743 options:
744 -u, --update update to new tip if changesets were pulled
745 -f, --force run even when remote repository is unrelated
746 -r, --rev a specific revision up to which you would like to
747 pull
748 -e, --ssh specify ssh command to use
749 --remotecmd specify hg command to run on the remote side
750
751 push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
752 Push changes from the local repository to the given destination.
753
754 This is the symmetrical operation for pull. It helps to move
755 changes from the current repository to a different one. If the
756 destination is local this is identical to a pull in that directory
757 from the current one.
758
759 By default, push will refuse to run if it detects the result would
760 increase the number of remote heads. This generally indicates the
761 the client has forgotten to sync and merge before pushing.
762
763 Valid URLs are of the form:
764
765 local/filesystem/path (or file://local/filesystem/path)
766 ssh://[user@]host[:port]/[path]
767 http://[user@]host[:port]/[path]
768 https://[user@]host[:port]/[path]
769
770 An optional identifier after # indicates a particular branch, tag,
771 or changeset to push.
772
773 Look at the help text for the pull command for important details
774 about ssh:// URLs.
775
776 Pushing to http:// and https:// URLs is only possible, if this
777 feature is explicitly enabled on the remote Mercurial server.
778
779 options:
780 -f, --force force push
781 -r, --rev a specific revision you would like to push
782 -e, --ssh specify ssh command to use
783 --remotecmd specify hg command to run on the remote side
784
785 recover
786 Recover from an interrupted commit or pull.
787
788 This command tries to fix the repository status after an interrupted
789 operation. It should only be necessary when Mercurial suggests it.
790
791 remove [OPTION]... FILE...
792 Schedule the indicated files for removal from the repository.
793
794 This only removes files from the current branch, not from the
795 entire project history. If the files still exist in the working
796 directory, they will be deleted from it. If invoked with --after,
797 files are marked as removed, but not actually unlinked unless --force
798 is also given. Without exact file names, --after will only mark
799 files as removed if they are no longer in the working directory.
800
801 This command schedules the files to be removed at the next commit.
802 To undo a remove before that, see hg revert.
803
804 Modified files and added files are not removed by default. To
805 remove them, use the -f/--force option.
806
807 options:
808 -A, --after record remove that has already occurred
809 -f, --force remove file even if modified
810 -I, --include include names matching the given patterns
811 -X, --exclude exclude names matching the given patterns
812
813 aliases: rm
814
815 rename [OPTION]... SOURCE... DEST
816 Mark dest as copies of sources; mark sources for deletion. If dest
817 is a directory, copies are put in that directory. If dest is a
818 file, there can only be one source.
819
820 By default, this command copies the contents of files as they
821 stand in the working directory. If invoked with --after, the
822 operation is recorded, but no copying is performed.
823
824 This command takes effect in the next commit. To undo a rename
825 before that, see hg revert.
826
827 options:
828 -A, --after record a rename that has already occurred
829 -f, --force forcibly copy over an existing managed file
830 -I, --include include names matching the given patterns
831 -X, --exclude exclude names matching the given patterns
832 -n, --dry-run do not perform actions, just print output
833
834 aliases: mv
835
836 revert [OPTION]... [-r REV] [NAME]...
837 With no revision specified, revert the named files or directories
838 to the contents they had in the parent of the working directory.
839 This restores the contents of the affected files to an unmodified
840 state and unschedules adds, removes, copies, and renames. If the
841 working directory has two parents, you must explicitly specify the
842 revision to revert to.
843
844 Modified files are saved with a .orig suffix before reverting.
845 To disable these backups, use --no-backup.
846
847 Using the -r option, revert the given files or directories to their
848 contents as of a specific revision. This can be helpful to "roll
849 back" some or all of a change that should not have been committed.
850
851 Revert modifies the working directory. It does not commit any
852 changes, or change the parent of the working directory. If you
853 revert to a revision other than the parent of the working
854 directory, the reverted files will thus appear modified
855 afterwards.
856
857 If a file has been deleted, it is recreated. If the executable
858 mode of a file was changed, it is reset.
859
860 If names are given, all files matching the names are reverted.
861
862 If no arguments are given, no files are reverted.
863
864 options:
865 -a, --all revert all changes when no arguments given
866 -d, --date tipmost revision matching date
867 -r, --rev revision to revert to
868 --no-backup do not save backup copies of files
869 -I, --include include names matching the given patterns
870 -X, --exclude exclude names matching the given patterns
871 -n, --dry-run do not perform actions, just print output
872
873 rollback
874 Roll back the last transaction in this repository, restoring the
875 project to its state prior to the transaction.
876
877 Transactions are used to encapsulate the effects of all commands
878 that create new changesets or propagate existing changesets into a
879 repository. For example, the following commands are transactional,
880 and their effects can be rolled back:
881
882 commit
883 import
884 pull
885 push (with this repository as destination)
886 unbundle
887
888 This command should be used with care. There is only one level of
889 rollback, and there is no way to undo a rollback. It will also
890 restore the dirstate at the time of the last transaction, which
891 may lose subsequent dirstate changes.
892
893 This command is not intended for use on public repositories. Once
894 changes are visible for pull by other users, rolling a transaction
895 back locally is ineffective (someone else may already have pulled
896 the changes). Furthermore, a race is possible with readers of the
897 repository; for example an in-progress pull from the repository
898 may fail if a rollback is performed.
899
900 root
901 Print the root directory of the current repository.
902
903 serve [OPTION]...
904 Start a local HTTP repository browser and pull server.
905
906 By default, the server logs accesses to stdout and errors to
907 stderr. Use the "-A" and "-E" options to log to files.
908
909 options:
910 -A, --accesslog name of access log file to write to
911 -d, --daemon run server in background
912 --daemon-pipefds used internally by daemon mode
913 -E, --errorlog name of error log file to write to
914 -p, --port port to use (default: 8000)
915 -a, --address address to use
916 -n, --name name to show in web pages (default: working dir)
917 --webdir-conf name of the webdir config file (serve more than
918 one repo)
919 --pid-file name of file to write process ID to
920 --stdio for remote clients
921 -t, --templates web templates to use
922 --style template style to use
923 -6, --ipv6 use IPv6 in addition to IPv4
924
925 showconfig [-u] [NAME]...
926 With no args, print names and values of all config items.
927
928 With one arg of the form section.name, print just the value of
929 that config item.
930
931 With multiple args, print names and values of all config items
932 with matching section names.
933
934 options:
935 -u, --untrusted show untrusted configuration options
936
937 aliases: debugconfig
938
939 status [OPTION]... [FILE]...
940 Show status of files in the repository. If names are given, only
941 files that match are shown. Files that are clean or ignored, are
942 not listed unless -c (clean), -i (ignored) or -A is given.
943
944 NOTE: status may appear to disagree with diff if permissions have
945 changed or a merge has occurred. The standard diff format does not
946 report permission changes and diff only reports changes relative
947 to one merge parent.
948
949 If one revision is given, it is used as the base revision.
950 If two revisions are given, the difference between them is shown.
951
952 The codes used to show the status of files are:
953 M = modified
954 A = added
955 R = removed
956 C = clean
957 ! = deleted, but still tracked
958 ? = not tracked
959 I = ignored (not shown by default)
960 = the previous added file was copied from here
961
962 options:
963 -A, --all show status of all files
964 -m, --modified show only modified files
965 -a, --added show only added files
966 -r, --removed show only removed files
967 -d, --deleted show only deleted (but tracked) files
968 -c, --clean show only files without changes
969 -u, --unknown show only unknown (not tracked) files
970 -i, --ignored show only ignored files
971 -n, --no-status hide status prefix
972 -C, --copies show source of copied files
973 -0, --print0 end filenames with NUL, for use with xargs
974 --rev show difference from revision
975 -I, --include include names matching the given patterns
976 -X, --exclude exclude names matching the given patterns
977
978 aliases: st
979
980 tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME
981 Name a particular revision using <name>.
982
983 Tags are used to name particular revisions of the repository and are
984 very useful to compare different revision, to go back to significant
985 earlier versions or to mark branch points as releases, etc.
986
987 If no revision is given, the parent of the working directory is used,
988 or tip if no revision is checked out.
989
990 To facilitate version control, distribution, and merging of tags,
991 they are stored as a file named ".hgtags" which is managed
992 similarly to other project files and can be hand-edited if
993 necessary. The file '.hg/localtags' is used for local tags (not
994 shared among repositories).
995
996 options:
997 -f, --force replace existing tag
998 -l, --local make the tag local
999 -m, --message message for tag commit log entry
1000 -d, --date record datecode as commit date
1001 -u, --user record user as commiter
1002 -r, --rev revision to tag
1003 --remove remove a tag
1004
1005 tags
1006 List the repository tags.
1007
1008 This lists both regular and local tags.
1009
1010 tip [-p]
1011 Show the tip revision.
1012
1013 options:
1014 --style display using template map file
1015 -p, --patch show patch
1016 --template display with template
1017
1018 unbundle [-u] FILE...
1019 Apply one or more compressed changegroup files generated by the
1020 bundle command.
1021
1022 options:
1023 -u, --update update to new tip if changesets were unbundled
1024
1025 update [-C] [-d DATE] [[-r] REV]
1026 Update the working directory to the specified revision, or the tip
1027 of the current branch if none is specified.
1028
1029 If there are no outstanding changes in the working directory and
1030 there is a linear relationship between the current version and the
1031 requested version, the result is the requested version.
1032
1033 To merge the working directory with another revision, use the
1034 merge command.
1035
1036 By default, update will refuse to run if doing so would require
1037 discarding local changes.
1038
1039 options:
1040 -C, --clean overwrite locally modified files
1041 -d, --date tipmost revision matching date
1042 -r, --rev revision
1043
1044 aliases: up checkout co
1045
1046 verify
1047 Verify the integrity of the current repository.
1048
1049 This will perform an extensive check of the repository's
1050 integrity, validating the hashes and checksums of each entry in
1051 the changelog, manifest, and tracked files, as well as the
1052 integrity of their crosslinks and indices.
1053
1054 version
1055 output version and copyright information
1056
1058 Some commands (backout, commit, tag) allow the user to specify a date.
1059 Many date formats are acceptible. Here are some examples:
1060
1061 "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1062 "Dec 6 13:18 -0600" (year assumed, time offset provided)
1063 "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1064 "Dec 6" (midnight)
1065 "13:18" (today assumed)
1066 "3:39" (3:39AM assumed)
1067 "3:39pm" (15:39)
1068 "2006-12-6 13:18:29" (ISO 8601 format)
1069 "2006-12-6 13:18"
1070 "2006-12-6"
1071 "12-6"
1072 "12/6"
1073 "12/6/6" (Dec 6 2006)
1074
1075 Lastly, there is Mercurial's internal format:
1076
1077 "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC)
1078
1079 This is the internal representation format for dates. unixtime is
1080 the number of seconds since the epoch (1970-01-01 00:00 UTC). offset
1081 is the offset of the local timezone, in seconds west of UTC (negative
1082 if the timezone is east of UTC).
1083
1085 Mercurial accepts several notations for identifying one or more
1086 files at a time.
1087
1088 By default, Mercurial treats filenames as shell-style extended
1089 glob patterns.
1090
1091 Alternate pattern notations must be specified explicitly.
1092
1093 To use a plain path name without any pattern matching, start a
1094 name with "path:". These path names must match completely, from
1095 the root of the current repository.
1096
1097 To use an extended glob, start a name with "glob:". Globs are
1098 rooted at the current directory; a glob such as "*.c" will match
1099 files ending in ".c" in the current directory only.
1100
1101 The supported glob syntax extensions are "**" to match any string
1102 across path separators, and "{a,b}" to mean "a or b".
1103
1104 To use a Perl/Python regular expression, start a name with "re:".
1105 Regexp pattern matching is anchored at the root of the repository.
1106
1107 Plain examples:
1108
1109 path:foo/bar a name bar in a directory named foo in the root of
1110 the repository
1111 path:path:name a file or directory named "path:name"
1112
1113 Glob examples:
1114
1115 glob:*.c any name ending in ".c" in the current directory
1116 *.c any name ending in ".c" in the current directory
1117 **.c any name ending in ".c" in the current directory, or
1118 any subdirectory
1119 foo/*.c any name ending in ".c" in the directory foo
1120 foo/**.c any name ending in ".c" in the directory foo, or any
1121 subdirectory
1122
1123 Regexp examples:
1124
1125 re:.*\.c$ any name ending in ".c", anywhere in the repository
1126
1128 HG
1129 Path to the hg executable, automatically passed when running hooks
1130 or external tools. Falls back to hg if unset and the value can't be
1131 autodetected, e.g. when Mercurial is run as a Python module.
1132
1133 HGEDITOR
1134 This is the name of the editor to use when committing. Defaults to
1135 the value of EDITOR.
1136
1137 (deprecated, use .hgrc)
1138
1139 HGENCODING
1140 This overrides the default locale setting detected by Mercurial.
1141 This setting is used to convert data including usernames, changeset
1142 descriptions, tag names, and branches. This setting can be
1143 overridden with the --encoding command-line option.
1144
1145 HGENCODINGMODE
1146 This sets Mercurial's behavior for handling unknown characters
1147 while transcoding user inputs. The default is "strict", which
1148 causes Mercurial to abort if it can't translate a character. Other
1149 settings include "replace", which replaces unknown characters, and
1150 "ignore", which drops them. This setting can be overridden with the
1151 --encodingmode command-line option.
1152
1153 HGMERGE
1154 An executable to use for resolving merge conflicts. The program
1155 will be executed with three arguments: local file, remote file,
1156 ancestor file.
1157
1158 The default program is "hgmerge", which is a shell script provided
1159 by Mercurial with some sensible defaults.
1160
1161 (deprecated, use .hgrc)
1162
1163 HGRCPATH
1164 A list of files or directories to search for hgrc files. Item
1165 separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
1166 platform default search path is used. If empty, only .hg/hgrc of
1167 current repository is read.
1168
1169 For each element in path, if a directory, all entries in directory
1170 ending with ".rc" are added to path. Else, element itself is
1171 added to path.
1172
1173 HGUSER
1174 This is the string used for the author of a commit.
1175
1176 (deprecated, use .hgrc)
1177
1178 EMAIL
1179 If HGUSER is not set, this will be used as the author for a commit.
1180
1181 LOGNAME
1182 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
1183 @hostname appended) as the author value for a commit.
1184
1185 EDITOR
1186 This is the name of the editor used in the hgmerge script. It will
1187 be used for commit messages if HGEDITOR isn't set. Defaults to vi.
1188
1189 PYTHONPATH
1190 This is used by Python to find imported modules and may need to be
1191 set appropriately if Mercurial is not installed system-wide.
1192
1194 Mercurial accepts several notations for identifying individual
1195 revisions.
1196
1197 A plain integer is treated as a revision number. Negative
1198 integers are treated as offsets from the tip, with -1 denoting the
1199 tip.
1200
1201 A 40-digit hexadecimal string is treated as a unique revision
1202 identifier.
1203
1204 A hexadecimal string less than 40 characters long is treated as a
1205 unique revision identifier, and referred to as a short-form
1206 identifier. A short-form identifier is only valid if it is the
1207 prefix of one full-length identifier.
1208
1209 Any other string is treated as a tag name, which is a symbolic
1210 name associated with a revision identifier. Tag names may not
1211 contain the ":" character.
1212
1213 The reserved name "tip" is a special tag that always identifies
1214 the most recent revision.
1215
1217 When Mercurial accepts more than one revision, they may be
1218 specified individually, or provided as a continuous range,
1219 separated by the ":" character.
1220
1221 The syntax of range notation is [BEGIN]:[END], where BEGIN and END
1222 are revision identifiers. Both BEGIN and END are optional. If
1223 BEGIN is not specified, it defaults to revision number 0. If END
1224 is not specified, it defaults to the tip. The range ":" thus
1225 means "all revisions".
1226
1227 If BEGIN is greater than END, revisions are treated in reverse
1228 order.
1229
1230 A range acts as a closed interval. This means that a range of 3:5
1231 gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2.
1232
1234 .hgignore
1235 This file contains regular expressions (one per line) that describe
1236 file names that should be ignored by hg. For details, see
1237 hgignore(5).
1238
1239 .hgtags
1240 This file contains changeset hash values and text tag names (one of
1241 each separated by spaces) that correspond to tagged versions of the
1242 repository contents.
1243
1244 /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc
1245 This file contains defaults and configuration. Values in .hg/hgrc
1246 override those in $HOME/.hgrc, and these override settings made in
1247 the global /etc/mercurial/hgrc configuration. See hgrc(5) for
1248 details of the contents and format of these files.
1249 Some commands (e.g. revert) produce backup files ending in .orig, if
1250 the .orig file already exists and is not tracked by Mercurial, it will
1251 be overwritten.
1252
1253
1255 Probably lots, please post them to the mailing list (See Resources
1256 below) when you find them.
1257
1258
1260 hgignore(5), hgrc(5)
1261
1262
1264 Written by Matt Mackall <mpm@selenic.com>
1265
1266
1268 Main Web Site[1]
1269
1270 Source code repository[2]
1271
1272 Mailing list[3]
1273
1274
1276 Copyright (C) 2005-2007 Matt Mackall. Free use of this software is
1277 granted under the terms of the GNU General Public License (GPL).
1278
1279
1281 1. Main Web Site
1282 http://selenic.com/mercurial
1283
1284 2. Source code repository
1285 http://selenic.com/hg
1286
1287 3. Mailing list
1288 http://selenic.com/mailman/listinfo/mercurial
1289
1290
1291
1292 06/25/2007 HG(1)