Show More
@@ -1,699 +1,701 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. *.rc files from a single directory are read in |
|
21 | 21 | alphabetical order, later ones overriding earlier ones. Where |
|
22 | 22 | multiple paths are given below, settings from later paths override |
|
23 | 23 | earlier ones. |
|
24 | 24 | |
|
25 | 25 | (Unix) <install-root>/etc/mercurial/hgrc.d/*.rc:: |
|
26 | 26 | (Unix) <install-root>/etc/mercurial/hgrc:: |
|
27 | 27 | Per-installation configuration files, searched for in the |
|
28 | 28 | directory where Mercurial is installed. <install-root> is the |
|
29 | 29 | parent directory of the hg executable (or symlink) being run. |
|
30 | 30 | For example, if installed in /shared/tools/bin/hg, Mercurial will |
|
31 | 31 | look in /shared/tools/etc/mercurial/hgrc. Options in these files |
|
32 | 32 | apply to all Mercurial commands executed by any user in any |
|
33 | 33 | directory. |
|
34 | 34 | |
|
35 | 35 | (Unix) /etc/mercurial/hgrc.d/*.rc:: |
|
36 | 36 | (Unix) /etc/mercurial/hgrc:: |
|
37 | 37 | Per-system configuration files, for the system on which Mercurial |
|
38 | 38 | is running. Options in these files apply to all Mercurial |
|
39 | 39 | commands executed by any user in any directory. Options in these |
|
40 | 40 | files override per-installation options. |
|
41 | 41 | |
|
42 | 42 | (Windows) <install-dir>\Mercurial.ini:: |
|
43 | 43 | or else:: |
|
44 | 44 | (Windows) HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial:: |
|
45 | 45 | or else:: |
|
46 | 46 | (Windows) C:\Mercurial\Mercurial.ini:: |
|
47 | 47 | Per-installation/system configuration files, for the system on |
|
48 | 48 | which Mercurial is running. Options in these files apply to all |
|
49 | 49 | Mercurial commands executed by any user in any directory. |
|
50 | 50 | Registry keys contain PATH-like strings, every part of which must |
|
51 | 51 | reference a Mercurial.ini file or be a directory where *.rc files |
|
52 | 52 | will be read. |
|
53 | 53 | |
|
54 | 54 | (Unix) $HOME/.hgrc:: |
|
55 | 55 | (Windows) %HOME%\Mercurial.ini:: |
|
56 | 56 | (Windows) %HOME%\.hgrc:: |
|
57 | 57 | (Windows) %USERPROFILE%\Mercurial.ini:: |
|
58 | 58 | (Windows) %USERPROFILE%\.hgrc:: |
|
59 | 59 | Per-user configuration file(s), for the user running Mercurial. |
|
60 | 60 | On Windows 9x, %HOME% is replaced by %APPDATA%. |
|
61 | 61 | Options in these files apply to all Mercurial commands executed |
|
62 | 62 | by this user in any directory. Options in thes files override |
|
63 | 63 | per-installation and per-system options. |
|
64 | 64 | |
|
65 | 65 | (Unix, Windows) <repo>/.hg/hgrc:: |
|
66 | 66 | Per-repository configuration options that only apply in a |
|
67 | 67 | particular repository. This file is not version-controlled, and |
|
68 | 68 | will not get transferred during a "clone" operation. Options in |
|
69 | 69 | this file override options in all other configuration files. |
|
70 | 70 | On Unix, most of this file will be ignored if it doesn't belong |
|
71 | 71 | to a trusted user or to a trusted group. See the documentation |
|
72 | 72 | for the trusted section below for more details. |
|
73 | 73 | |
|
74 | 74 | SYNTAX |
|
75 | 75 | ------ |
|
76 | 76 | |
|
77 | 77 | A configuration file consists of sections, led by a "[section]" header |
|
78 | 78 | and followed by "name: value" entries; "name=value" is also accepted. |
|
79 | 79 | |
|
80 | 80 | [spam] |
|
81 | 81 | eggs=ham |
|
82 | 82 | green= |
|
83 | 83 | eggs |
|
84 | 84 | |
|
85 | 85 | Each line contains one entry. If the lines that follow are indented, |
|
86 | 86 | they are treated as continuations of that entry. |
|
87 | 87 | |
|
88 | 88 | Leading whitespace is removed from values. Empty lines are skipped. |
|
89 | 89 | |
|
90 | 90 | The optional values can contain format strings which refer to other |
|
91 | 91 | values in the same section, or values in a special DEFAULT section. |
|
92 | 92 | |
|
93 | 93 | Lines beginning with "#" or ";" are ignored and may be used to provide |
|
94 | 94 | comments. |
|
95 | 95 | |
|
96 | 96 | SECTIONS |
|
97 | 97 | -------- |
|
98 | 98 | |
|
99 | 99 | This section describes the different sections that may appear in a |
|
100 | 100 | Mercurial "hgrc" file, the purpose of each section, its possible |
|
101 | 101 | keys, and their possible values. |
|
102 | 102 | |
|
103 | 103 | decode/encode:: |
|
104 | 104 | Filters for transforming files on checkout/checkin. This would |
|
105 | 105 | typically be used for newline processing or other |
|
106 | 106 | localization/canonicalization of files. |
|
107 | 107 | |
|
108 | 108 | Filters consist of a filter pattern followed by a filter command. |
|
109 | 109 | Filter patterns are globs by default, rooted at the repository |
|
110 | 110 | root. For example, to match any file ending in ".txt" in the root |
|
111 | 111 | directory only, use the pattern "*.txt". To match any file ending |
|
112 | 112 | in ".c" anywhere in the repository, use the pattern "**.c". |
|
113 | 113 | |
|
114 | 114 | The filter command can start with a specifier, either "pipe:" or |
|
115 | 115 | "tempfile:". If no specifier is given, "pipe:" is used by default. |
|
116 | 116 | |
|
117 | 117 | A "pipe:" command must accept data on stdin and return the |
|
118 | 118 | transformed data on stdout. |
|
119 | 119 | |
|
120 | 120 | Pipe example: |
|
121 | 121 | |
|
122 | 122 | [encode] |
|
123 | 123 | # uncompress gzip files on checkin to improve delta compression |
|
124 | 124 | # note: not necessarily a good idea, just an example |
|
125 | 125 | *.gz = pipe: gunzip |
|
126 | 126 | |
|
127 | 127 | [decode] |
|
128 | 128 | # recompress gzip files when writing them to the working dir (we |
|
129 | 129 | # can safely omit "pipe:", because it's the default) |
|
130 | 130 | *.gz = gzip |
|
131 | 131 | |
|
132 | 132 | A "tempfile:" command is a template. The string INFILE is replaced |
|
133 | 133 | with the name of a temporary file that contains the data to be |
|
134 | 134 | filtered by the command. The string OUTFILE is replaced with the |
|
135 | 135 | name of an empty temporary file, where the filtered data must be |
|
136 | 136 | written by the command. |
|
137 | 137 | |
|
138 | 138 | NOTE: the tempfile mechanism is recommended for Windows systems, |
|
139 | 139 | where the standard shell I/O redirection operators often have |
|
140 | 140 | strange effects and may corrupt the contents of your files. |
|
141 | 141 | |
|
142 | 142 | The most common usage is for LF <-> CRLF translation on Windows. |
|
143 | 143 | For this, use the "smart" convertors which check for binary files: |
|
144 | 144 | |
|
145 | 145 | [extensions] |
|
146 | 146 | hgext.win32text = |
|
147 | 147 | [encode] |
|
148 | 148 | ** = cleverencode: |
|
149 | 149 | [decode] |
|
150 | 150 | ** = cleverdecode: |
|
151 | 151 | |
|
152 | 152 | or if you only want to translate certain files: |
|
153 | 153 | |
|
154 | 154 | [extensions] |
|
155 | 155 | hgext.win32text = |
|
156 | 156 | [encode] |
|
157 | 157 | **.txt = dumbencode: |
|
158 | 158 | [decode] |
|
159 | 159 | **.txt = dumbdecode: |
|
160 | 160 | |
|
161 | 161 | defaults:: |
|
162 | 162 | Use the [defaults] section to define command defaults, i.e. the |
|
163 | 163 | default options/arguments to pass to the specified commands. |
|
164 | 164 | |
|
165 | 165 | The following example makes 'hg log' run in verbose mode, and |
|
166 | 166 | 'hg status' show only the modified files, by default. |
|
167 | 167 | |
|
168 | 168 | [defaults] |
|
169 | 169 | log = -v |
|
170 | 170 | status = -m |
|
171 | 171 | |
|
172 | 172 | The actual commands, instead of their aliases, must be used when |
|
173 | 173 | defining command defaults. The command defaults will also be |
|
174 | 174 | applied to the aliases of the commands defined. |
|
175 | 175 | |
|
176 | 176 | diff:: |
|
177 | 177 | Settings used when displaying diffs. They are all boolean and |
|
178 | 178 | defaults to False. |
|
179 | 179 | git;; |
|
180 | 180 | Use git extended diff format. |
|
181 | 181 | nodates;; |
|
182 | 182 | Don't include dates in diff headers. |
|
183 | 183 | showfunc;; |
|
184 | 184 | Show which function each change is in. |
|
185 | 185 | ignorews;; |
|
186 | 186 | Ignore white space when comparing lines. |
|
187 | 187 | ignorewsamount;; |
|
188 | 188 | Ignore changes in the amount of white space. |
|
189 | 189 | ignoreblanklines;; |
|
190 | 190 | Ignore changes whose lines are all blank. |
|
191 | 191 | |
|
192 | 192 | email:: |
|
193 | 193 | Settings for extensions that send email messages. |
|
194 | 194 | from;; |
|
195 | 195 | Optional. Email address to use in "From" header and SMTP envelope |
|
196 | 196 | of outgoing messages. |
|
197 | 197 | to;; |
|
198 | 198 | Optional. Comma-separated list of recipients' email addresses. |
|
199 | 199 | cc;; |
|
200 | 200 | Optional. Comma-separated list of carbon copy recipients' |
|
201 | 201 | email addresses. |
|
202 | 202 | bcc;; |
|
203 | 203 | Optional. Comma-separated list of blind carbon copy |
|
204 | 204 | recipients' email addresses. Cannot be set interactively. |
|
205 | 205 | method;; |
|
206 | 206 | Optional. Method to use to send email messages. If value is |
|
207 | 207 | "smtp" (default), use SMTP (see section "[smtp]" for |
|
208 | 208 | configuration). Otherwise, use as name of program to run that |
|
209 | 209 | acts like sendmail (takes "-f" option for sender, list of |
|
210 | 210 | recipients on command line, message on stdin). Normally, setting |
|
211 | 211 | this to "sendmail" or "/usr/sbin/sendmail" is enough to use |
|
212 | 212 | sendmail to send messages. |
|
213 | 213 | |
|
214 | 214 | Email example: |
|
215 | 215 | |
|
216 | 216 | [email] |
|
217 | 217 | from = Joseph User <joe.user@example.com> |
|
218 | 218 | method = /usr/sbin/sendmail |
|
219 | 219 | |
|
220 | 220 | extensions:: |
|
221 | 221 | Mercurial has an extension mechanism for adding new features. To |
|
222 | 222 | enable an extension, create an entry for it in this section. |
|
223 | 223 | |
|
224 | 224 | If you know that the extension is already in Python's search path, |
|
225 | 225 | you can give the name of the module, followed by "=", with nothing |
|
226 | 226 | after the "=". |
|
227 | 227 | |
|
228 | 228 | Otherwise, give a name that you choose, followed by "=", followed by |
|
229 | 229 | the path to the ".py" file (including the file name extension) that |
|
230 | 230 | defines the extension. |
|
231 | 231 | |
|
232 | 232 | To explicitly disable an extension that is enabled in an hgrc of |
|
233 | 233 | broader scope, prepend its path with '!', as in |
|
234 | 234 | 'hgext.foo = !/ext/path' or 'hgext.foo = !' when no path is supplied. |
|
235 | 235 | |
|
236 | 236 | Example for ~/.hgrc: |
|
237 | 237 | |
|
238 | 238 | [extensions] |
|
239 | 239 | # (the mq extension will get loaded from mercurial's path) |
|
240 | 240 | hgext.mq = |
|
241 | 241 | # (this extension will get loaded from the file specified) |
|
242 | 242 | myfeature = ~/.hgext/myfeature.py |
|
243 | 243 | |
|
244 | 244 | format:: |
|
245 | 245 | |
|
246 | 246 | usestore;; |
|
247 | 247 | Enable or disable the "store" repository format which improves |
|
248 | 248 | compatibility with systems that fold case or otherwise mangle |
|
249 | 249 | filenames. Enabled by default. Disabling this option will allow |
|
250 | 250 | you to store longer filenames in some situations at the expense of |
|
251 | 251 | compatibility. |
|
252 | 252 | |
|
253 | 253 | merge-patterns:: |
|
254 | 254 | This section specifies merge tools to associate with particular file |
|
255 | 255 | patterns. Tools matched here will take precedence over the default |
|
256 | 256 | merge tool. Patterns are globs by default, rooted at the repository root. |
|
257 | 257 | |
|
258 | 258 | Example: |
|
259 | 259 | |
|
260 | 260 | [merge-patterns] |
|
261 | 261 | **.c = kdiff3 |
|
262 | 262 | **.jpg = myimgmerge |
|
263 | 263 | |
|
264 | 264 | merge-tools:: |
|
265 | 265 | This section configures external merge tools to use for file-level |
|
266 | 266 | merges. |
|
267 | 267 | |
|
268 | 268 | Example ~/.hgrc: |
|
269 | 269 | |
|
270 | 270 | [merge-tools] |
|
271 | 271 | # Override stock tool location |
|
272 | 272 | kdiff3.executable = ~/bin/kdiff3 |
|
273 | 273 | # Specify command line |
|
274 | 274 | kdiff3.args = $base $local $other -o $output |
|
275 | 275 | # Give higher priority |
|
276 | 276 | kdiff3.priority = 1 |
|
277 | 277 | |
|
278 | 278 | # Define new tool |
|
279 | 279 | myHtmlTool.args = -m $local $other $base $output |
|
280 | 280 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
281 | 281 | myHtmlTool.priority = 1 |
|
282 | 282 | |
|
283 | 283 | Supported arguments: |
|
284 | ||
|
284 | 285 | priority;; |
|
285 | 286 | The priority in which to evaluate this tool. |
|
286 | 287 | Default: 0. |
|
287 | 288 | executable;; |
|
288 | 289 | Either just the name of the executable or its pathname. |
|
289 | 290 | Default: the tool name. |
|
290 | 291 | args;; |
|
291 | 292 | The arguments to pass to the tool executable. You can refer to the files |
|
292 | 293 | being merged as well as the output file through these variables: $base, |
|
293 | 294 | $local, $other, $output. |
|
294 | 295 | Default: $local $base $other |
|
295 | 296 | premerge;; |
|
296 | 297 | Attempt to run internal non-interactive 3-way merge tool before |
|
297 | 298 | launching external tool. |
|
298 | 299 | Default: True |
|
299 | 300 | binary;; |
|
300 | 301 | This tool can merge binary files. Defaults to False, unless tool |
|
301 | 302 | was selected by file pattern match. |
|
302 | 303 | symlink;; |
|
303 | 304 | This tool can merge symlinks. Defaults to False, even if tool was |
|
304 | 305 | selected by file pattern match. |
|
305 | 306 | checkconflicts;; |
|
306 | 307 | Check whether there are conflicts even though the tool reported |
|
307 | 308 | success. |
|
308 | 309 | Default: False |
|
309 | 310 | checkchanged;; |
|
310 | 311 | Check whether outputs were written even though the tool reported |
|
311 | 312 | success. |
|
312 | 313 | Default: False |
|
313 | 314 | fixeol;; |
|
314 | 315 | Attempt to fix up EOL changes caused by the merge tool. |
|
315 | 316 | Default: False |
|
316 |
gui |
|
|
317 | gui;; | |
|
317 | 318 | This tool requires a graphical interface to run. Default: False |
|
318 | 319 | regkey;; |
|
319 | 320 | Windows registry key which describes install location of this tool. |
|
320 | 321 | Mercurial will search for this key first under HKEY_CURRENT_USER and |
|
321 | 322 | then under HKEY_LOCAL_MACHINE. Default: None |
|
322 | 323 | regname;; |
|
323 | 324 | Name of value to read from specified registry key. Defaults to the |
|
324 | 325 | unnamed (default) value. |
|
325 | 326 | regappend;; |
|
326 | 327 | String to append to the value read from the registry, typically the |
|
327 | 328 | executable name of the tool. Default: None |
|
328 | 329 | |
|
329 | 330 | hooks:: |
|
330 | 331 | Commands or Python functions that get automatically executed by |
|
331 | 332 | various actions such as starting or finishing a commit. Multiple |
|
332 | 333 | hooks can be run for the same action by appending a suffix to the |
|
333 | 334 | action. Overriding a site-wide hook can be done by changing its |
|
334 | 335 | value or setting it to an empty string. |
|
335 | 336 | |
|
336 | 337 | Example .hg/hgrc: |
|
337 | 338 | |
|
338 | 339 | [hooks] |
|
339 | 340 | # do not use the site-wide hook |
|
340 | 341 | incoming = |
|
341 | 342 | incoming.email = /my/email/hook |
|
342 | 343 | incoming.autobuild = /my/build/hook |
|
343 | 344 | |
|
344 | 345 | Most hooks are run with environment variables set that give added |
|
345 | 346 | useful information. For each hook below, the environment variables |
|
346 | 347 | it is passed are listed with names of the form "$HG_foo". |
|
347 | 348 | |
|
348 | 349 | changegroup;; |
|
349 | 350 | Run after a changegroup has been added via push, pull or |
|
350 | 351 | unbundle. ID of the first new changeset is in $HG_NODE. URL from |
|
351 | 352 | which changes came is in $HG_URL. |
|
352 | 353 | commit;; |
|
353 | 354 | Run after a changeset has been created in the local repository. |
|
354 | 355 | ID of the newly created changeset is in $HG_NODE. Parent |
|
355 | 356 | changeset IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
356 | 357 | incoming;; |
|
357 | 358 | Run after a changeset has been pulled, pushed, or unbundled into |
|
358 | 359 | the local repository. The ID of the newly arrived changeset is in |
|
359 | 360 | $HG_NODE. URL that was source of changes came is in $HG_URL. |
|
360 | 361 | outgoing;; |
|
361 | 362 | Run after sending changes from local repository to another. ID of |
|
362 | 363 | first changeset sent is in $HG_NODE. Source of operation is in |
|
363 | 364 | $HG_SOURCE; see "preoutgoing" hook for description. |
|
364 | 365 | post-<command>;; |
|
365 | 366 | Run after successful invocations of the associated command. The |
|
366 | 367 | contents of the command line are passed as $HG_ARGS and the result |
|
367 | 368 | code in $HG_RESULT. Hook failure is ignored. |
|
368 | 369 | pre-<command>;; |
|
369 | 370 | Run before executing the associated command. The contents of the |
|
370 | 371 | command line are passed as $HG_ARGS. If the hook returns failure, |
|
371 | 372 | the command doesn't execute and Mercurial returns the failure code. |
|
372 | 373 | prechangegroup;; |
|
373 | 374 | Run before a changegroup is added via push, pull or unbundle. |
|
374 | 375 | Exit status 0 allows the changegroup to proceed. Non-zero status |
|
375 | 376 | will cause the push, pull or unbundle to fail. URL from which |
|
376 | 377 | changes will come is in $HG_URL. |
|
377 | 378 | precommit;; |
|
378 | 379 | Run before starting a local commit. Exit status 0 allows the |
|
379 | 380 | commit to proceed. Non-zero status will cause the commit to fail. |
|
380 | 381 | Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
381 | 382 | preoutgoing;; |
|
382 | 383 | Run before collecting changes to send from the local repository to |
|
383 | 384 | another. Non-zero status will cause failure. This lets you |
|
384 | 385 | prevent pull over http or ssh. Also prevents against local pull, |
|
385 | 386 | push (outbound) or bundle commands, but not effective, since you |
|
386 | 387 | can just copy files instead then. Source of operation is in |
|
387 | 388 | $HG_SOURCE. If "serve", operation is happening on behalf of |
|
388 | 389 | remote ssh or http repository. If "push", "pull" or "bundle", |
|
389 | 390 | operation is happening on behalf of repository on same system. |
|
390 | 391 | pretag;; |
|
391 | 392 | Run before creating a tag. Exit status 0 allows the tag to be |
|
392 | 393 | created. Non-zero status will cause the tag to fail. ID of |
|
393 | 394 | changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag |
|
394 | 395 | is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0. |
|
395 | 396 | pretxnchangegroup;; |
|
396 | 397 | Run after a changegroup has been added via push, pull or unbundle, |
|
397 | 398 | but before the transaction has been committed. Changegroup is |
|
398 | 399 | visible to hook program. This lets you validate incoming changes |
|
399 | 400 | before accepting them. Passed the ID of the first new changeset |
|
400 | 401 | in $HG_NODE. Exit status 0 allows the transaction to commit. |
|
401 | 402 | Non-zero status will cause the transaction to be rolled back and |
|
402 | 403 | the push, pull or unbundle will fail. URL that was source of |
|
403 | 404 | changes is in $HG_URL. |
|
404 | 405 | pretxncommit;; |
|
405 | 406 | Run after a changeset has been created but the transaction not yet |
|
406 | 407 | committed. Changeset is visible to hook program. This lets you |
|
407 | 408 | validate commit message and changes. Exit status 0 allows the |
|
408 | 409 | commit to proceed. Non-zero status will cause the transaction to |
|
409 | 410 | be rolled back. ID of changeset is in $HG_NODE. Parent changeset |
|
410 | 411 | IDs are in $HG_PARENT1 and $HG_PARENT2. |
|
411 | 412 | preupdate;; |
|
412 | 413 | Run before updating the working directory. Exit status 0 allows |
|
413 | 414 | the update to proceed. Non-zero status will prevent the update. |
|
414 | 415 | Changeset ID of first new parent is in $HG_PARENT1. If merge, ID |
|
415 | 416 | of second new parent is in $HG_PARENT2. |
|
416 | 417 | tag;; |
|
417 | 418 | Run after a tag is created. ID of tagged changeset is in |
|
418 | 419 | $HG_NODE. Name of tag is in $HG_TAG. Tag is local if |
|
419 | 420 | $HG_LOCAL=1, in repo if $HG_LOCAL=0. |
|
420 | 421 | update;; |
|
421 | 422 | Run after updating the working directory. Changeset ID of first |
|
422 | 423 | new parent is in $HG_PARENT1. If merge, ID of second new parent |
|
423 | 424 | is in $HG_PARENT2. If update succeeded, $HG_ERROR=0. If update |
|
424 | 425 | failed (e.g. because conflicts not resolved), $HG_ERROR=1. |
|
425 | 426 | |
|
426 | 427 | Note: it is generally better to use standard hooks rather than the |
|
427 | 428 | generic pre- and post- command hooks as they are guaranteed to be |
|
428 | 429 | called in the appropriate contexts for influencing transactions. |
|
429 | 430 | Also, hooks like "commit" will be called in all contexts that |
|
430 | 431 | generate a commit (eg. tag) and not just the commit command. |
|
431 | 432 | |
|
432 | 433 | Note2: Environment variables with empty values may not be passed to |
|
433 | 434 | hooks on platforms like Windows. For instance, $HG_PARENT2 will |
|
434 | 435 | not be available under Windows for non-merge changesets while being |
|
435 | 436 | set to an empty value under Unix-like systems. |
|
436 | 437 | |
|
437 | 438 | The syntax for Python hooks is as follows: |
|
438 | 439 | |
|
439 | 440 | hookname = python:modulename.submodule.callable |
|
440 | 441 | |
|
441 | 442 | Python hooks are run within the Mercurial process. Each hook is |
|
442 | 443 | called with at least three keyword arguments: a ui object (keyword |
|
443 | 444 | "ui"), a repository object (keyword "repo"), and a "hooktype" |
|
444 | 445 | keyword that tells what kind of hook is used. Arguments listed as |
|
445 | 446 | environment variables above are passed as keyword arguments, with no |
|
446 | 447 | "HG_" prefix, and names in lower case. |
|
447 | 448 | |
|
448 | 449 | If a Python hook returns a "true" value or raises an exception, this |
|
449 | 450 | is treated as failure of the hook. |
|
450 | 451 | |
|
451 | 452 | http_proxy:: |
|
452 | 453 | Used to access web-based Mercurial repositories through a HTTP |
|
453 | 454 | proxy. |
|
454 | 455 | host;; |
|
455 | 456 | Host name and (optional) port of the proxy server, for example |
|
456 | 457 | "myproxy:8000". |
|
457 | 458 | no;; |
|
458 | 459 | Optional. Comma-separated list of host names that should bypass |
|
459 | 460 | the proxy. |
|
460 | 461 | passwd;; |
|
461 | 462 | Optional. Password to authenticate with at the proxy server. |
|
462 | 463 | user;; |
|
463 | 464 | Optional. User name to authenticate with at the proxy server. |
|
464 | 465 | |
|
465 | 466 | smtp:: |
|
466 | 467 | Configuration for extensions that need to send email messages. |
|
467 | 468 | host;; |
|
468 | 469 | Host name of mail server, e.g. "mail.example.com". |
|
469 | 470 | port;; |
|
470 | 471 | Optional. Port to connect to on mail server. Default: 25. |
|
471 | 472 | tls;; |
|
472 | 473 | Optional. Whether to connect to mail server using TLS. True or |
|
473 | 474 | False. Default: False. |
|
474 | 475 | username;; |
|
475 | 476 | Optional. User name to authenticate to SMTP server with. |
|
476 | 477 | If username is specified, password must also be specified. |
|
477 | 478 | Default: none. |
|
478 | 479 | password;; |
|
479 | 480 | Optional. Password to authenticate to SMTP server with. |
|
480 | 481 | If username is specified, password must also be specified. |
|
481 | 482 | Default: none. |
|
482 | 483 | local_hostname;; |
|
483 | 484 | Optional. It's the hostname that the sender can use to identify itself |
|
484 | 485 | to the MTA. |
|
485 | 486 | |
|
486 | 487 | paths:: |
|
487 | 488 | Assigns symbolic names to repositories. The left side is the |
|
488 | 489 | symbolic name, and the right gives the directory or URL that is the |
|
489 | 490 | location of the repository. Default paths can be declared by |
|
490 | 491 | setting the following entries. |
|
491 | 492 | default;; |
|
492 | 493 | Directory or URL to use when pulling if no source is specified. |
|
493 | 494 | Default is set to repository from which the current repository |
|
494 | 495 | was cloned. |
|
495 | 496 | default-push;; |
|
496 | 497 | Optional. Directory or URL to use when pushing if no destination |
|
497 | 498 | is specified. |
|
498 | 499 | |
|
499 | 500 | server:: |
|
500 | 501 | Controls generic server settings. |
|
501 | 502 | uncompressed;; |
|
502 | 503 | Whether to allow clients to clone a repo using the uncompressed |
|
503 | 504 | streaming protocol. This transfers about 40% more data than a |
|
504 | 505 | regular clone, but uses less memory and CPU on both server and |
|
505 | 506 | client. Over a LAN (100Mbps or better) or a very fast WAN, an |
|
506 | 507 | uncompressed streaming clone is a lot faster (~10x) than a regular |
|
507 | 508 | clone. Over most WAN connections (anything slower than about |
|
508 | 509 | 6Mbps), uncompressed streaming is slower, because of the extra |
|
509 | 510 | data transfer overhead. Default is False. |
|
510 | 511 | |
|
511 | 512 | trusted:: |
|
512 | 513 | For security reasons, Mercurial will not use the settings in |
|
513 | 514 | the .hg/hgrc file from a repository if it doesn't belong to a |
|
514 | 515 | trusted user or to a trusted group. The main exception is the |
|
515 | 516 | web interface, which automatically uses some safe settings, since |
|
516 | 517 | it's common to serve repositories from different users. |
|
517 | 518 | |
|
518 | 519 | This section specifies what users and groups are trusted. The |
|
519 | 520 | current user is always trusted. To trust everybody, list a user |
|
520 | 521 | or a group with name "*". |
|
521 | 522 | |
|
522 | 523 | users;; |
|
523 | 524 | Comma-separated list of trusted users. |
|
524 | 525 | groups;; |
|
525 | 526 | Comma-separated list of trusted groups. |
|
526 | 527 | |
|
527 | 528 | ui:: |
|
528 | 529 | User interface controls. |
|
529 | 530 | archivemeta;; |
|
530 | 531 | Whether to include the .hg_archival.txt file containing metadata |
|
531 | 532 | (hashes for the repository base and for tip) in archives created by |
|
532 | 533 | the hg archive command or downloaded via hgweb. |
|
533 | 534 | Default is true. |
|
534 | 535 | debug;; |
|
535 | 536 | Print debugging information. True or False. Default is False. |
|
536 | 537 | editor;; |
|
537 | 538 | The editor to use during a commit. Default is $EDITOR or "vi". |
|
538 | 539 | fallbackencoding;; |
|
539 | 540 | Encoding to try if it's not possible to decode the changelog using |
|
540 | 541 | UTF-8. Default is ISO-8859-1. |
|
541 | 542 | ignore;; |
|
542 | 543 | A file to read per-user ignore patterns from. This file should be in |
|
543 | 544 | the same format as a repository-wide .hgignore file. This option |
|
544 | 545 | supports hook syntax, so if you want to specify multiple ignore |
|
545 | 546 | files, you can do so by setting something like |
|
546 | 547 | "ignore.other = ~/.hgignore2". For details of the ignore file |
|
547 | 548 | format, see the hgignore(5) man page. |
|
548 | 549 | interactive;; |
|
549 | 550 | Allow to prompt the user. True or False. Default is True. |
|
550 | 551 | logtemplate;; |
|
551 | 552 | Template string for commands that print changesets. |
|
552 | 553 | merge;; |
|
553 | 554 | The conflict resolution program to use during a manual merge. |
|
554 | 555 | There are some internal tools available: |
|
555 | 556 | |
|
556 | 557 | internal:local;; |
|
557 | 558 | keep the local version |
|
558 | 559 | internal:other;; |
|
559 | 560 | use the other version |
|
560 | 561 | internal:merge;; |
|
561 | 562 | use the internal non-interactive merge tool |
|
562 | 563 | internal:fail;; |
|
563 | 564 | fail to merge |
|
564 | 565 | |
|
565 | 566 | See the merge-tools section for more information on configuring tools. |
|
567 | ||
|
566 | 568 | patch;; |
|
567 | 569 | command to use to apply patches. Look for 'gpatch' or 'patch' in PATH if |
|
568 | 570 | unset. |
|
569 | 571 | quiet;; |
|
570 | 572 | Reduce the amount of output printed. True or False. Default is False. |
|
571 | 573 | remotecmd;; |
|
572 | 574 | remote command to use for clone/push/pull operations. Default is 'hg'. |
|
573 | 575 | report_untrusted;; |
|
574 | 576 | Warn if a .hg/hgrc file is ignored due to not being owned by a |
|
575 | 577 | trusted user or group. True or False. Default is True. |
|
576 | 578 | slash;; |
|
577 | 579 | Display paths using a slash ("/") as the path separator. This only |
|
578 | 580 | makes a difference on systems where the default path separator is not |
|
579 | 581 | the slash character (e.g. Windows uses the backslash character ("\")). |
|
580 | 582 | Default is False. |
|
581 | 583 | ssh;; |
|
582 | 584 | command to use for SSH connections. Default is 'ssh'. |
|
583 | 585 | strict;; |
|
584 | 586 | Require exact command names, instead of allowing unambiguous |
|
585 | 587 | abbreviations. True or False. Default is False. |
|
586 | 588 | style;; |
|
587 | 589 | Name of style to use for command output. |
|
588 | 590 | timeout;; |
|
589 | 591 | The timeout used when a lock is held (in seconds), a negative value |
|
590 | 592 | means no timeout. Default is 600. |
|
591 | 593 | username;; |
|
592 | 594 | The committer of a changeset created when running "commit". |
|
593 | 595 | Typically a person's name and email address, e.g. "Fred Widget |
|
594 | 596 | <fred@example.com>". Default is $EMAIL or username@hostname. |
|
595 | 597 | If the username in hgrc is empty, it has to be specified manually or |
|
596 | 598 | in a different hgrc file (e.g. $HOME/.hgrc, if the admin set "username =" |
|
597 | 599 | in the system hgrc). |
|
598 | 600 | verbose;; |
|
599 | 601 | Increase the amount of output printed. True or False. Default is False. |
|
600 | 602 | |
|
601 | 603 | |
|
602 | 604 | web:: |
|
603 | 605 | Web interface configuration. |
|
604 | 606 | accesslog;; |
|
605 | 607 | Where to output the access log. Default is stdout. |
|
606 | 608 | address;; |
|
607 | 609 | Interface address to bind to. Default is all. |
|
608 | 610 | allow_archive;; |
|
609 | 611 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
610 | 612 | Default is empty. |
|
611 | 613 | allowbz2;; |
|
612 | 614 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repo revisions. |
|
613 | 615 | Default is false. |
|
614 | 616 | allowgz;; |
|
615 | 617 | (DEPRECATED) Whether to allow .tar.gz downloading of repo revisions. |
|
616 | 618 | Default is false. |
|
617 | 619 | allowpull;; |
|
618 | 620 | Whether to allow pulling from the repository. Default is true. |
|
619 | 621 | allow_push;; |
|
620 | 622 | Whether to allow pushing to the repository. If empty or not set, |
|
621 | 623 | push is not allowed. If the special value "*", any remote user |
|
622 | 624 | can push, including unauthenticated users. Otherwise, the remote |
|
623 | 625 | user must have been authenticated, and the authenticated user name |
|
624 | 626 | must be present in this list (separated by whitespace or ","). |
|
625 | 627 | The contents of the allow_push list are examined after the |
|
626 | 628 | deny_push list. |
|
627 | 629 | allowzip;; |
|
628 | 630 | (DEPRECATED) Whether to allow .zip downloading of repo revisions. |
|
629 | 631 | Default is false. This feature creates temporary files. |
|
630 | 632 | baseurl;; |
|
631 | 633 | Base URL to use when publishing URLs in other locations, so |
|
632 | 634 | third-party tools like email notification hooks can construct URLs. |
|
633 | 635 | Example: "http://hgserver/repos/" |
|
634 | 636 | contact;; |
|
635 | 637 | Name or email address of the person in charge of the repository. |
|
636 | 638 | Defaults to ui.username or $EMAIL or "unknown" if unset or empty. |
|
637 | 639 | deny_push;; |
|
638 | 640 | Whether to deny pushing to the repository. If empty or not set, |
|
639 | 641 | push is not denied. If the special value "*", all remote users |
|
640 | 642 | are denied push. Otherwise, unauthenticated users are all denied, |
|
641 | 643 | and any authenticated user name present in this list (separated by |
|
642 | 644 | whitespace or ",") is also denied. The contents of the deny_push |
|
643 | 645 | list are examined before the allow_push list. |
|
644 | 646 | description;; |
|
645 | 647 | Textual description of the repository's purpose or contents. |
|
646 | 648 | Default is "unknown". |
|
647 | 649 | encoding;; |
|
648 | 650 | Character encoding name. |
|
649 | 651 | Example: "UTF-8" |
|
650 | 652 | errorlog;; |
|
651 | 653 | Where to output the error log. Default is stderr. |
|
652 | 654 | hidden;; |
|
653 | 655 | Whether to hide the repository in the hgwebdir index. Default is false. |
|
654 | 656 | ipv6;; |
|
655 | 657 | Whether to use IPv6. Default is false. |
|
656 | 658 | name;; |
|
657 | 659 | Repository name to use in the web interface. Default is current |
|
658 | 660 | working directory. |
|
659 | 661 | maxchanges;; |
|
660 | 662 | Maximum number of changes to list on the changelog. Default is 10. |
|
661 | 663 | maxfiles;; |
|
662 | 664 | Maximum number of files to list per changeset. Default is 10. |
|
663 | 665 | port;; |
|
664 | 666 | Port to listen on. Default is 8000. |
|
665 | 667 | prefix;; |
|
666 | 668 | Prefix path to serve from. Default is '' (server root). |
|
667 | 669 | push_ssl;; |
|
668 | 670 | Whether to require that inbound pushes be transported over SSL to |
|
669 | 671 | prevent password sniffing. Default is true. |
|
670 | 672 | staticurl;; |
|
671 | 673 | Base URL to use for static files. If unset, static files (e.g. |
|
672 | 674 | the hgicon.png favicon) will be served by the CGI script itself. |
|
673 | 675 | Use this setting to serve them directly with the HTTP server. |
|
674 | 676 | Example: "http://hgserver/static/" |
|
675 | 677 | stripes;; |
|
676 | 678 | How many lines a "zebra stripe" should span in multiline output. |
|
677 | 679 | Default is 1; set to 0 to disable. |
|
678 | 680 | style;; |
|
679 | 681 | Which template map style to use. |
|
680 | 682 | templates;; |
|
681 | 683 | Where to find the HTML templates. Default is install path. |
|
682 | 684 | |
|
683 | 685 | |
|
684 | 686 | AUTHOR |
|
685 | 687 | ------ |
|
686 | 688 | Bryan O'Sullivan <bos@serpentine.com>. |
|
687 | 689 | |
|
688 | 690 | Mercurial was written by Matt Mackall <mpm@selenic.com>. |
|
689 | 691 | |
|
690 | 692 | SEE ALSO |
|
691 | 693 | -------- |
|
692 | 694 | hg(1), hgignore(5) |
|
693 | 695 | |
|
694 | 696 | COPYING |
|
695 | 697 | ------- |
|
696 | 698 | This manual page is copyright 2005 Bryan O'Sullivan. |
|
697 | 699 | Mercurial is copyright 2005-2007 Matt Mackall. |
|
698 | 700 | Free use of this software is granted under the terms of the GNU General |
|
699 | 701 | Public License (GPL). |
General Comments 0
You need to be logged in to leave comments.
Login now