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