Show More
@@ -1,391 +1,399 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 | Per-user configuration file, for the user running Mercurial. |
|
41 | 41 | Options in this file apply to all Mercurial commands executed by |
|
42 | 42 | any user in any directory. Options in this file override |
|
43 | 43 | per-installation and per-system options. |
|
44 | 44 | |
|
45 | 45 | (Unix, Windows) <repo>/.hg/hgrc:: |
|
46 | 46 | Per-repository configuration options that only apply in a |
|
47 | 47 | particular repository. This file is not version-controlled, and |
|
48 | 48 | will not get transferred during a "clone" operation. Options in |
|
49 | 49 | this file override options in all other configuration files. |
|
50 | 50 | |
|
51 | 51 | SYNTAX |
|
52 | 52 | ------ |
|
53 | 53 | |
|
54 | 54 | A configuration file consists of sections, led by a "[section]" header |
|
55 | 55 | and followed by "name: value" entries; "name=value" is also accepted. |
|
56 | 56 | |
|
57 | 57 | [spam] |
|
58 | 58 | eggs=ham |
|
59 | 59 | green= |
|
60 | 60 | eggs |
|
61 | 61 | |
|
62 | 62 | Each line contains one entry. If the lines that follow are indented, |
|
63 | 63 | they are treated as continuations of that entry. |
|
64 | 64 | |
|
65 | 65 | Leading whitespace is removed from values. Empty lines are skipped. |
|
66 | 66 | |
|
67 | 67 | The optional values can contain format strings which refer to other |
|
68 | 68 | values in the same section, or values in a special DEFAULT section. |
|
69 | 69 | |
|
70 | 70 | Lines beginning with "#" or ";" are ignored and may be used to provide |
|
71 | 71 | comments. |
|
72 | 72 | |
|
73 | 73 | SECTIONS |
|
74 | 74 | -------- |
|
75 | 75 | |
|
76 | 76 | This section describes the different sections that may appear in a |
|
77 | 77 | Mercurial "hgrc" file, the purpose of each section, its possible |
|
78 | 78 | keys, and their possible values. |
|
79 | 79 | |
|
80 | 80 | decode/encode:: |
|
81 | 81 | Filters for transforming files on checkout/checkin. This would |
|
82 | 82 | typically be used for newline processing or other |
|
83 | 83 | localization/canonicalization of files. |
|
84 | 84 | |
|
85 | 85 | Filters consist of a filter pattern followed by a filter command. |
|
86 | 86 | Filter patterns are globs by default, rooted at the repository |
|
87 | 87 | root. For example, to match any file ending in ".txt" in the root |
|
88 | 88 | directory only, use the pattern "*.txt". To match any file ending |
|
89 | 89 | in ".c" anywhere in the repository, use the pattern "**.c". |
|
90 | 90 | |
|
91 | 91 | The filter command can start with a specifier, either "pipe:" or |
|
92 | 92 | "tempfile:". If no specifier is given, "pipe:" is used by default. |
|
93 | 93 | |
|
94 | 94 | A "pipe:" command must accept data on stdin and return the |
|
95 | 95 | transformed data on stdout. |
|
96 | 96 | |
|
97 | 97 | Pipe example: |
|
98 | 98 | |
|
99 | 99 | [encode] |
|
100 | 100 | # uncompress gzip files on checkin to improve delta compression |
|
101 | 101 | # note: not necessarily a good idea, just an example |
|
102 | 102 | *.gz = pipe: gunzip |
|
103 | 103 | |
|
104 | 104 | [decode] |
|
105 | 105 | # recompress gzip files when writing them to the working dir (we |
|
106 | 106 | # can safely omit "pipe:", because it's the default) |
|
107 | 107 | *.gz = gzip |
|
108 | 108 | |
|
109 | 109 | A "tempfile:" command is a template. The string INFILE is replaced |
|
110 | 110 | with the name of a temporary file that contains the data to be |
|
111 | 111 | filtered by the command. The string OUTFILE is replaced with the |
|
112 | 112 | name of an empty temporary file, where the filtered data must be |
|
113 | 113 | written by the command. |
|
114 | 114 | |
|
115 | 115 | NOTE: the tempfile mechanism is recommended for Windows systems, |
|
116 | 116 | where the standard shell I/O redirection operators often have |
|
117 | 117 | strange effects. In particular, if you are doing line ending |
|
118 | 118 | conversion on Windows using the popular dos2unix and unix2dos |
|
119 | 119 | programs, you *must* use the tempfile mechanism, as using pipes will |
|
120 | 120 | corrupt the contents of your files. |
|
121 | 121 | |
|
122 | 122 | Tempfile example: |
|
123 | 123 | |
|
124 | 124 | [encode] |
|
125 | 125 | # convert files to unix line ending conventions on checkin |
|
126 | 126 | **.txt = tempfile: dos2unix -n INFILE OUTFILE |
|
127 | 127 | |
|
128 | 128 | [decode] |
|
129 | 129 | # convert files to windows line ending conventions when writing |
|
130 | 130 | # them to the working dir |
|
131 | 131 | **.txt = tempfile: unix2dos -n INFILE OUTFILE |
|
132 | 132 | |
|
133 | 133 | email:: |
|
134 | 134 | Settings for extensions that send email messages. |
|
135 | 135 | from;; |
|
136 | 136 | Optional. Email address to use in "From" header and SMTP envelope |
|
137 | 137 | of outgoing messages. |
|
138 | 138 | |
|
139 | 139 | extensions:: |
|
140 | 140 | Mercurial has an extension mechanism for adding new features. To |
|
141 | 141 | enable an extension, create an entry for it in this section. |
|
142 | 142 | |
|
143 | 143 | If you know that the extension is already in Python's search path, |
|
144 | 144 | you can give the name of the module, followed by "=", with nothing |
|
145 | 145 | after the "=". |
|
146 | 146 | |
|
147 | 147 | Otherwise, give a name that you choose, followed by "=", followed by |
|
148 | 148 | the path to the ".py" file (including the file name extension) that |
|
149 | 149 | defines the extension. |
|
150 | 150 | |
|
151 | 151 | hooks:: |
|
152 | 152 | Commands or Python functions that get automatically executed by |
|
153 | 153 | various actions such as starting or finishing a commit. Multiple |
|
154 | 154 | hooks can be run for the same action by appending a suffix to the |
|
155 | 155 | action. Overriding a site-wide hook can be done by changing its |
|
156 | 156 | value or setting it to an empty string. |
|
157 | 157 | |
|
158 | 158 | Example .hg/hgrc: |
|
159 | 159 | |
|
160 | 160 | [hooks] |
|
161 | 161 | # do not use the site-wide hook |
|
162 | 162 | incoming = |
|
163 | 163 | incoming.email = /my/email/hook |
|
164 | 164 | incoming.autobuild = /my/build/hook |
|
165 | 165 | |
|
166 | 166 | Most hooks are run with environment variables set that give added |
|
167 | 167 | useful information. For each hook below, the environment variables |
|
168 | 168 | it is passed are listed with names of the form "$HG_foo". |
|
169 | 169 | |
|
170 | 170 | changegroup;; |
|
171 | 171 | Run after a changegroup has been added via push, pull or |
|
172 | 172 | unbundle. ID of the first new changeset is in $HG_NODE. |
|
173 | 173 | commit;; |
|
174 | 174 | Run after a changeset has been created in the local repository. |
|
175 | 175 | ID of the newly created changeset is in $HG_NODE. Parent |
|
176 | 176 | changeset IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
177 | 177 | incoming;; |
|
178 | 178 | Run after a changeset has been pulled, pushed, or unbundled into |
|
179 | 179 | the local repository. The ID of the newly arrived changeset is in |
|
180 | 180 | $HG_NODE. |
|
181 | 181 | outgoing;; |
|
182 | 182 | Run after sending changes from local repository to another. ID of |
|
183 | 183 | first changeset sent is in $HG_NODE. Source of operation is in |
|
184 | 184 | $HG_SOURCE; see "preoutgoing" hook for description. |
|
185 | 185 | prechangegroup;; |
|
186 | 186 | Run before a changegroup is added via push, pull or unbundle. |
|
187 | 187 | Exit status 0 allows the changegroup to proceed. Non-zero status |
|
188 | 188 | will cause the push, pull or unbundle to fail. |
|
189 | 189 | precommit;; |
|
190 | 190 | Run before starting a local commit. Exit status 0 allows the |
|
191 | 191 | commit to proceed. Non-zero status will cause the commit to fail. |
|
192 | 192 | Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
193 | 193 | preoutgoing;; |
|
194 | 194 | Run before computing changes to send from the local repository to |
|
195 | 195 | another. Non-zero status will cause failure. This lets you |
|
196 | 196 | prevent pull over http or ssh. Also prevents against local pull, |
|
197 | 197 | push (outbound) or bundle commands, but not effective, since you |
|
198 | 198 | can just copy files instead then. Source of operation is in |
|
199 | 199 | $HG_SOURCE. If "serve", operation is happening on behalf of |
|
200 | 200 | remote ssh or http repository. If "push", "pull" or "bundle", |
|
201 | 201 | operation is happening on behalf of repository on same system. |
|
202 | 202 | pretag;; |
|
203 | 203 | Run before creating a tag. Exit status 0 allows the tag to be |
|
204 | 204 | created. Non-zero status will cause the tag to fail. ID of |
|
205 | 205 | changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag |
|
206 | 206 | is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0. |
|
207 | 207 | pretxnchangegroup;; |
|
208 | 208 | Run after a changegroup has been added via push, pull or unbundle, |
|
209 | 209 | but before the transaction has been committed. Changegroup is |
|
210 | 210 | visible to hook program. This lets you validate incoming changes |
|
211 | 211 | before accepting them. Passed the ID of the first new changeset |
|
212 | 212 | in $HG_NODE. Exit status 0 allows the transaction to commit. |
|
213 | 213 | Non-zero status will cause the transaction to be rolled back and |
|
214 | 214 | the push, pull or unbundle will fail. |
|
215 | 215 | pretxncommit;; |
|
216 | 216 | Run after a changeset has been created but the transaction not yet |
|
217 | 217 | committed. Changeset is visible to hook program. This lets you |
|
218 | 218 | validate commit message and changes. Exit status 0 allows the |
|
219 | 219 | commit to proceed. Non-zero status will cause the transaction to |
|
220 | 220 | be rolled back. ID of changeset is in $HG_NODE. Parent changeset |
|
221 | 221 | IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
222 | 222 | preupdate;; |
|
223 | 223 | Run before updating the working directory. Exit status 0 allows |
|
224 | 224 | the update to proceed. Non-zero status will prevent the update. |
|
225 | 225 | Changeset ID of first new parent is in $HG_PARENT1. If merge, ID |
|
226 | 226 | of second new parent is in $HG_PARENT2. |
|
227 | 227 | tag;; |
|
228 | 228 | Run after a tag is created. ID of tagged changeset is in |
|
229 | 229 | $HG_NODE. Name of tag is in $HG_TAG. Tag is local if |
|
230 | 230 | $HG_LOCAL=1, in repo if $HG_LOCAL=0. |
|
231 | 231 | update;; |
|
232 | 232 | Run after updating the working directory. Changeset ID of first |
|
233 | 233 | new parent is in $HG_PARENT1. If merge, ID of second new parent |
|
234 | 234 | is in $HG_PARENT2. If update succeeded, $HG_ERROR=0. If update |
|
235 | 235 | failed (e.g. because conflicts not resolved), $HG_ERROR=1. |
|
236 | 236 | |
|
237 | 237 | In earlier releases, the names of hook environment variables did not |
|
238 | 238 | have a "HG_" prefix. These unprefixed names are still provided in |
|
239 | 239 | the environment for backwards compatibility, but their use is |
|
240 | 240 | deprecated, and they will be removed in a future release. |
|
241 | 241 | |
|
242 | 242 | The syntax for Python hooks is as follows: |
|
243 | 243 | |
|
244 | 244 | hookname = python:modulename.submodule.callable |
|
245 | 245 | |
|
246 | 246 | Python hooks are run within the Mercurial process. Each hook is |
|
247 | 247 | called with at least three keyword arguments: a ui object (keyword |
|
248 | 248 | "ui"), a repository object (keyword "repo"), and a "hooktype" |
|
249 | 249 | keyword that tells what kind of hook is used. Arguments listed as |
|
250 | 250 | environment variables above are passed as keyword arguments, with no |
|
251 | 251 | "HG_" prefix, and names in lower case. |
|
252 | 252 | |
|
253 | 253 | A Python hook must return a "true" value to succeed. Returning a |
|
254 | 254 | "false" value or raising an exception is treated as failure of the |
|
255 | 255 | hook. |
|
256 | 256 | |
|
257 | 257 | http_proxy:: |
|
258 | 258 | Used to access web-based Mercurial repositories through a HTTP |
|
259 | 259 | proxy. |
|
260 | 260 | host;; |
|
261 | 261 | Host name and (optional) port of the proxy server, for example |
|
262 | 262 | "myproxy:8000". |
|
263 | 263 | no;; |
|
264 | 264 | Optional. Comma-separated list of host names that should bypass |
|
265 | 265 | the proxy. |
|
266 | 266 | passwd;; |
|
267 | 267 | Optional. Password to authenticate with at the proxy server. |
|
268 | 268 | user;; |
|
269 | 269 | Optional. User name to authenticate with at the proxy server. |
|
270 | 270 | |
|
271 | 271 | smtp:: |
|
272 | 272 | Configuration for extensions that need to send email messages. |
|
273 | 273 | host;; |
|
274 | 274 | Optional. Host name of mail server. Default: "mail". |
|
275 | 275 | port;; |
|
276 | 276 | Optional. Port to connect to on mail server. Default: 25. |
|
277 | 277 | tls;; |
|
278 | 278 | Optional. Whether to connect to mail server using TLS. True or |
|
279 | 279 | False. Default: False. |
|
280 | 280 | username;; |
|
281 | 281 | Optional. User name to authenticate to SMTP server with. |
|
282 | 282 | If username is specified, password must also be specified. |
|
283 | 283 | Default: none. |
|
284 | 284 | password;; |
|
285 | 285 | Optional. Password to authenticate to SMTP server with. |
|
286 | 286 | If username is specified, password must also be specified. |
|
287 | 287 | Default: none. |
|
288 | 288 | |
|
289 | 289 | paths:: |
|
290 | 290 | Assigns symbolic names to repositories. The left side is the |
|
291 | 291 | symbolic name, and the right gives the directory or URL that is the |
|
292 | location of the repository. | |
|
292 | location of the repository. Default paths can be declared by | |
|
293 | setting the following entries. | |
|
294 | default;; | |
|
295 | Directory or URL to use when pulling if no source is specified. | |
|
296 | Default is set to repository from which the current repository | |
|
297 | was cloned. | |
|
298 | default-push;; | |
|
299 | Optional. Directory or URL to use when pushing if no destination | |
|
300 | is specified. | |
|
293 | 301 | |
|
294 | 302 | ui:: |
|
295 | 303 | User interface controls. |
|
296 | 304 | debug;; |
|
297 | 305 | Print debugging information. True or False. Default is False. |
|
298 | 306 | editor;; |
|
299 | 307 | The editor to use during a commit. Default is $EDITOR or "vi". |
|
300 | 308 | ignore;; |
|
301 | 309 | A file to read per-user ignore patterns from. This file should be in |
|
302 | 310 | the same format as a repository-wide .hgignore file. This option |
|
303 | 311 | supports hook syntax, so if you want to specify multiple ignore |
|
304 | 312 | files, you can do so by setting something like |
|
305 | 313 | "ignore.other = ~/.hgignore2". For details of the ignore file |
|
306 | 314 | format, see the hgignore(5) man page. |
|
307 | 315 | interactive;; |
|
308 | 316 | Allow to prompt the user. True or False. Default is True. |
|
309 | 317 | logtemplate;; |
|
310 | 318 | Template string for commands that print changesets. |
|
311 | 319 | style;; |
|
312 | 320 | Name of style to use for command output. |
|
313 | 321 | merge;; |
|
314 | 322 | The conflict resolution program to use during a manual merge. |
|
315 | 323 | Default is "hgmerge". |
|
316 | 324 | quiet;; |
|
317 | 325 | Reduce the amount of output printed. True or False. Default is False. |
|
318 | 326 | remotecmd;; |
|
319 | 327 | remote command to use for clone/push/pull operations. Default is 'hg'. |
|
320 | 328 | ssh;; |
|
321 | 329 | command to use for SSH connections. Default is 'ssh'. |
|
322 | 330 | timeout;; |
|
323 | 331 | The timeout used when a lock is held (in seconds), a negative value |
|
324 | 332 | means no timeout. Default is 600. |
|
325 | 333 | username;; |
|
326 | 334 | The committer of a changeset created when running "commit". |
|
327 | 335 | Typically a person's name and email address, e.g. "Fred Widget |
|
328 | 336 | <fred@example.com>". Default is $EMAIL or username@hostname, unless |
|
329 | 337 | username is set to an empty string, which enforces specifying the |
|
330 | 338 | username manually. |
|
331 | 339 | verbose;; |
|
332 | 340 | Increase the amount of output printed. True or False. Default is False. |
|
333 | 341 | |
|
334 | 342 | |
|
335 | 343 | web:: |
|
336 | 344 | Web interface configuration. |
|
337 | 345 | accesslog;; |
|
338 | 346 | Where to output the access log. Default is stdout. |
|
339 | 347 | address;; |
|
340 | 348 | Interface address to bind to. Default is all. |
|
341 | 349 | allowbz2;; |
|
342 | 350 | Whether to allow .tar.bz2 downloading of repo revisions. Default is false. |
|
343 | 351 | allowgz;; |
|
344 | 352 | Whether to allow .tar.gz downloading of repo revisions. Default is false. |
|
345 | 353 | allowpull;; |
|
346 | 354 | Whether to allow pulling from the repository. Default is true. |
|
347 | 355 | allowzip;; |
|
348 | 356 | Whether to allow .zip downloading of repo revisions. Default is false. |
|
349 | 357 | This feature creates temporary files. |
|
350 | 358 | baseurl;; |
|
351 | 359 | Base URL to use when publishing URLs in other locations, so |
|
352 | 360 | third-party tools like email notification hooks can construct URLs. |
|
353 | 361 | Example: "http://hgserver/repos/" |
|
354 | 362 | description;; |
|
355 | 363 | Textual description of the repository's purpose or contents. |
|
356 | 364 | Default is "unknown". |
|
357 | 365 | errorlog;; |
|
358 | 366 | Where to output the error log. Default is stderr. |
|
359 | 367 | ipv6;; |
|
360 | 368 | Whether to use IPv6. Default is false. |
|
361 | 369 | name;; |
|
362 | 370 | Repository name to use in the web interface. Default is current |
|
363 | 371 | working directory. |
|
364 | 372 | maxchanges;; |
|
365 | 373 | Maximum number of changes to list on the changelog. Default is 10. |
|
366 | 374 | maxfiles;; |
|
367 | 375 | Maximum number of files to list per changeset. Default is 10. |
|
368 | 376 | port;; |
|
369 | 377 | Port to listen on. Default is 8000. |
|
370 | 378 | style;; |
|
371 | 379 | Which template map style to use. |
|
372 | 380 | templates;; |
|
373 | 381 | Where to find the HTML templates. Default is install path. |
|
374 | 382 | |
|
375 | 383 | |
|
376 | 384 | AUTHOR |
|
377 | 385 | ------ |
|
378 | 386 | Bryan O'Sullivan <bos@serpentine.com>. |
|
379 | 387 | |
|
380 | 388 | Mercurial was written by Matt Mackall <mpm@selenic.com>. |
|
381 | 389 | |
|
382 | 390 | SEE ALSO |
|
383 | 391 | -------- |
|
384 | 392 | hg(1), hgignore(5) |
|
385 | 393 | |
|
386 | 394 | COPYING |
|
387 | 395 | ------- |
|
388 | 396 | This manual page is copyright 2005 Bryan O'Sullivan. |
|
389 | 397 | Mercurial is copyright 2005, 2006 Matt Mackall. |
|
390 | 398 | Free use of this software is granted under the terms of the GNU General |
|
391 | 399 | Public License (GPL). |
General Comments 0
You need to be logged in to leave comments.
Login now