##// END OF EJS Templates
add document on command defaults
TK Soh -
r3039:77637938 default
parent child Browse files
Show More
@@ -1,493 +1,508 b''
1 1 HGRC(5)
2 2 =======
3 3 Bryan O'Sullivan <bos@serpentine.com>
4 4
5 5 NAME
6 6 ----
7 7 hgrc - configuration files for Mercurial
8 8
9 9 SYNOPSIS
10 10 --------
11 11
12 12 The Mercurial system uses a set of configuration files to control
13 13 aspects of its behaviour.
14 14
15 15 FILES
16 16 -----
17 17
18 18 Mercurial reads configuration data from several files, if they exist.
19 19 The names of these files depend on the system on which Mercurial is
20 20 installed.
21 21
22 22 (Unix) <install-root>/etc/mercurial/hgrc.d/*.rc::
23 23 (Unix) <install-root>/etc/mercurial/hgrc::
24 24 Per-installation configuration files, searched for in the
25 25 directory where Mercurial is installed. For example, if installed
26 26 in /shared/tools, Mercurial will look in
27 27 /shared/tools/etc/mercurial/hgrc. Options in these files apply to
28 28 all Mercurial commands executed by any user in any directory.
29 29
30 30 (Unix) /etc/mercurial/hgrc.d/*.rc::
31 31 (Unix) /etc/mercurial/hgrc::
32 32 (Windows) C:\Mercurial\Mercurial.ini::
33 33 Per-system configuration files, for the system on which Mercurial
34 34 is running. Options in these files apply to all Mercurial
35 35 commands executed by any user in any directory. Options in these
36 36 files override per-installation options.
37 37
38 38 (Unix) $HOME/.hgrc::
39 39 (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini::
40 40 (Windows) $HOME\Mercurial.ini::
41 41 Per-user configuration file, for the user running Mercurial.
42 42 Options in this file apply to all Mercurial commands executed by
43 43 any user in any directory. Options in this file override
44 44 per-installation and per-system options.
45 45 On Windows system, one of these is chosen exclusively according
46 46 to definition of HOME environment variable.
47 47
48 48 (Unix, Windows) <repo>/.hg/hgrc::
49 49 Per-repository configuration options that only apply in a
50 50 particular repository. This file is not version-controlled, and
51 51 will not get transferred during a "clone" operation. Options in
52 52 this file override options in all other configuration files.
53 53 On Unix, this file is only read if it belongs to a trusted user
54 54 or to a trusted group.
55 55
56 56 SYNTAX
57 57 ------
58 58
59 59 A configuration file consists of sections, led by a "[section]" header
60 60 and followed by "name: value" entries; "name=value" is also accepted.
61 61
62 62 [spam]
63 63 eggs=ham
64 64 green=
65 65 eggs
66 66
67 67 Each line contains one entry. If the lines that follow are indented,
68 68 they are treated as continuations of that entry.
69 69
70 70 Leading whitespace is removed from values. Empty lines are skipped.
71 71
72 72 The optional values can contain format strings which refer to other
73 73 values in the same section, or values in a special DEFAULT section.
74 74
75 75 Lines beginning with "#" or ";" are ignored and may be used to provide
76 76 comments.
77 77
78 78 SECTIONS
79 79 --------
80 80
81 81 This section describes the different sections that may appear in a
82 82 Mercurial "hgrc" file, the purpose of each section, its possible
83 83 keys, and their possible values.
84 84
85 85 decode/encode::
86 86 Filters for transforming files on checkout/checkin. This would
87 87 typically be used for newline processing or other
88 88 localization/canonicalization of files.
89 89
90 90 Filters consist of a filter pattern followed by a filter command.
91 91 Filter patterns are globs by default, rooted at the repository
92 92 root. For example, to match any file ending in ".txt" in the root
93 93 directory only, use the pattern "*.txt". To match any file ending
94 94 in ".c" anywhere in the repository, use the pattern "**.c".
95 95
96 96 The filter command can start with a specifier, either "pipe:" or
97 97 "tempfile:". If no specifier is given, "pipe:" is used by default.
98 98
99 99 A "pipe:" command must accept data on stdin and return the
100 100 transformed data on stdout.
101 101
102 102 Pipe example:
103 103
104 104 [encode]
105 105 # uncompress gzip files on checkin to improve delta compression
106 106 # note: not necessarily a good idea, just an example
107 107 *.gz = pipe: gunzip
108 108
109 109 [decode]
110 110 # recompress gzip files when writing them to the working dir (we
111 111 # can safely omit "pipe:", because it's the default)
112 112 *.gz = gzip
113 113
114 114 A "tempfile:" command is a template. The string INFILE is replaced
115 115 with the name of a temporary file that contains the data to be
116 116 filtered by the command. The string OUTFILE is replaced with the
117 117 name of an empty temporary file, where the filtered data must be
118 118 written by the command.
119 119
120 120 NOTE: the tempfile mechanism is recommended for Windows systems,
121 121 where the standard shell I/O redirection operators often have
122 122 strange effects. In particular, if you are doing line ending
123 123 conversion on Windows using the popular dos2unix and unix2dos
124 124 programs, you *must* use the tempfile mechanism, as using pipes will
125 125 corrupt the contents of your files.
126 126
127 127 Tempfile example:
128 128
129 129 [encode]
130 130 # convert files to unix line ending conventions on checkin
131 131 **.txt = tempfile: dos2unix -n INFILE OUTFILE
132 132
133 133 [decode]
134 134 # convert files to windows line ending conventions when writing
135 135 # them to the working dir
136 136 **.txt = tempfile: unix2dos -n INFILE OUTFILE
137 137
138 defaults::
139 Use the [defaults] section to define command defaults, i.e. the
140 default options/arguments to pass to the specified commands.
141
142 The following example makes 'hg log' run in verbose mode, and
143 'hg status' show only the modified files, by default.
144
145 [defaults]
146 log = -v
147 status = -m
148
149 The actual commands, instead of their aliases, must be used when
150 defining command defaults. The command defaults will also be
151 applied to the aliases of the commands defined.
152
138 153 email::
139 154 Settings for extensions that send email messages.
140 155 from;;
141 156 Optional. Email address to use in "From" header and SMTP envelope
142 157 of outgoing messages.
143 158 to;;
144 159 Optional. Comma-separated list of recipients' email addresses.
145 160 cc;;
146 161 Optional. Comma-separated list of carbon copy recipients'
147 162 email addresses.
148 163 bcc;;
149 164 Optional. Comma-separated list of blind carbon copy
150 165 recipients' email addresses. Cannot be set interactively.
151 166 method;;
152 167 Optional. Method to use to send email messages. If value is
153 168 "smtp" (default), use SMTP (see section "[smtp]" for
154 169 configuration). Otherwise, use as name of program to run that
155 170 acts like sendmail (takes "-f" option for sender, list of
156 171 recipients on command line, message on stdin). Normally, setting
157 172 this to "sendmail" or "/usr/sbin/sendmail" is enough to use
158 173 sendmail to send messages.
159 174
160 175 Email example:
161 176
162 177 [email]
163 178 from = Joseph User <joe.user@example.com>
164 179 method = /usr/sbin/sendmail
165 180
166 181 extensions::
167 182 Mercurial has an extension mechanism for adding new features. To
168 183 enable an extension, create an entry for it in this section.
169 184
170 185 If you know that the extension is already in Python's search path,
171 186 you can give the name of the module, followed by "=", with nothing
172 187 after the "=".
173 188
174 189 Otherwise, give a name that you choose, followed by "=", followed by
175 190 the path to the ".py" file (including the file name extension) that
176 191 defines the extension.
177 192
178 193 Example for ~/.hgrc:
179 194
180 195 [extensions]
181 196 # (the mq extension will get loaded from mercurial's path)
182 197 hgext.mq =
183 198 # (this extension will get loaded from the file specified)
184 199 myfeature = ~/.hgext/myfeature.py
185 200
186 201 hooks::
187 202 Commands or Python functions that get automatically executed by
188 203 various actions such as starting or finishing a commit. Multiple
189 204 hooks can be run for the same action by appending a suffix to the
190 205 action. Overriding a site-wide hook can be done by changing its
191 206 value or setting it to an empty string.
192 207
193 208 Example .hg/hgrc:
194 209
195 210 [hooks]
196 211 # do not use the site-wide hook
197 212 incoming =
198 213 incoming.email = /my/email/hook
199 214 incoming.autobuild = /my/build/hook
200 215
201 216 Most hooks are run with environment variables set that give added
202 217 useful information. For each hook below, the environment variables
203 218 it is passed are listed with names of the form "$HG_foo".
204 219
205 220 changegroup;;
206 221 Run after a changegroup has been added via push, pull or
207 222 unbundle. ID of the first new changeset is in $HG_NODE. URL from
208 223 which changes came is in $HG_URL.
209 224 commit;;
210 225 Run after a changeset has been created in the local repository.
211 226 ID of the newly created changeset is in $HG_NODE. Parent
212 227 changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
213 228 incoming;;
214 229 Run after a changeset has been pulled, pushed, or unbundled into
215 230 the local repository. The ID of the newly arrived changeset is in
216 231 $HG_NODE. URL that was source of changes came is in $HG_URL.
217 232 outgoing;;
218 233 Run after sending changes from local repository to another. ID of
219 234 first changeset sent is in $HG_NODE. Source of operation is in
220 235 $HG_SOURCE; see "preoutgoing" hook for description.
221 236 prechangegroup;;
222 237 Run before a changegroup is added via push, pull or unbundle.
223 238 Exit status 0 allows the changegroup to proceed. Non-zero status
224 239 will cause the push, pull or unbundle to fail. URL from which
225 240 changes will come is in $HG_URL.
226 241 precommit;;
227 242 Run before starting a local commit. Exit status 0 allows the
228 243 commit to proceed. Non-zero status will cause the commit to fail.
229 244 Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
230 245 preoutgoing;;
231 246 Run before computing changes to send from the local repository to
232 247 another. Non-zero status will cause failure. This lets you
233 248 prevent pull over http or ssh. Also prevents against local pull,
234 249 push (outbound) or bundle commands, but not effective, since you
235 250 can just copy files instead then. Source of operation is in
236 251 $HG_SOURCE. If "serve", operation is happening on behalf of
237 252 remote ssh or http repository. If "push", "pull" or "bundle",
238 253 operation is happening on behalf of repository on same system.
239 254 pretag;;
240 255 Run before creating a tag. Exit status 0 allows the tag to be
241 256 created. Non-zero status will cause the tag to fail. ID of
242 257 changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag
243 258 is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0.
244 259 pretxnchangegroup;;
245 260 Run after a changegroup has been added via push, pull or unbundle,
246 261 but before the transaction has been committed. Changegroup is
247 262 visible to hook program. This lets you validate incoming changes
248 263 before accepting them. Passed the ID of the first new changeset
249 264 in $HG_NODE. Exit status 0 allows the transaction to commit.
250 265 Non-zero status will cause the transaction to be rolled back and
251 266 the push, pull or unbundle will fail. URL that was source of
252 267 changes is in $HG_URL.
253 268 pretxncommit;;
254 269 Run after a changeset has been created but the transaction not yet
255 270 committed. Changeset is visible to hook program. This lets you
256 271 validate commit message and changes. Exit status 0 allows the
257 272 commit to proceed. Non-zero status will cause the transaction to
258 273 be rolled back. ID of changeset is in $HG_NODE. Parent changeset
259 274 IDs are in $HG_PARENT1 and $HG_PARENT2.
260 275 preupdate;;
261 276 Run before updating the working directory. Exit status 0 allows
262 277 the update to proceed. Non-zero status will prevent the update.
263 278 Changeset ID of first new parent is in $HG_PARENT1. If merge, ID
264 279 of second new parent is in $HG_PARENT2.
265 280 tag;;
266 281 Run after a tag is created. ID of tagged changeset is in
267 282 $HG_NODE. Name of tag is in $HG_TAG. Tag is local if
268 283 $HG_LOCAL=1, in repo if $HG_LOCAL=0.
269 284 update;;
270 285 Run after updating the working directory. Changeset ID of first
271 286 new parent is in $HG_PARENT1. If merge, ID of second new parent
272 287 is in $HG_PARENT2. If update succeeded, $HG_ERROR=0. If update
273 288 failed (e.g. because conflicts not resolved), $HG_ERROR=1.
274 289
275 290 Note: In earlier releases, the names of hook environment variables
276 291 did not have a "HG_" prefix. The old unprefixed names are no longer
277 292 provided in the environment.
278 293
279 294 The syntax for Python hooks is as follows:
280 295
281 296 hookname = python:modulename.submodule.callable
282 297
283 298 Python hooks are run within the Mercurial process. Each hook is
284 299 called with at least three keyword arguments: a ui object (keyword
285 300 "ui"), a repository object (keyword "repo"), and a "hooktype"
286 301 keyword that tells what kind of hook is used. Arguments listed as
287 302 environment variables above are passed as keyword arguments, with no
288 303 "HG_" prefix, and names in lower case.
289 304
290 305 A Python hook must return a "true" value to succeed. Returning a
291 306 "false" value or raising an exception is treated as failure of the
292 307 hook.
293 308
294 309 http_proxy::
295 310 Used to access web-based Mercurial repositories through a HTTP
296 311 proxy.
297 312 host;;
298 313 Host name and (optional) port of the proxy server, for example
299 314 "myproxy:8000".
300 315 no;;
301 316 Optional. Comma-separated list of host names that should bypass
302 317 the proxy.
303 318 passwd;;
304 319 Optional. Password to authenticate with at the proxy server.
305 320 user;;
306 321 Optional. User name to authenticate with at the proxy server.
307 322
308 323 smtp::
309 324 Configuration for extensions that need to send email messages.
310 325 host;;
311 326 Host name of mail server, e.g. "mail.example.com".
312 327 port;;
313 328 Optional. Port to connect to on mail server. Default: 25.
314 329 tls;;
315 330 Optional. Whether to connect to mail server using TLS. True or
316 331 False. Default: False.
317 332 username;;
318 333 Optional. User name to authenticate to SMTP server with.
319 334 If username is specified, password must also be specified.
320 335 Default: none.
321 336 password;;
322 337 Optional. Password to authenticate to SMTP server with.
323 338 If username is specified, password must also be specified.
324 339 Default: none.
325 340 local_hostname;;
326 341 Optional. It's the hostname that the sender can use to identify itself
327 342 to the MTA.
328 343
329 344 paths::
330 345 Assigns symbolic names to repositories. The left side is the
331 346 symbolic name, and the right gives the directory or URL that is the
332 347 location of the repository. Default paths can be declared by
333 348 setting the following entries.
334 349 default;;
335 350 Directory or URL to use when pulling if no source is specified.
336 351 Default is set to repository from which the current repository
337 352 was cloned.
338 353 default-push;;
339 354 Optional. Directory or URL to use when pushing if no destination
340 355 is specified.
341 356
342 357 server::
343 358 Controls generic server settings.
344 359 uncompressed;;
345 360 Whether to allow clients to clone a repo using the uncompressed
346 361 streaming protocol. This transfers about 40% more data than a
347 362 regular clone, but uses less memory and CPU on both server and
348 363 client. Over a LAN (100Mbps or better) or a very fast WAN, an
349 364 uncompressed streaming clone is a lot faster (~10x) than a regular
350 365 clone. Over most WAN connections (anything slower than about
351 366 6Mbps), uncompressed streaming is slower, because of the extra
352 367 data transfer overhead. Default is False.
353 368
354 369 trusted::
355 370 Mercurial will only read the .hg/hgrc file from a repository if
356 371 it belongs to a trusted user or to a trusted group. This section
357 372 specifies what users and groups are trusted. To trust everybody,
358 373 list a user or a group with name "*".
359 374 users;;
360 375 Comma-separated list of trusted users.
361 376 groups;;
362 377 Comma-separated list of trusted groups.
363 378
364 379 ui::
365 380 User interface controls.
366 381 debug;;
367 382 Print debugging information. True or False. Default is False.
368 383 editor;;
369 384 The editor to use during a commit. Default is $EDITOR or "vi".
370 385 ignore;;
371 386 A file to read per-user ignore patterns from. This file should be in
372 387 the same format as a repository-wide .hgignore file. This option
373 388 supports hook syntax, so if you want to specify multiple ignore
374 389 files, you can do so by setting something like
375 390 "ignore.other = ~/.hgignore2". For details of the ignore file
376 391 format, see the hgignore(5) man page.
377 392 interactive;;
378 393 Allow to prompt the user. True or False. Default is True.
379 394 logtemplate;;
380 395 Template string for commands that print changesets.
381 396 style;;
382 397 Name of style to use for command output.
383 398 merge;;
384 399 The conflict resolution program to use during a manual merge.
385 400 Default is "hgmerge".
386 401 quiet;;
387 402 Reduce the amount of output printed. True or False. Default is False.
388 403 remotecmd;;
389 404 remote command to use for clone/push/pull operations. Default is 'hg'.
390 405 ssh;;
391 406 command to use for SSH connections. Default is 'ssh'.
392 407 strict;;
393 408 Require exact command names, instead of allowing unambiguous
394 409 abbreviations. True or False. Default is False.
395 410 timeout;;
396 411 The timeout used when a lock is held (in seconds), a negative value
397 412 means no timeout. Default is 600.
398 413 username;;
399 414 The committer of a changeset created when running "commit".
400 415 Typically a person's name and email address, e.g. "Fred Widget
401 416 <fred@example.com>". Default is $EMAIL or username@hostname, unless
402 417 username is set to an empty string, which enforces specifying the
403 418 username manually.
404 419 verbose;;
405 420 Increase the amount of output printed. True or False. Default is False.
406 421
407 422
408 423 web::
409 424 Web interface configuration.
410 425 accesslog;;
411 426 Where to output the access log. Default is stdout.
412 427 address;;
413 428 Interface address to bind to. Default is all.
414 429 allow_archive;;
415 430 List of archive format (bz2, gz, zip) allowed for downloading.
416 431 Default is empty.
417 432 allowbz2;;
418 433 (DEPRECATED) Whether to allow .tar.bz2 downloading of repo revisions.
419 434 Default is false.
420 435 allowgz;;
421 436 (DEPRECATED) Whether to allow .tar.gz downloading of repo revisions.
422 437 Default is false.
423 438 allowpull;;
424 439 Whether to allow pulling from the repository. Default is true.
425 440 allow_push;;
426 441 Whether to allow pushing to the repository. If empty or not set,
427 442 push is not allowed. If the special value "*", any remote user
428 443 can push, including unauthenticated users. Otherwise, the remote
429 444 user must have been authenticated, and the authenticated user name
430 445 must be present in this list (separated by whitespace or ",").
431 446 The contents of the allow_push list are examined after the
432 447 deny_push list.
433 448 allowzip;;
434 449 (DEPRECATED) Whether to allow .zip downloading of repo revisions.
435 450 Default is false. This feature creates temporary files.
436 451 baseurl;;
437 452 Base URL to use when publishing URLs in other locations, so
438 453 third-party tools like email notification hooks can construct URLs.
439 454 Example: "http://hgserver/repos/"
440 455 contact;;
441 456 Name or email address of the person in charge of the repository.
442 457 Default is "unknown".
443 458 deny_push;;
444 459 Whether to deny pushing to the repository. If empty or not set,
445 460 push is not denied. If the special value "*", all remote users
446 461 are denied push. Otherwise, unauthenticated users are all denied,
447 462 and any authenticated user name present in this list (separated by
448 463 whitespace or ",") is also denied. The contents of the deny_push
449 464 list are examined before the allow_push list.
450 465 description;;
451 466 Textual description of the repository's purpose or contents.
452 467 Default is "unknown".
453 468 errorlog;;
454 469 Where to output the error log. Default is stderr.
455 470 ipv6;;
456 471 Whether to use IPv6. Default is false.
457 472 name;;
458 473 Repository name to use in the web interface. Default is current
459 474 working directory.
460 475 maxchanges;;
461 476 Maximum number of changes to list on the changelog. Default is 10.
462 477 maxfiles;;
463 478 Maximum number of files to list per changeset. Default is 10.
464 479 port;;
465 480 Port to listen on. Default is 8000.
466 481 push_ssl;;
467 482 Whether to require that inbound pushes be transported over SSL to
468 483 prevent password sniffing. Default is true.
469 484 stripes;;
470 485 How many lines a "zebra stripe" should span in multiline output.
471 486 Default is 1; set to 0 to disable.
472 487 style;;
473 488 Which template map style to use.
474 489 templates;;
475 490 Where to find the HTML templates. Default is install path.
476 491
477 492
478 493 AUTHOR
479 494 ------
480 495 Bryan O'Sullivan <bos@serpentine.com>.
481 496
482 497 Mercurial was written by Matt Mackall <mpm@selenic.com>.
483 498
484 499 SEE ALSO
485 500 --------
486 501 hg(1), hgignore(5)
487 502
488 503 COPYING
489 504 -------
490 505 This manual page is copyright 2005 Bryan O'Sullivan.
491 506 Mercurial is copyright 2005, 2006 Matt Mackall.
492 507 Free use of this software is granted under the terms of the GNU General
493 508 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now