##// 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 1 HG(1)
2 2 =====
3 3 Matt Mackall <mpm@selenic.com>
4 4 v0.6, 24 Jun 2005
5 5
6 6 NAME
7 7 ----
8 8 hg - Mercurial source code management system
9 9
10 10 SYNOPSIS
11 11 --------
12 12 'hg' [-v -d -q -y] <command> [command options] [files]
13 13
14 14 DESCRIPTION
15 15 -----------
16 16 The hg(1) command provides a command line interface to the Mercurial system.
17 17
18 18 OPTIONS
19 19 -------
20 20
21 21 --debug, -d::
22 22 enable debugging output
23 23
24 24 --quiet, -q::
25 25 suppress output
26 26
27 27 --verbose, -v::
28 28 enable additional output
29 29
30 30 --noninteractive, -y::
31 31 do not prompt, assume 'yes' for any required answers
32 32
33 33 COMMAND ELEMENTS
34 34 ----------------
35 35
36 36 files ...::
37 37 indicates one or more filename or relative path filenames
38 38
39 39 path::
40 40 indicates a path on the local machine
41 41
42 42 revision::
43 43 indicates a changeset which can be specified as a changeset revision
44 44 number, a tag, or a unique substring of the changeset hash value
45 45
46 46 repository path::
47 47 is either the pathname of a local repository of the URI of a remote
48 48 repository. There are two available URI protocols, http:// which is
49 49 fast and the old-http:// protocol which is much slower but does not
50 50 require a special server on the web host.
51 51
52 52 COMMANDS
53 53 --------
54 54
55 55 add [files ...]::
56 Add the given files to the repository. Note that this just schedules the
57 files for addition at the next hg commit time.
56 Schedule files to be version controlled and added to the repository.
57
58 The files get effectively added to the repository at the next commit.
58 59
59 60 addremove::
60 Add all new files and remove all missing files from the repository. New
61 files are ignored if they match any of the patterns in .hgignore
61 Add all new files and remove all missing files from the repository.
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 66 annotate [-r <rev> -u -n -c] [files ...]::
64 List the files with each line showing the revision id responsible
65 for that line.
66
67 List changes in files, showing the revision id responsible for each line
68
69 This command is useful to discover who did a change or when a change took
70 place.
71
67 72 options:
68 73 -r, --revision <rev> annotate the specified revision
69 74 -u, --user list the author
70 75 -c, --changeset list the changeset
71 76 -n, --number list the revision number (default)
72 77
73 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 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 179 If the specified source is on the same filesystem, the repository
80 180 will be copied via hardlinks. This is the fastest and most
81 181 space-efficient mode of operation.
82 182
83 183 If the destination directory is not specified, it defaults to the
84 184 current directory.
85 185
86 186 If the destination is specified, but does not exist, it is created.
87 187
88 188 The source is added to .hg/hgrc in the new copy as the default for
89 189 future pulls.
90 190
91 191 options:
92 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 194 init::
153 195 Initialize a new repository in the current directory.
154 196
155 197 log <file>::
156 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 203 manifest [revision]::
159 Print the indicated revision of the manifest (list of version controlled
160 files).
204 Print a list of version controlled files for the given revision.
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 209 parents::
163 210 Print the working directory's parent revisions.
164 211
165 212 pull <repository path>::
166 Pull any changes from the specified repository to the repository in the
167 current directory.
213 Pull any changes from a repository to the current directory's one.
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 219 options:
170 220 -u, --update update the working directory to tip after pull
171 221
172 222 push <destination>::
173 Push changes from the local repository to the specified
174 destination. If the destination is local, this is identical to a
175 a pull in that directory from the current directory.
223 Push changes from the local repository to the given destination.
224
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 229 The other currently available push method is SSH. This requires an
178 230 accessible shell account on the destination machine and a copy of
179 231 hg in the remote path. Destinations are specified in the following
180 232 form:
181 233
182 234 ssh://[user@]host[:port]/path
183 235
184 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 242 recover::
188 Recover from an interrupted commit or pull. This should only be
189 necessary when Mercurial suggests it.
243 Recover from an interrupted commit or pull.
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 248 remove [files ...]::
192 Schedule the indicated files for removal from the repository at the next
193 commit.
249 Schedule the indicated files for removal from the repository.
250
251 This command shedules the files to be removed, but the actual removing
252 takes place at the next commit.
194 253
195 254 aliases: rm
196 255
197 256 root::
198 257 Print the root directory of the current repository.
199 258
200 259 serve [-a addr -n name -p port -t templatedir]::
201 260 Start a local HTTP repository browser and pull server.
202 261
203 262 options:
204 263 -a, --address <addr> address to use
205 264 -p, --port <n> port to use (default: 8000)
206 265 -n, --name <name> name to show in web pages (default: working dir)
207 266 -t, --templatedir <path> web templates to use
208 267
209 268 status::
210 269 Show changed files in the working directory.
211 270
271 The codes used to show the status of files are:
272
212 273 C = changed
213 274 A = added
214 275 R = removed
215 276 ? = not tracked
216 277
217 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 292 options:
221 293 -t, --text <text> message for tag commit log entry
222 294 -d, --date <datecode> datecode for commit
223 295 -u, --user <user> user for commit
224 296
225 297 tags::
226 298 List the repository tags.
227 299
300 Local tags in the .hgtags don't get listed when using this command.
301
228 302 tip::
229 303 Show the tip revision.
230 304
231 305 undo::
232 306 Undo the last commit or pull transaction.
233 307
234 308 update [-m -C] [revision]::
235 Update or merge the working directory to a specified 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.
309 Bring the working directory to the state of a given revision.
240 310
241 Otherwise the result is a merge between the contents of the
242 current working directory and the requested version. Files that
243 changed between either parent are marked as changed for the next
244 commit and a commit must be performed before any further updates
245 are allowed. Merging will not be performed without the -m flag.
246
247 The -C switch will tell Mercurial to forcibly update to the
248 specified version, adding, removing, and overwriting locally
249 changed fils as necessary.
250
311 After running this command the current directory will have the contents
312 of the specified revision.
313
314 If there were outstanding changes in the current directory and a merge
315 would be needed, the -m option can be used to merge those changes with
316 the target revision. Without the -m or --merge option, no merge
317 will happen.
318
319 The -C or --clean option must be used in case a pristine version is
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 324 options:
252 325 -m, --merge allow merging of branches
253 326 -C, --clean overwrite locally modified files
254 327
255 328 aliases: up checkout co
256 329
257 330 verify::
258 331 Verify the integrity of the current repository.
259 332
260 333 This will perform an extensive check of the repository's
261 334 integrity, validating the hashes and checksums of each entry in
262 335 the changelog, manifest, and tracked files, as well as the
263 336 integrity of their crosslinks and indices.
264 337
265 338
266 339 ENVIRONMENT VARIABLES
267 340 ---------------------
268 341
269 342 HGEDITOR::
270 343 This is the name of the editor to use when committing. Defaults to the
271 344 value of EDITOR.
272 345
273 346 HGMERGE::
274 347 An executable to use for resolving merge conflicts. The program ,
275 348 will be executed with three arguments: local file, remote file,
276 349 ancestor file.
277 350
278 351 The default program is "hgmerge", which is a shell script provided
279 352 by Mercurial with some sensible defaults.
280 353
281 354 HGUSER::
282 355 This is the string used for the author of a commit.
283 356
284 357 EMAIL::
285 358 If HGUSER is not set, this will be used as the author for a commit.
286 359
287 360 LOGNAME::
288 361 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
289 362 '@hostname' appended) as the author value for a commit.
290 363
291 364 EDITOR::
292 365 This is the name of the editor used in the hgmerge script. It will be
293 366 used for commit messages, too, if HGEDITOR isn't set. Defaults to 'vi'.
294 367
295 368 PYTHONPATH::
296 369 This is used by Python to find imported modules and may need to be set
297 370 appropriately if Mercurial is not installed system-wide.
298 371
299 372 FILES
300 373 -----
301 374 .hgignore::
302 375 This file contains regular expressions (one per line) that describe file
303 376 names that should be ignored by hg.
304 377
305 378 .hgtags::
306 379 This file contains changeset hash values and text tag names (one of each
307 380 seperated by spaces) that correspond to tagged versions of the repository
308 381 contents.
309 382
310 383 $HOME/.hgrc, .hg/hgrc::
311 384 This file contains defaults and configuration. Values in .hg/hgrc
312 385 override those in .hgrc.
313 386
314 387 NAMED REPOSITORIES
315 388 ------------------
316 389
317 390 To give symbolic names to a repository, create a section in .hgrc
318 391 or .hg/hgrc containing assignments of names to paths. Example:
319 392
320 393 -----------------
321 394 [paths]
322 395 hg = http://selenic.com/hg
323 396 tah = http://hg.intevation.org/mercurial-tah/
324 397 -----------------
325 398
326 399
327 400 HOOKS
328 401 -----
329 402
330 403 Mercurial supports a set of 'hook', commands that get automatically
331 404 executed by various actions such as starting or finishing a commit. To
332 405 specify a hook, simply create an hgrc section like the following:
333 406
334 407 -----------------
335 408 [hooks]
336 409 precommit = echo "this hook gets executed immediately before a commit"
337 410 commit = hg export $NODE | mail -s "new commit $NODE" commit-list
338 411 -----------------
339 412
340 413
341 414 NON_TRANSPARENT PROXY SUPPORT
342 415 -----------------------------
343 416
344 417 To access a Mercurial repository through a proxy, create a file
345 418 $HOME/.hgrc in the following format:
346 419
347 420 --------------
348 421 [http_proxy]
349 422 host=myproxy:8080
350 423 user=<username>
351 424 passwd=<password>
352 425 no=<localhost1>,<localhost2>,<localhost3>,...
353 426 --------------
354 427
355 428 "user","passwd" fields are used for authenticating proxies, "no" is a
356 429 comma-separated list of local host names for which proxy must be
357 430 bypassed.
358 431
359 432
360 433 BUGS
361 434 ----
362 435 Probably lots, please post them to the mailing list (See Resources below)
363 436 when you find them.
364 437
365 438 AUTHOR
366 439 ------
367 440 Written by Matt Mackall <mpm@selenic.com>
368 441
369 442 RESOURCES
370 443 ---------
371 444 http://selenic.com/mercurial[Main Web Site]
372 445
373 446 http://selenic.com/hg[Source code repository]
374 447
375 448 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
376 449
377 450 COPYING
378 451 -------
379 452 Copyright (C) 2005 Matt Mackall.
380 453 Free use of this software is granted under the terms of the GNU General
381 454 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now