comparison doc/hg.1.txt @ 1929:85daa4e03b4c

Merging with crew.
author Eric Hopper <hopper@omnifarious.org>
date Mon, 06 Mar 2006 08:47:16 -0800
parents 7956893e8458
children b7cc0f323a4c
comparison
equal deleted inserted replaced
1927:397b62d5dd13 1929:85daa4e03b4c
11 'hg' [-v -d -q -y] <command> [command options] [files] 11 'hg' [-v -d -q -y] <command> [command options] [files]
12 12
13 DESCRIPTION 13 DESCRIPTION
14 ----------- 14 -----------
15 The hg(1) command provides a command line interface to the Mercurial system. 15 The hg(1) command provides a command line interface to the Mercurial system.
16
17 OPTIONS
18 -------
19
20 -R, --repository::
21 repository root directory
22
23 --cwd::
24 change working directory
25
26 -y, --noninteractive::
27 do not prompt, assume 'yes' for any required answers
28
29 -q, --quiet::
30 suppress output
31
32 -v, --verbose::
33 enable additional output
34
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
52 16
53 COMMAND ELEMENTS 17 COMMAND ELEMENTS
54 ---------------- 18 ----------------
55 19
56 files ...:: 20 files ...::
68 either the pathname of a local repository or the URI of a remote 32 either the pathname of a local repository or the URI of a remote
69 repository. There are two available URI protocols, http:// which is 33 repository. There are two available URI protocols, http:// which is
70 fast and the old-http:// protocol which is much slower but does not 34 fast and the old-http:// protocol which is much slower but does not
71 require a special server on the web host. 35 require a special server on the web host.
72 36
73 COMMANDS 37
74 -------- 38 include::hg.1.gendoc.txt[]
75
76 add [options] [files ...]::
77 Schedule files to be version controlled and added to the repository.
78
79 The files will be added to the repository at the next commit.
80
81 If no names are given, add all files in the current directory and
82 its subdirectories.
83
84 addremove [options] [files ...]::
85 Add all new files and remove all missing files from the repository.
86
87 New files are ignored if they match any of the patterns in .hgignore. As
88 with add, these changes take effect at the next commit.
89
90 annotate [-r <rev> -u -n -c -d] [files ...]::
91 List changes in files, showing the revision id responsible for each line
92
93 This command is useful to discover who did a change or when a change took
94 place.
95
96 Without the -a option, annotate will avoid processing files it
97 detects as binary. With -a, annotate will generate an annotation
98 anyway, probably with undesirable results.
99
100 options:
101 -a, --text treat all files as text
102 -I, --include <pat> include names matching the given patterns
103 -X, --exclude <pat> exclude names matching the given patterns
104 -r, --revision <rev> annotate the specified revision
105 -u, --user list the author
106 -d, --date list the commit date
107 -c, --changeset list the changeset
108 -n, --number list the revision number (default)
109
110 bundle <file> <other>::
111 (EXPERIMENTAL)
112
113 Generate a compressed changegroup file collecting all changesets
114 not found in the other repository.
115
116 This file can then be transferred using conventional means and
117 applied to another repository with the unbundle command. This is
118 useful when native push and pull are not available or when
119 exporting an entire repository is undesirable. The standard file
120 extension is ".hg".
121
122 Unlike import/export, this exactly preserves all changeset
123 contents including permissions, rename data, and revision history.
124
125 cat [options] <file ...>::
126 Print the specified files as they were at the given revision.
127 If no revision is given then the tip is used.
128
129 Output may be to a file, in which case the name of the file is
130 given using a format string. The formatting rules are the same as
131 for the export command, with the following additions:
132
133 %s basename of file being printed
134 %d dirname of file being printed, or '.' if in repo root
135 %p root-relative path name of file being printed
136
137 options:
138 -I, --include <pat> include names matching the given patterns
139 -X, --exclude <pat> exclude names matching the given patterns
140 -o, --output <filespec> print output to file with formatted name
141 -r, --rev <rev> print the given revision
142
143 clone [options] <source> [dest]::
144 Create a copy of an existing repository in a new directory.
145
146 If no destination directory name is specified, it defaults to the
147 basename of the source.
148
149 The location of the source is added to the new repository's
150 .hg/hgrc file, as the default to be used for future pulls.
151
152 For efficiency, hardlinks are used for cloning whenever the source
153 and destination are on the same filesystem. Some filesystems,
154 such as AFS, implement hardlinking incorrectly, but do not report
155 errors. In these cases, use the --pull option to avoid
156 hardlinking.
157
158 See pull for valid source format details.
159
160 options:
161 -U, --noupdate do not update the new working directory
162 --pull use pull protocol to copy metadata
163 -e, --ssh specify ssh command to use
164 --remotecmd specify hg command to run on the remote side
165
166 commit [options] [files...]::
167 Commit changes to the given files into the repository.
168
169 If a list of files is omitted, all changes reported by "hg status"
170 from the root of the repository will be commited.
171
172 The HGEDITOR or EDITOR environment variables are used to start an
173 editor to add a commit comment.
174
175 Options:
176
177 -A, --addremove run addremove during commit
178 -I, --include <pat> include names matching the given patterns
179 -X, --exclude <pat> exclude names matching the given patterns
180 -m, --message <text> use <text> as commit message
181 -l, --logfile <file> read the commit message from <file>
182 -d, --date <datecode> record datecode as commit date
183 -u, --user <user> record user as commiter
184
185 aliases: ci
186
187 copy <source ...> <dest>::
188 Mark dest as having copies of source files. If dest is a
189 directory, copies are put in that directory. If dest is a file,
190 there can only be one source.
191
192 By default, this command copies the contents of files as they
193 stand in the working directory. If invoked with --after, the
194 operation is recorded, but no copying is performed.
195
196 This command takes effect in the next commit.
197
198 NOTE: This command should be treated as experimental. While it
199 should properly record copied files, this information is not yet
200 fully used by merge, nor fully reported by log.
201
202 Options:
203 -A, --after record a copy that has already occurred
204 -I, --include <pat> include names matching the given patterns
205 -X, --exclude <pat> exclude names matching the given patterns
206 -f, --force forcibly copy over an existing managed file
207
208 aliases: cp
209
210 diff [-a] [-r revision] [-r revision] [files ...]::
211 Show differences between revisions for the specified files.
212
213 Differences between files are shown using the unified diff format.
214
215 When two revision arguments are given, then changes are shown
216 between those revisions. If only one revision is specified then
217 that revision is compared to the working directory, and, when no
218 revisions are specified, the working directory files are compared
219 to its parent.
220
221 Without the -a option, diff will avoid generating diffs of files
222 it detects as binary. With -a, diff will generate a diff anyway,
223 probably with undesirable results.
224
225 options:
226 -a, --text treat all files as text
227 -I, --include <pat> include names matching the given patterns
228 -p, --show-function show which function each change is in
229 -X, --exclude <pat> exclude names matching the given patterns
230 -w, --ignore-all-space ignore white space when comparing lines
231
232 export [-o filespec] [revision] ...::
233 Print the changeset header and diffs for one or more revisions.
234
235 The information shown in the changeset header is: author,
236 changeset hash, parent and commit comment.
237
238 Output may be to a file, in which case the name of the file is
239 given using a format string. The formatting rules are as follows:
240
241 %% literal "%" character
242 %H changeset hash (40 bytes of hexadecimal)
243 %N number of patches being generated
244 %R changeset revision number
245 %b basename of the exporting repository
246 %h short-form changeset hash (12 bytes of hexadecimal)
247 %n zero-padded sequence number, starting at 1
248 %r zero-padded changeset revision number
249
250 Without the -a option, export will avoid generating diffs of files
251 it detects as binary. With -a, export will generate a diff anyway,
252 probably with undesirable results.
253
254 options:
255 -a, --text treat all files as text
256 -o, --output <filespec> print output to file with formatted name
257
258 forget [options] [files]::
259 Undo an 'hg add' scheduled for the next commit.
260
261 options:
262 -I, --include <pat> include names matching the given patterns
263 -X, --exclude <pat> exclude names matching the given patterns
264
265 grep [options] pattern [files]::
266 Search revisions of files for a regular expression.
267
268 This command behaves differently than Unix grep. It only accepts
269 Python/Perl regexps. It searches repository history, not the
270 working directory. It always prints the revision number in which
271 a match appears.
272
273 By default, grep only prints output for the first revision of a
274 file in which it finds a match. To get it to print every revision
275 that contains a change in match status ("-" for a match that
276 becomes a non-match, or "+" for a non-match that becomes a match),
277 use the --all flag.
278
279 options:
280 -0, --print0 end fields with NUL
281 -I, --include <pat> include names matching the given patterns
282 -X, --exclude <pat> exclude names matching the given patterns
283 --all print all revisions that match
284 -i, --ignore-case ignore case when matching
285 -l, --files-with-matches print only filenames and revs that match
286 -n, --line-number print matching line numbers
287 -r <rev>, --rev <rev> search in given revision range
288 -u, --user print user who committed change
289
290 heads::
291 Show all repository head changesets.
292
293 Repository "heads" are changesets that don't have children
294 changesets. They are where development generally takes place and
295 are the usual targets for update and merge operations.
296
297 identify::
298 Print a short summary of the current state of the repo.
299
300 This summary identifies the repository state using one or two parent
301 hash identifiers, followed by a "+" if there are uncommitted changes
302 in the working directory, followed by a list of tags for this revision.
303
304 aliases: id
305
306 import [-p <n> -b <base> -f] <patches>::
307 Import a list of patches and commit them individually.
308
309 If there are outstanding changes in the working directory, import
310 will abort unless given the -f flag.
311
312 If a patch looks like a mail message (its first line starts with
313 "From " or looks like an RFC822 header), it will not be applied
314 unless the -f option is used. The importer neither parses nor
315 discards mail headers, so use -f only to override the "mailness"
316 safety check, not to import a real mail message.
317
318 options:
319 -p, --strip <n> directory strip option for patch. This has the same
320 meaning as the corresponding patch option
321 -b <path> base directory to read patches from
322 -f, --force skip check for outstanding uncommitted changes
323
324 aliases: patch
325
326 incoming [-p] [source]::
327 Show new changesets found in the specified repo or the default
328 pull repo. These are the changesets that would be pulled if a pull
329 was requested.
330
331 Currently only local repositories are supported.
332
333 options:
334 -p, --patch show patch
335
336 aliases: in
337
338 init [dest]::
339 Initialize a new repository in the given directory. If the given
340 directory does not exist, it is created.
341
342 If no directory is given, the current directory is used.
343
344 locate [options] [files]::
345 Print all files under Mercurial control whose names match the
346 given patterns.
347
348 This command searches the current directory and its
349 subdirectories. To search an entire repository, move to the root
350 of the repository.
351
352 If no patterns are given to match, this command prints all file
353 names.
354
355 If you want to feed the output of this command into the "xargs"
356 command, use the "-0" option to both this command and "xargs".
357 This will avoid the problem of "xargs" treating single filenames
358 that contain white space as multiple filenames.
359
360 options:
361
362 -0, --print0 end filenames with NUL, for use with xargs
363 -f, --fullpath print complete paths from the filesystem root
364 -I, --include <pat> include names matching the given patterns
365 -r, --rev <rev> search the repository as it stood at rev
366 -X, --exclude <pat> exclude names matching the given patterns
367
368 log [-r revision ...] [-p] [files]::
369 Print the revision history of the specified files or the entire project.
370
371 By default this command outputs: changeset id and hash, tags,
372 parents, user, date and time, and a summary for each commit. The
373 -v switch adds some more detail, such as changed files, manifest
374 hashes or message signatures.
375
376 options:
377 -I, --include <pat> include names matching the given patterns
378 -X, --exclude <pat> exclude names matching the given patterns
379 -r, --rev <A> show the specified revision or range
380 -p, --patch show patch
381
382 aliases: history
383
384 manifest [revision]::
385 Print a list of version controlled files for the given revision.
386
387 The manifest is the list of files being version controlled. If no revision
388 is given then the tip is used.
389
390 outgoing [-p] [dest]::
391 Show changesets not found in the specified destination repo or the
392 default push repo. These are the changesets that would be pushed
393 if a push was requested.
394
395 See pull for valid source format details.
396
397 options:
398 -p, --patch show patch
399
400 aliases: out
401
402 parents::
403 Print the working directory's parent revisions.
404
405 paths [NAME]::
406 Show definition of symbolic path name NAME. If no name is given, show
407 definition of available names.
408
409 Path names are defined in the [paths] section of /etc/mercurial/hgrc
410 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
411
412 pull <repository path>::
413 Pull changes from a remote repository to a local one.
414
415 This finds all changes from the repository at the specified path
416 or URL and adds them to the local repository. By default, this
417 does not update the copy of the project in the working directory.
418
419 Valid URLs are of the form:
420
421 local/filesystem/path
422 http://[user@]host[:port][/path]
423 https://[user@]host[:port][/path]
424 ssh://[user@]host[:port][/path]
425
426 SSH requires an accessible shell account on the destination machine
427 and a copy of hg in the remote path. With SSH, paths are relative
428 to the remote user's home directory by default; use two slashes at
429 the start of a path to specify it as relative to the filesystem root.
430
431 options:
432 -u, --update update the working directory to tip after pull
433 -e, --ssh specify ssh command to use
434 --remotecmd specify hg command to run on the remote side
435
436 push <destination>::
437 Push changes from the local repository to the given destination.
438
439 This is the symmetrical operation for pull. It helps to move
440 changes from the current repository to a different one. If the
441 destination is local this is identical to a pull in that directory
442 from the current one.
443
444 By default, push will refuse to run if it detects the result would
445 increase the number of remote heads. This generally indicates the
446 the client has forgotten to sync and merge before pushing.
447
448 Valid URLs are of the form:
449
450 local/filesystem/path
451 ssh://[user@]host[:port][/path]
452
453 SSH requires an accessible shell account on the destination
454 machine and a copy of hg in the remote path.
455
456 options:
457
458 -f, --force force update
459 -e, --ssh specify ssh command to use
460 --remotecmd specify hg command to run on the remote side
461
462 rawcommit [-p -d -u -F -m -l]::
463 Lowlevel commit, for use in helper scripts. (DEPRECATED)
464
465 This command is not intended to be used by normal users, as it is
466 primarily useful for importing from other SCMs.
467
468 This command is now deprecated and will be removed in a future
469 release, please use debugsetparents and commit instead.
470
471 recover::
472 Recover from an interrupted commit or pull.
473
474 This command tries to fix the repository status after an interrupted
475 operation. It should only be necessary when Mercurial suggests it.
476
477 remove [options] [files ...]::
478 Schedule the indicated files for removal from the repository.
479
480 This command schedules the files to be removed at the next commit.
481 This only removes files from the current branch, not from the
482 entire project history. If the files still exist in the working
483 directory, they will be deleted from it.
484
485 aliases: rm
486
487 rename <source ...> <dest>::
488 Mark dest as copies of sources; mark sources for deletion. If
489 dest is a directory, copies are put in that directory. If dest is
490 a file, there can only be one source.
491
492 By default, this command copies the contents of files as they
493 stand in the working directory. If invoked with --after, the
494 operation is recorded, but no copying is performed.
495
496 This command takes effect in the next commit.
497
498 NOTE: This command should be treated as experimental. While it
499 should properly record rename files, this information is not yet
500 fully used by merge, nor fully reported by log.
501
502 Options:
503 -A, --after record a rename that has already occurred
504 -f, --force forcibly copy over an existing managed file
505
506 aliases: mv
507
508 revert [names ...]::
509 The revert command has two modes of operation.
510
511 In its default mode, it reverts any uncommitted modifications made
512 to the named files or directories. This restores the contents of
513 the affected files to an unmodified state.
514
515 Using the -r option, it reverts the given files or directories to
516 their state as of an earlier revision. This can be helpful to "roll
517 back" some or all of a change that should not have been committed.
518
519 Revert modifies the working directory. It does not commit any
520 changes, or change the parent of the current working directory.
521
522 If a file has been deleted, it is recreated. If the executable
523 mode of a file was changed, it is reset.
524
525 If a directory is given, all files in that directory and its
526 subdirectories are reverted.
527
528 If no arguments are given, all files in the current directory and
529 its subdirectories are reverted.
530
531 options:
532 -r, --rev <rev> revision to revert to
533 -n, --nonrecursive do not recurse into subdirectories
534
535 root::
536 Print the root directory of the current repository.
537
538 serve [options]::
539 Start a local HTTP repository browser and pull server.
540
541 By default, the server logs accesses to stdout and errors to
542 stderr. Use the "-A" and "-E" options to log to files.
543
544 options:
545 -A, --accesslog <file> name of access log file to write to
546 -E, --errorlog <file> name of error log file to write to
547 -a, --address <addr> address to use
548 -p, --port <n> port to use (default: 8000)
549 -n, --name <name> name to show in web pages (default: working dir)
550 -t, --templatedir <path> web templates to use
551 -6, --ipv6 use IPv6 in addition to IPv4
552
553 status [options] [files]::
554 Show changed files in the working directory. If no names are
555 given, all files are shown. Otherwise, only files matching the
556 given names are shown.
557
558 The codes used to show the status of files are:
559
560 M = changed
561 A = added
562 R = removed
563 ? = not tracked
564
565 options:
566
567 -m, --modified show only modified files
568 -a, --added show only added files
569 -r, --removed show only removed files
570 -u, --unknown show only unknown (not tracked) files
571 -n, --no-status hide status prefix
572 -0, --print0 end filenames with NUL, for use with xargs
573 -I, --include <pat> include names matching the given patterns
574 -X, --exclude <pat> exclude names matching the given patterns
575
576 tag [-l -m <text> -d <datecode> -u <user>] <name> [revision]::
577 Name a particular revision using <name>.
578
579 Tags are used to name particular revisions of the repository and are
580 very useful to compare different revision, to go back to significant
581 earlier versions or to mark branch points as releases, etc.
582
583 If no revision is given, the tip is used.
584
585 To facilitate version control, distribution, and merging of tags,
586 they are stored as a file named ".hgtags" which is managed
587 similarly to other project files and can be hand-edited if
588 necessary.
589
590 options:
591 -l, --local make the tag local
592 -m, --message <text> message for tag commit log entry
593 -d, --date <datecode> datecode for commit
594 -u, --user <user> user for commit
595
596 Note: Local tags are not version-controlled or distributed and are
597 stored in the .hg/localtags file. If there exists a local tag and
598 a public tag with the same name, local tag is used.
599
600 tags::
601 List the repository tags.
602
603 This lists both regular and local tags.
604
605 tip [-p]::
606 Show the tip revision.
607
608 options:
609 -p, --patch show patch
610
611 unbundle <file>::
612 (EXPERIMENTAL)
613
614 Apply a compressed changegroup file generated by the bundle
615 command.
616
617 undo::
618 Undo the last commit or pull transaction.
619
620 Roll back the last pull or commit transaction on the
621 repository, restoring the project to its earlier state.
622
623 This command should be used with care. There is only one level of
624 undo and there is no redo.
625
626 This command is not intended for use on public repositories. Once
627 a change is visible for pull by other users, undoing it locally is
628 ineffective.
629
630 update [-m -C] [revision]::
631 Update the working directory to the specified revision.
632
633 By default, update will refuse to run if doing so would require
634 merging or discarding local changes.
635
636 With the -m option, a merge will be performed.
637
638 With the -C option, local changes will be lost.
639
640 options:
641 -m, --merge allow merging of branches
642 -C, --clean overwrite locally modified files
643
644 aliases: up checkout co
645
646 verify::
647 Verify the integrity of the current repository.
648
649 This will perform an extensive check of the repository's
650 integrity, validating the hashes and checksums of each entry in
651 the changelog, manifest, and tracked files, as well as the
652 integrity of their crosslinks and indices.
653 39
654 FILE NAME PATTERNS 40 FILE NAME PATTERNS
655 ------------------ 41 ------------------
656 42
657 Mercurial accepts several notations for identifying one or more 43 Mercurial accepts several notations for identifying one or more