##// END OF EJS Templates
[PATCH] doc cleanups...
mpm@selenic.com -
r497:2dcced38 default
parent child Browse files
Show More
@@ -1,381 +1,454 b''
1 HG(1)
1 HG(1)
2 =====
2 =====
3 Matt Mackall <mpm@selenic.com>
3 Matt Mackall <mpm@selenic.com>
4 v0.6, 24 Jun 2005
4 v0.6, 24 Jun 2005
5
5
6 NAME
6 NAME
7 ----
7 ----
8 hg - Mercurial source code management system
8 hg - Mercurial source code management system
9
9
10 SYNOPSIS
10 SYNOPSIS
11 --------
11 --------
12 'hg' [-v -d -q -y] <command> [command options] [files]
12 'hg' [-v -d -q -y] <command> [command options] [files]
13
13
14 DESCRIPTION
14 DESCRIPTION
15 -----------
15 -----------
16 The hg(1) command provides a command line interface to the Mercurial system.
16 The hg(1) command provides a command line interface to the Mercurial system.
17
17
18 OPTIONS
18 OPTIONS
19 -------
19 -------
20
20
21 --debug, -d::
21 --debug, -d::
22 enable debugging output
22 enable debugging output
23
23
24 --quiet, -q::
24 --quiet, -q::
25 suppress output
25 suppress output
26
26
27 --verbose, -v::
27 --verbose, -v::
28 enable additional output
28 enable additional output
29
29
30 --noninteractive, -y::
30 --noninteractive, -y::
31 do not prompt, assume 'yes' for any required answers
31 do not prompt, assume 'yes' for any required answers
32
32
33 COMMAND ELEMENTS
33 COMMAND ELEMENTS
34 ----------------
34 ----------------
35
35
36 files ...::
36 files ...::
37 indicates one or more filename or relative path filenames
37 indicates one or more filename or relative path filenames
38
38
39 path::
39 path::
40 indicates a path on the local machine
40 indicates a path on the local machine
41
41
42 revision::
42 revision::
43 indicates a changeset which can be specified as a changeset revision
43 indicates a changeset which can be specified as a changeset revision
44 number, a tag, or a unique substring of the changeset hash value
44 number, a tag, or a unique substring of the changeset hash value
45
45
46 repository path::
46 repository path::
47 is either the pathname of a local repository of the URI of a remote
47 is either the pathname of a local repository of the URI of a remote
48 repository. There are two available URI protocols, http:// which is
48 repository. There are two available URI protocols, http:// which is
49 fast and the old-http:// protocol which is much slower but does not
49 fast and the old-http:// protocol which is much slower but does not
50 require a special server on the web host.
50 require a special server on the web host.
51
51
52 COMMANDS
52 COMMANDS
53 --------
53 --------
54
54
55 add [files ...]::
55 add [files ...]::
56 Add the given files to the repository. Note that this just schedules the
56 Schedule files to be version controlled and added to the repository.
57 files for addition at the next hg commit time.
57
58 The files get effectively added to the repository at the next commit.
58
59
59 addremove::
60 addremove::
60 Add all new files and remove all missing files from the repository. New
61 Add all new files and remove all missing files from the repository.
61 files are ignored if they match any of the patterns in .hgignore
62
63 New files are ignored if they match any of the patterns in .hgignore. As
64 with add, the effects of this command take place at the next commit.
62
65
63 annotate [-r <rev> -u -n -c] [files ...]::
66 annotate [-r <rev> -u -n -c] [files ...]::
64 List the files with each line showing the revision id responsible
67 List changes in files, showing the revision id responsible for each line
65 for that line.
68
66
69 This command is useful to discover who did a change or when a change took
70 place.
71
67 options:
72 options:
68 -r, --revision <rev> annotate the specified revision
73 -r, --revision <rev> annotate the specified revision
69 -u, --user list the author
74 -u, --user list the author
70 -c, --changeset list the changeset
75 -c, --changeset list the changeset
71 -n, --number list the revision number (default)
76 -n, --number list the revision number (default)
72
77
73 cat <file> [revision]::
78 cat <file> [revision]::
74 Output the given revision or tip of the specified file to stdout.
79 Output to stdout the given revision for the specified file.
80
81 In case no revision is given, then the tip is used.
75
82
76 clone [-U] <source> [dest]::
83 clone [-U] <source> [dest]::
77 Create a new copy of an existing repository.
84 Create a copy of an existing repository in a new directory.
85
86 If the destination directory is specified, but doesn't exist, it is
87 created. If no destination directory is specified, it defaults to the
88 current directory.
89
90 The source is added to the new copy's .hg/hgrc file to be used in
91 future pulls.
92
93 For speed and storage size, hardlinks are used to do the copy whenever
94 the specified source and destination are on the same filesystem.
95
96 options:
97 -U, --no-update do not update the new working directory
98
99 commit [-A -t -l <file> -t <text> -u <user> -d <datecode>] [files...]::
100 Incorporate changes from given files into the repository.
101
102 If a list of files is ommited, all of the working dir files will
103 be commited.
104
105 The EDITOR environment variable is used to bring up an editor to add
106 a commit comment.
107
108 Options:
109
110 -A, --addremove run addremove during commit
111 -t, --text <text> use <text> as commit message
112 -l, --logfile <file> show the commit message for the given file
113 -d, --date <datecode> record datecode as commit date
114 -u, --user <user> record user as commiter
115
116 aliases: ci
117
118 copy <source> <dest>::
119 Mark <dest> file as a copy or rename of a <source> one
120
121 This command takes effect for the next commit.
122
123 diff [-r revision] [-r revision] [files ...]::
124 Show differences between revisions for the specified files.
125
126 Differences between files are shown using the unified diff format.
127
128 When two revision arguments are given, then changes are shown between
129 such revisions. If only one revision is specified then that revision is
130 compared to the tip, and, when no revisions are specified, the working
131 directory files are compared to the tip.
132
133 export [revision]::
134 Print the changeset header and diffs for a particular revision.
135
136 The information shown in the changeset header is: author, changeset hash,
137 parent and commit comment.
138
139 forget [files]::
140 Undo an 'hg add' scheduled for the next commit.
141
142 heads::
143 Show all repository head changesets.
144
145 Repository "heads" are changesets that don't have children changesets.
146 They are where development generally takes place and are the usual targets
147 for update and merge operations.
148
149 history::
150 Print a log of the revision history of the repository.
151
152 By default this command outputs: changeset id and hash, tags, parents,
153 user, date and time, and a summary for each commit.
154 The -v switch adds some more detail, such as changed files, manifest
155 hashes or message signatures.
156
157 To display the history of a given file, see the log command.
158
159 identify::
160 Print a short summary of the current state of the repo.
161
162 This summary identifies the repository state using one or two parent
163 hash identifiers, followed by a "+" if there are uncommitted changes
164 in the working directory, followed by a list of tags for this revision.
165
166 aliases: id
167
168 import [-p <n> -b <base> -q] <patches>::
169 Import a list of patches and commit them individually.
170
171 options:
172 -p, --strip <n> directory strip option for patch. This has the same
173 meaning as the correnponding patch option
174 -b <path> base directory to read patches from
175
176 aliases: patch
177
78
178
79 If the specified source is on the same filesystem, the repository
179 If the specified source is on the same filesystem, the repository
80 will be copied via hardlinks. This is the fastest and most
180 will be copied via hardlinks. This is the fastest and most
81 space-efficient mode of operation.
181 space-efficient mode of operation.
82
182
83 If the destination directory is not specified, it defaults to the
183 If the destination directory is not specified, it defaults to the
84 current directory.
184 current directory.
85
185
86 If the destination is specified, but does not exist, it is created.
186 If the destination is specified, but does not exist, it is created.
87
187
88 The source is added to .hg/hgrc in the new copy as the default for
188 The source is added to .hg/hgrc in the new copy as the default for
89 future pulls.
189 future pulls.
90
190
91 options:
191 options:
92 -U, --no-update do not update the new working directory
192 -U, --no-update do not update the new working directory
93
193
94 commit [-A -t -l <file> -t <text> -u <user> -d <datecode>] [files...]::
95 Commit all changed files in the working dir to the repository. This uses
96 the EDITOR environment variable to bring up an editor to add a commit
97 comment.
98
99 Options:
100
101 -A, --addremove run addremove during commit
102 -t, --text <text> use <text> as commit message
103 -l, --logfile <file> read the commit message from the specified
104 file
105 -d, --date <datecode> use the specified date code
106 -u, --user <user> record commit as the specified user
107
108 aliases: ci
109
110 copy <source> <dest>::
111 Mark a file as copied or renamed for the next commit.
112
113 diff [-r revision] [-r revision] [files ...]::
114 Generate a unified diff of the indicated files. If there are no
115 revisions specified, the working directory file is compared to
116 the tip, one revision specified indicates a comparison between the
117 working directory file and the specified revision, and two revisions
118 compares the two versions specified.
119
120 export [revision]::
121 Print the changeset header (author, changeset hash, parent, and commit
122 comment) and the diffs for a particular revision.
123
124 forget [files]::
125 Undo an 'hg add' scheduled for the next commit.
126
127 heads::
128 Show all changesets with no children. These are the "heads" of
129 development branches and are the usual targets for updates and merges.
130
131 history::
132 Print the revision history of the repository. Use the -v switch
133 for more detail.
134
135 identify::
136 Print a short identifier of the current state of the repo. This
137 includes one or two parent hash identifiers, followed by
138 a "+" if there are uncommitted changes in the working directory,
139 followed by a list of tags for this revision.
140
141 aliases: id
142
143 import [-p <n> -b <base> -q] <patches>::
144 Import the listed patches and commit them individually.
145
146 options:
147 -p, --strip <n> directory strip option for patch
148 -b <path> base directory to read patches from
149
150 aliases: patch
151
152 init::
194 init::
153 Initialize a new repository in the current directory.
195 Initialize a new repository in the current directory.
154
196
155 log <file>::
197 log <file>::
156 Print the revision history of the specified file.
198 Print the revision history of the specified file.
157
199
200 To display the revision history for the whole repository, use the history
201 command.
202
158 manifest [revision]::
203 manifest [revision]::
159 Print the indicated revision of the manifest (list of version controlled
204 Print a list of version controlled files for the given revision.
160 files).
205
206 The manifest is the list of files being version controlled. If no revision
207 is given then the tip is used.
161
208
162 parents::
209 parents::
163 Print the working directory's parent revisions.
210 Print the working directory's parent revisions.
164
211
165 pull <repository path>::
212 pull <repository path>::
166 Pull any changes from the specified repository to the repository in the
213 Pull any changes from a repository to the current directory's one.
167 current directory.
214
215 Pulling is a fundamental operation in a distributed version control system,
216 as it eases handling changes from different branches, both local and
217 remote, into the current repository.
168
218
169 options:
219 options:
170 -u, --update update the working directory to tip after pull
220 -u, --update update the working directory to tip after pull
171
221
172 push <destination>::
222 push <destination>::
173 Push changes from the local repository to the specified
223 Push changes from the local repository to the given destination.
174 destination. If the destination is local, this is identical to a
224
175 a pull in that directory from the current directory.
225 This is the symmetrical operation for pull. It helps to move changes from
226 the current repository to a different one. If the destination is local
227 this is identical to a pull in that directory from the current one.
176
228
177 The other currently available push method is SSH. This requires an
229 The other currently available push method is SSH. This requires an
178 accessible shell account on the destination machine and a copy of
230 accessible shell account on the destination machine and a copy of
179 hg in the remote path. Destinations are specified in the following
231 hg in the remote path. Destinations are specified in the following
180 form:
232 form:
181
233
182 ssh://[user@]host[:port]/path
234 ssh://[user@]host[:port]/path
183
235
184 rawcommit [-p -d -u -F -t -l]::
236 rawcommit [-p -d -u -F -t -l]::
185 Primarily useful for importing from other SCMs.
237 Lowlevel commit, for use in helper scripts.
238
239 This command is not intended to be used by normal users, as it is
240 primarily useful for importing from other SCMs.
186
241
187 recover::
242 recover::
188 Recover from an interrupted commit or pull. This should only be
243 Recover from an interrupted commit or pull.
189 necessary when Mercurial suggests it.
244
245 This command tries to fix the repository status after an interrupted
246 operation. It should only be necessary when Mercurial suggests it.
190
247
191 remove [files ...]::
248 remove [files ...]::
192 Schedule the indicated files for removal from the repository at the next
249 Schedule the indicated files for removal from the repository.
193 commit.
250
251 This command shedules the files to be removed, but the actual removing
252 takes place at the next commit.
194
253
195 aliases: rm
254 aliases: rm
196
255
197 root::
256 root::
198 Print the root directory of the current repository.
257 Print the root directory of the current repository.
199
258
200 serve [-a addr -n name -p port -t templatedir]::
259 serve [-a addr -n name -p port -t templatedir]::
201 Start a local HTTP repository browser and pull server.
260 Start a local HTTP repository browser and pull server.
202
261
203 options:
262 options:
204 -a, --address <addr> address to use
263 -a, --address <addr> address to use
205 -p, --port <n> port to use (default: 8000)
264 -p, --port <n> port to use (default: 8000)
206 -n, --name <name> name to show in web pages (default: working dir)
265 -n, --name <name> name to show in web pages (default: working dir)
207 -t, --templatedir <path> web templates to use
266 -t, --templatedir <path> web templates to use
208
267
209 status::
268 status::
210 Show changed files in the working directory.
269 Show changed files in the working directory.
211
270
271 The codes used to show the status of files are:
272
212 C = changed
273 C = changed
213 A = added
274 A = added
214 R = removed
275 R = removed
215 ? = not tracked
276 ? = not tracked
216
277
217 tag [-t <text> -d <datecode> -u <user>] <name> [revision]::
278 tag [-t <text> -d <datecode> -u <user>] <name> [revision]::
218 Add a tag <name> to the specified revision or the tip.
279 Name a particular revision using <name>.
280
281 Tags are used to name particular revisions of the repository and are
282 very useful to compare different revision, to go back to significant
283 earlier versions or to set special branch points, as releases, etc.
284
285 If no revision is given as argument the tip is used.
219
286
287 This tags are versioned, and kept along with the repository metadata. But
288 Mercurial has support for other type of tags that can be used locally for
289 convenience and that are created adding lines with a changeset hash value
290 and a name or names to name the revision in a .hgtags file
291
220 options:
292 options:
221 -t, --text <text> message for tag commit log entry
293 -t, --text <text> message for tag commit log entry
222 -d, --date <datecode> datecode for commit
294 -d, --date <datecode> datecode for commit
223 -u, --user <user> user for commit
295 -u, --user <user> user for commit
224
296
225 tags::
297 tags::
226 List the repository tags.
298 List the repository tags.
227
299
300 Local tags in the .hgtags don't get listed when using this command.
301
228 tip::
302 tip::
229 Show the tip revision.
303 Show the tip revision.
230
304
231 undo::
305 undo::
232 Undo the last commit or pull transaction.
306 Undo the last commit or pull transaction.
233
307
234 update [-m -C] [revision]::
308 update [-m -C] [revision]::
235 Update or merge the working directory to a specified revision.
309 Bring the working directory to the state of a given revision.
236
237 If there are no outstanding changes in the working directory and
238 there is a linear relationship between the current version and the
239 requested version, the result is the requested version.
240
310
241 Otherwise the result is a merge between the contents of the
311 After running this command the current directory will have the contents
242 current working directory and the requested version. Files that
312 of the specified revision.
243 changed between either parent are marked as changed for the next
313
244 commit and a commit must be performed before any further updates
314 If there were outstanding changes in the current directory and a merge
245 are allowed. Merging will not be performed without the -m flag.
315 would be needed, the -m option can be used to merge those changes with
246
316 the target revision. Without the -m or --merge option, no merge
247 The -C switch will tell Mercurial to forcibly update to the
317 will happen.
248 specified version, adding, removing, and overwriting locally
318
249 changed fils as necessary.
319 The -C or --clean option must be used in case a pristine version is
250
320 desired. In this case, existing changes will be discarded and lost. If
321 these changes should be kept, then a commit prior updating, or a merge
322 is due.
323
251 options:
324 options:
252 -m, --merge allow merging of branches
325 -m, --merge allow merging of branches
253 -C, --clean overwrite locally modified files
326 -C, --clean overwrite locally modified files
254
327
255 aliases: up checkout co
328 aliases: up checkout co
256
329
257 verify::
330 verify::
258 Verify the integrity of the current repository.
331 Verify the integrity of the current repository.
259
332
260 This will perform an extensive check of the repository's
333 This will perform an extensive check of the repository's
261 integrity, validating the hashes and checksums of each entry in
334 integrity, validating the hashes and checksums of each entry in
262 the changelog, manifest, and tracked files, as well as the
335 the changelog, manifest, and tracked files, as well as the
263 integrity of their crosslinks and indices.
336 integrity of their crosslinks and indices.
264
337
265
338
266 ENVIRONMENT VARIABLES
339 ENVIRONMENT VARIABLES
267 ---------------------
340 ---------------------
268
341
269 HGEDITOR::
342 HGEDITOR::
270 This is the name of the editor to use when committing. Defaults to the
343 This is the name of the editor to use when committing. Defaults to the
271 value of EDITOR.
344 value of EDITOR.
272
345
273 HGMERGE::
346 HGMERGE::
274 An executable to use for resolving merge conflicts. The program ,
347 An executable to use for resolving merge conflicts. The program ,
275 will be executed with three arguments: local file, remote file,
348 will be executed with three arguments: local file, remote file,
276 ancestor file.
349 ancestor file.
277
350
278 The default program is "hgmerge", which is a shell script provided
351 The default program is "hgmerge", which is a shell script provided
279 by Mercurial with some sensible defaults.
352 by Mercurial with some sensible defaults.
280
353
281 HGUSER::
354 HGUSER::
282 This is the string used for the author of a commit.
355 This is the string used for the author of a commit.
283
356
284 EMAIL::
357 EMAIL::
285 If HGUSER is not set, this will be used as the author for a commit.
358 If HGUSER is not set, this will be used as the author for a commit.
286
359
287 LOGNAME::
360 LOGNAME::
288 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
361 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
289 '@hostname' appended) as the author value for a commit.
362 '@hostname' appended) as the author value for a commit.
290
363
291 EDITOR::
364 EDITOR::
292 This is the name of the editor used in the hgmerge script. It will be
365 This is the name of the editor used in the hgmerge script. It will be
293 used for commit messages, too, if HGEDITOR isn't set. Defaults to 'vi'.
366 used for commit messages, too, if HGEDITOR isn't set. Defaults to 'vi'.
294
367
295 PYTHONPATH::
368 PYTHONPATH::
296 This is used by Python to find imported modules and may need to be set
369 This is used by Python to find imported modules and may need to be set
297 appropriately if Mercurial is not installed system-wide.
370 appropriately if Mercurial is not installed system-wide.
298
371
299 FILES
372 FILES
300 -----
373 -----
301 .hgignore::
374 .hgignore::
302 This file contains regular expressions (one per line) that describe file
375 This file contains regular expressions (one per line) that describe file
303 names that should be ignored by hg.
376 names that should be ignored by hg.
304
377
305 .hgtags::
378 .hgtags::
306 This file contains changeset hash values and text tag names (one of each
379 This file contains changeset hash values and text tag names (one of each
307 seperated by spaces) that correspond to tagged versions of the repository
380 seperated by spaces) that correspond to tagged versions of the repository
308 contents.
381 contents.
309
382
310 $HOME/.hgrc, .hg/hgrc::
383 $HOME/.hgrc, .hg/hgrc::
311 This file contains defaults and configuration. Values in .hg/hgrc
384 This file contains defaults and configuration. Values in .hg/hgrc
312 override those in .hgrc.
385 override those in .hgrc.
313
386
314 NAMED REPOSITORIES
387 NAMED REPOSITORIES
315 ------------------
388 ------------------
316
389
317 To give symbolic names to a repository, create a section in .hgrc
390 To give symbolic names to a repository, create a section in .hgrc
318 or .hg/hgrc containing assignments of names to paths. Example:
391 or .hg/hgrc containing assignments of names to paths. Example:
319
392
320 -----------------
393 -----------------
321 [paths]
394 [paths]
322 hg = http://selenic.com/hg
395 hg = http://selenic.com/hg
323 tah = http://hg.intevation.org/mercurial-tah/
396 tah = http://hg.intevation.org/mercurial-tah/
324 -----------------
397 -----------------
325
398
326
399
327 HOOKS
400 HOOKS
328 -----
401 -----
329
402
330 Mercurial supports a set of 'hook', commands that get automatically
403 Mercurial supports a set of 'hook', commands that get automatically
331 executed by various actions such as starting or finishing a commit. To
404 executed by various actions such as starting or finishing a commit. To
332 specify a hook, simply create an hgrc section like the following:
405 specify a hook, simply create an hgrc section like the following:
333
406
334 -----------------
407 -----------------
335 [hooks]
408 [hooks]
336 precommit = echo "this hook gets executed immediately before a commit"
409 precommit = echo "this hook gets executed immediately before a commit"
337 commit = hg export $NODE | mail -s "new commit $NODE" commit-list
410 commit = hg export $NODE | mail -s "new commit $NODE" commit-list
338 -----------------
411 -----------------
339
412
340
413
341 NON_TRANSPARENT PROXY SUPPORT
414 NON_TRANSPARENT PROXY SUPPORT
342 -----------------------------
415 -----------------------------
343
416
344 To access a Mercurial repository through a proxy, create a file
417 To access a Mercurial repository through a proxy, create a file
345 $HOME/.hgrc in the following format:
418 $HOME/.hgrc in the following format:
346
419
347 --------------
420 --------------
348 [http_proxy]
421 [http_proxy]
349 host=myproxy:8080
422 host=myproxy:8080
350 user=<username>
423 user=<username>
351 passwd=<password>
424 passwd=<password>
352 no=<localhost1>,<localhost2>,<localhost3>,...
425 no=<localhost1>,<localhost2>,<localhost3>,...
353 --------------
426 --------------
354
427
355 "user","passwd" fields are used for authenticating proxies, "no" is a
428 "user","passwd" fields are used for authenticating proxies, "no" is a
356 comma-separated list of local host names for which proxy must be
429 comma-separated list of local host names for which proxy must be
357 bypassed.
430 bypassed.
358
431
359
432
360 BUGS
433 BUGS
361 ----
434 ----
362 Probably lots, please post them to the mailing list (See Resources below)
435 Probably lots, please post them to the mailing list (See Resources below)
363 when you find them.
436 when you find them.
364
437
365 AUTHOR
438 AUTHOR
366 ------
439 ------
367 Written by Matt Mackall <mpm@selenic.com>
440 Written by Matt Mackall <mpm@selenic.com>
368
441
369 RESOURCES
442 RESOURCES
370 ---------
443 ---------
371 http://selenic.com/mercurial[Main Web Site]
444 http://selenic.com/mercurial[Main Web Site]
372
445
373 http://selenic.com/hg[Source code repository]
446 http://selenic.com/hg[Source code repository]
374
447
375 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
448 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
376
449
377 COPYING
450 COPYING
378 -------
451 -------
379 Copyright (C) 2005 Matt Mackall.
452 Copyright (C) 2005 Matt Mackall.
380 Free use of this software is granted under the terms of the GNU General
453 Free use of this software is granted under the terms of the GNU General
381 Public License (GPL).
454 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now