##// END OF EJS Templates
Update test and man page for multiple matching encode/decode filters
Mads Kiilerich -
r10211:a474f950 stable
parent child Browse files
Show More
@@ -1,955 +1,956
1 ======
1 ======
2 hgrc
2 hgrc
3 ======
3 ======
4
4
5 ---------------------------------
5 ---------------------------------
6 configuration files for Mercurial
6 configuration files for Mercurial
7 ---------------------------------
7 ---------------------------------
8
8
9 :Author: Bryan O'Sullivan <bos@serpentine.com>
9 :Author: Bryan O'Sullivan <bos@serpentine.com>
10 :Organization: Mercurial
10 :Organization: Mercurial
11 :Manual section: 5
11 :Manual section: 5
12 :Manual group: Mercurial Manual
12 :Manual group: Mercurial Manual
13
13
14 .. contents::
14 .. contents::
15 :backlinks: top
15 :backlinks: top
16 :class: htmlonly
16 :class: htmlonly
17
17
18
18
19 Synopsis
19 Synopsis
20 --------
20 --------
21
21
22 The Mercurial system uses a set of configuration files to control
22 The Mercurial system uses a set of configuration files to control
23 aspects of its behavior.
23 aspects of its behavior.
24
24
25 Files
25 Files
26 -----
26 -----
27
27
28 Mercurial reads configuration data from several files, if they exist.
28 Mercurial reads configuration data from several files, if they exist.
29 The names of these files depend on the system on which Mercurial is
29 The names of these files depend on the system on which Mercurial is
30 installed. ``*.rc`` files from a single directory are read in
30 installed. ``*.rc`` files from a single directory are read in
31 alphabetical order, later ones overriding earlier ones. Where multiple
31 alphabetical order, later ones overriding earlier ones. Where multiple
32 paths are given below, settings from earlier paths override later
32 paths are given below, settings from earlier paths override later
33 ones.
33 ones.
34
34
35 | (Unix, Windows) ``<repo>/.hg/hgrc``
35 | (Unix, Windows) ``<repo>/.hg/hgrc``
36
36
37 Per-repository configuration options that only apply in a
37 Per-repository configuration options that only apply in a
38 particular repository. This file is not version-controlled, and
38 particular repository. This file is not version-controlled, and
39 will not get transferred during a "clone" operation. Options in
39 will not get transferred during a "clone" operation. Options in
40 this file override options in all other configuration files. On
40 this file override options in all other configuration files. On
41 Unix, most of this file will be ignored if it doesn't belong to a
41 Unix, most of this file will be ignored if it doesn't belong to a
42 trusted user or to a trusted group. See the documentation for the
42 trusted user or to a trusted group. See the documentation for the
43 trusted_ section below for more details.
43 trusted_ section below for more details.
44
44
45 | (Unix) ``$HOME/.hgrc``
45 | (Unix) ``$HOME/.hgrc``
46 | (Windows) ``%USERPROFILE%\.hgrc``
46 | (Windows) ``%USERPROFILE%\.hgrc``
47 | (Windows) ``%USERPROFILE%\Mercurial.ini``
47 | (Windows) ``%USERPROFILE%\Mercurial.ini``
48 | (Windows) ``%HOME%\.hgrc``
48 | (Windows) ``%HOME%\.hgrc``
49 | (Windows) ``%HOME%\Mercurial.ini``
49 | (Windows) ``%HOME%\Mercurial.ini``
50
50
51 Per-user configuration file(s), for the user running Mercurial. On
51 Per-user configuration file(s), for the user running Mercurial. On
52 Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
52 Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
53 files apply to all Mercurial commands executed by this user in any
53 files apply to all Mercurial commands executed by this user in any
54 directory. Options in these files override per-system and per-installation
54 directory. Options in these files override per-system and per-installation
55 options.
55 options.
56
56
57 | (Unix) ``/etc/mercurial/hgrc``
57 | (Unix) ``/etc/mercurial/hgrc``
58 | (Unix) ``/etc/mercurial/hgrc.d/*.rc``
58 | (Unix) ``/etc/mercurial/hgrc.d/*.rc``
59
59
60 Per-system configuration files, for the system on which Mercurial
60 Per-system configuration files, for the system on which Mercurial
61 is running. Options in these files apply to all Mercurial commands
61 is running. Options in these files apply to all Mercurial commands
62 executed by any user in any directory. Options in these files
62 executed by any user in any directory. Options in these files
63 override per-installation options.
63 override per-installation options.
64
64
65 | (Unix) ``<install-root>/etc/mercurial/hgrc``
65 | (Unix) ``<install-root>/etc/mercurial/hgrc``
66 | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc``
66 | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc``
67
67
68 Per-installation configuration files, searched for in the
68 Per-installation configuration files, searched for in the
69 directory where Mercurial is installed. ``<install-root>`` is the
69 directory where Mercurial is installed. ``<install-root>`` is the
70 parent directory of the **hg** executable (or symlink) being run. For
70 parent directory of the **hg** executable (or symlink) being run. For
71 example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
71 example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
72 in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
72 in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
73 to all Mercurial commands executed by any user in any directory.
73 to all Mercurial commands executed by any user in any directory.
74
74
75 | (Windows) ``C:\Mercurial\Mercurial.ini``
75 | (Windows) ``C:\Mercurial\Mercurial.ini``
76 | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
76 | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
77 | (Windows) ``<install-dir>\Mercurial.ini``
77 | (Windows) ``<install-dir>\Mercurial.ini``
78
78
79 Per-installation/system configuration files, for the system on
79 Per-installation/system configuration files, for the system on
80 which Mercurial is running. Options in these files apply to all
80 which Mercurial is running. Options in these files apply to all
81 Mercurial commands executed by any user in any directory. Registry
81 Mercurial commands executed by any user in any directory. Registry
82 keys contain PATH-like strings, every part of which must reference
82 keys contain PATH-like strings, every part of which must reference
83 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
83 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
84 be read.
84 be read.
85
85
86 Syntax
86 Syntax
87 ------
87 ------
88
88
89 A configuration file consists of sections, led by a ``[section]`` header
89 A configuration file consists of sections, led by a ``[section]`` header
90 and followed by ``name = value`` entries::
90 and followed by ``name = value`` entries::
91
91
92 [spam]
92 [spam]
93 eggs=ham
93 eggs=ham
94 green=
94 green=
95 eggs
95 eggs
96
96
97 Each line contains one entry. If the lines that follow are indented,
97 Each line contains one entry. If the lines that follow are indented,
98 they are treated as continuations of that entry. Leading whitespace is
98 they are treated as continuations of that entry. Leading whitespace is
99 removed from values. Empty lines are skipped. Lines beginning with
99 removed from values. Empty lines are skipped. Lines beginning with
100 ``#`` or ``;`` are ignored and may be used to provide comments.
100 ``#`` or ``;`` are ignored and may be used to provide comments.
101
101
102 A line of the form ``%include file`` will include ``file`` into the
102 A line of the form ``%include file`` will include ``file`` into the
103 current configuration file. The inclusion is recursive, which means
103 current configuration file. The inclusion is recursive, which means
104 that included files can include other files. Filenames are relative to
104 that included files can include other files. Filenames are relative to
105 the configuration file in which the ``%include`` directive is found.
105 the configuration file in which the ``%include`` directive is found.
106
106
107 A line with ``%unset name`` will remove ``name`` from the current
107 A line with ``%unset name`` will remove ``name`` from the current
108 section, if it has been set previously.
108 section, if it has been set previously.
109
109
110
110
111 Sections
111 Sections
112 --------
112 --------
113
113
114 This section describes the different sections that may appear in a
114 This section describes the different sections that may appear in a
115 Mercurial "hgrc" file, the purpose of each section, its possible keys,
115 Mercurial "hgrc" file, the purpose of each section, its possible keys,
116 and their possible values.
116 and their possible values.
117
117
118 ``alias``
118 ``alias``
119 """""""""
119 """""""""
120 Defines command aliases.
120 Defines command aliases.
121 Aliases allow you to define your own commands in terms of other
121 Aliases allow you to define your own commands in terms of other
122 commands (or aliases), optionally including arguments.
122 commands (or aliases), optionally including arguments.
123
123
124 Alias definitions consist of lines of the form::
124 Alias definitions consist of lines of the form::
125
125
126 <alias> = <command> [<argument]...
126 <alias> = <command> [<argument]...
127
127
128 For example, this definition::
128 For example, this definition::
129
129
130 latest = log --limit 5
130 latest = log --limit 5
131
131
132 creates a new command ``latest`` that shows only the five most recent
132 creates a new command ``latest`` that shows only the five most recent
133 changesets. You can define subsequent aliases using earlier ones::
133 changesets. You can define subsequent aliases using earlier ones::
134
134
135 stable5 = latest -b stable
135 stable5 = latest -b stable
136
136
137 .. note:: It is possible to create aliases with the same names as
137 .. note:: It is possible to create aliases with the same names as
138 existing commands, which will then override the original
138 existing commands, which will then override the original
139 definitions. This is almost always a bad idea!
139 definitions. This is almost always a bad idea!
140
140
141
141
142 ``auth``
142 ``auth``
143 """"""""
143 """"""""
144 Authentication credentials for HTTP authentication. Each line has
144 Authentication credentials for HTTP authentication. Each line has
145 the following format::
145 the following format::
146
146
147 <name>.<argument> = <value>
147 <name>.<argument> = <value>
148
148
149 where ``<name>`` is used to group arguments into authentication
149 where ``<name>`` is used to group arguments into authentication
150 entries. Example::
150 entries. Example::
151
151
152 foo.prefix = hg.intevation.org/mercurial
152 foo.prefix = hg.intevation.org/mercurial
153 foo.username = foo
153 foo.username = foo
154 foo.password = bar
154 foo.password = bar
155 foo.schemes = http https
155 foo.schemes = http https
156
156
157 bar.prefix = secure.example.org
157 bar.prefix = secure.example.org
158 bar.key = path/to/file.key
158 bar.key = path/to/file.key
159 bar.cert = path/to/file.cert
159 bar.cert = path/to/file.cert
160 bar.schemes = https
160 bar.schemes = https
161
161
162 Supported arguments:
162 Supported arguments:
163
163
164 ``prefix``
164 ``prefix``
165 Either ``*`` or a URI prefix with or without the scheme part.
165 Either ``*`` or a URI prefix with or without the scheme part.
166 The authentication entry with the longest matching prefix is used
166 The authentication entry with the longest matching prefix is used
167 (where ``*`` matches everything and counts as a match of length
167 (where ``*`` matches everything and counts as a match of length
168 1). If the prefix doesn't include a scheme, the match is performed
168 1). If the prefix doesn't include a scheme, the match is performed
169 against the URI with its scheme stripped as well, and the schemes
169 against the URI with its scheme stripped as well, and the schemes
170 argument, q.v., is then subsequently consulted.
170 argument, q.v., is then subsequently consulted.
171 ``username``
171 ``username``
172 Optional. Username to authenticate with. If not given, and the
172 Optional. Username to authenticate with. If not given, and the
173 remote site requires basic or digest authentication, the user
173 remote site requires basic or digest authentication, the user
174 will be prompted for it.
174 will be prompted for it.
175 ``password``
175 ``password``
176 Optional. Password to authenticate with. If not given, and the
176 Optional. Password to authenticate with. If not given, and the
177 remote site requires basic or digest authentication, the user
177 remote site requires basic or digest authentication, the user
178 will be prompted for it.
178 will be prompted for it.
179 ``key``
179 ``key``
180 Optional. PEM encoded client certificate key file.
180 Optional. PEM encoded client certificate key file.
181 ``cert``
181 ``cert``
182 Optional. PEM encoded client certificate chain file.
182 Optional. PEM encoded client certificate chain file.
183 ``schemes``
183 ``schemes``
184 Optional. Space separated list of URI schemes to use this
184 Optional. Space separated list of URI schemes to use this
185 authentication entry with. Only used if the prefix doesn't include
185 authentication entry with. Only used if the prefix doesn't include
186 a scheme. Supported schemes are http and https. They will match
186 a scheme. Supported schemes are http and https. They will match
187 static-http and static-https respectively, as well.
187 static-http and static-https respectively, as well.
188 Default: https.
188 Default: https.
189
189
190 If no suitable authentication entry is found, the user is prompted
190 If no suitable authentication entry is found, the user is prompted
191 for credentials as usual if required by the remote.
191 for credentials as usual if required by the remote.
192
192
193
193
194 ``decode/encode``
194 ``decode/encode``
195 """""""""""""""""
195 """""""""""""""""
196 Filters for transforming files on checkout/checkin. This would
196 Filters for transforming files on checkout/checkin. This would
197 typically be used for newline processing or other
197 typically be used for newline processing or other
198 localization/canonicalization of files.
198 localization/canonicalization of files.
199
199
200 Filters consist of a filter pattern followed by a filter command.
200 Filters consist of a filter pattern followed by a filter command.
201 Filter patterns are globs by default, rooted at the repository root.
201 Filter patterns are globs by default, rooted at the repository root.
202 For example, to match any file ending in ``.txt`` in the root
202 For example, to match any file ending in ``.txt`` in the root
203 directory only, use the pattern ``*.txt``. To match any file ending
203 directory only, use the pattern ``*.txt``. To match any file ending
204 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
204 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
205 For each file only the first matching filter applies.
205
206
206 The filter command can start with a specifier, either ``pipe:`` or
207 The filter command can start with a specifier, either ``pipe:`` or
207 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
208 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
208
209
209 A ``pipe:`` command must accept data on stdin and return the transformed
210 A ``pipe:`` command must accept data on stdin and return the transformed
210 data on stdout.
211 data on stdout.
211
212
212 Pipe example::
213 Pipe example::
213
214
214 [encode]
215 [encode]
215 # uncompress gzip files on checkin to improve delta compression
216 # uncompress gzip files on checkin to improve delta compression
216 # note: not necessarily a good idea, just an example
217 # note: not necessarily a good idea, just an example
217 *.gz = pipe: gunzip
218 *.gz = pipe: gunzip
218
219
219 [decode]
220 [decode]
220 # recompress gzip files when writing them to the working dir (we
221 # recompress gzip files when writing them to the working dir (we
221 # can safely omit "pipe:", because it's the default)
222 # can safely omit "pipe:", because it's the default)
222 *.gz = gzip
223 *.gz = gzip
223
224
224 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
225 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
225 with the name of a temporary file that contains the data to be
226 with the name of a temporary file that contains the data to be
226 filtered by the command. The string ``OUTFILE`` is replaced with the name
227 filtered by the command. The string ``OUTFILE`` is replaced with the name
227 of an empty temporary file, where the filtered data must be written by
228 of an empty temporary file, where the filtered data must be written by
228 the command.
229 the command.
229
230
230 .. note:: The tempfile mechanism is recommended for Windows systems,
231 .. note:: The tempfile mechanism is recommended for Windows systems,
231 where the standard shell I/O redirection operators often have
232 where the standard shell I/O redirection operators often have
232 strange effects and may corrupt the contents of your files.
233 strange effects and may corrupt the contents of your files.
233
234
234 The most common usage is for LF <-> CRLF translation on Windows. For
235 The most common usage is for LF <-> CRLF translation on Windows. For
235 this, use the "smart" converters which check for binary files::
236 this, use the "smart" converters which check for binary files::
236
237
237 [extensions]
238 [extensions]
238 hgext.win32text =
239 hgext.win32text =
239 [encode]
240 [encode]
240 ** = cleverencode:
241 ** = cleverencode:
241 [decode]
242 [decode]
242 ** = cleverdecode:
243 ** = cleverdecode:
243
244
244 or if you only want to translate certain files::
245 or if you only want to translate certain files::
245
246
246 [extensions]
247 [extensions]
247 hgext.win32text =
248 hgext.win32text =
248 [encode]
249 [encode]
249 **.txt = dumbencode:
250 **.txt = dumbencode:
250 [decode]
251 [decode]
251 **.txt = dumbdecode:
252 **.txt = dumbdecode:
252
253
253
254
254 ``defaults``
255 ``defaults``
255 """"""""""""
256 """"""""""""
256
257
257 (defaults are deprecated. Don't use them. Use aliases instead)
258 (defaults are deprecated. Don't use them. Use aliases instead)
258
259
259 Use the ``[defaults]`` section to define command defaults, i.e. the
260 Use the ``[defaults]`` section to define command defaults, i.e. the
260 default options/arguments to pass to the specified commands.
261 default options/arguments to pass to the specified commands.
261
262
262 The following example makes ``hg log`` run in verbose mode, and ``hg
263 The following example makes ``hg log`` run in verbose mode, and ``hg
263 status`` show only the modified files, by default::
264 status`` show only the modified files, by default::
264
265
265 [defaults]
266 [defaults]
266 log = -v
267 log = -v
267 status = -m
268 status = -m
268
269
269 The actual commands, instead of their aliases, must be used when
270 The actual commands, instead of their aliases, must be used when
270 defining command defaults. The command defaults will also be applied
271 defining command defaults. The command defaults will also be applied
271 to the aliases of the commands defined.
272 to the aliases of the commands defined.
272
273
273
274
274 ``diff``
275 ``diff``
275 """"""""
276 """"""""
276
277
277 Settings used when displaying diffs. They are all Boolean and
278 Settings used when displaying diffs. They are all Boolean and
278 defaults to False.
279 defaults to False.
279
280
280 ``git``
281 ``git``
281 Use git extended diff format.
282 Use git extended diff format.
282 ``nodates``
283 ``nodates``
283 Don't include dates in diff headers.
284 Don't include dates in diff headers.
284 ``showfunc``
285 ``showfunc``
285 Show which function each change is in.
286 Show which function each change is in.
286 ``ignorews``
287 ``ignorews``
287 Ignore white space when comparing lines.
288 Ignore white space when comparing lines.
288 ``ignorewsamount``
289 ``ignorewsamount``
289 Ignore changes in the amount of white space.
290 Ignore changes in the amount of white space.
290 ``ignoreblanklines``
291 ``ignoreblanklines``
291 Ignore changes whose lines are all blank.
292 Ignore changes whose lines are all blank.
292
293
293 ``email``
294 ``email``
294 """""""""
295 """""""""
295 Settings for extensions that send email messages.
296 Settings for extensions that send email messages.
296
297
297 ``from``
298 ``from``
298 Optional. Email address to use in "From" header and SMTP envelope
299 Optional. Email address to use in "From" header and SMTP envelope
299 of outgoing messages.
300 of outgoing messages.
300 ``to``
301 ``to``
301 Optional. Comma-separated list of recipients' email addresses.
302 Optional. Comma-separated list of recipients' email addresses.
302 ``cc``
303 ``cc``
303 Optional. Comma-separated list of carbon copy recipients'
304 Optional. Comma-separated list of carbon copy recipients'
304 email addresses.
305 email addresses.
305 ``bcc``
306 ``bcc``
306 Optional. Comma-separated list of blind carbon copy recipients'
307 Optional. Comma-separated list of blind carbon copy recipients'
307 email addresses. Cannot be set interactively.
308 email addresses. Cannot be set interactively.
308 ``method``
309 ``method``
309 Optional. Method to use to send email messages. If value is ``smtp``
310 Optional. Method to use to send email messages. If value is ``smtp``
310 (default), use SMTP (see the SMTP_ section for configuration).
311 (default), use SMTP (see the SMTP_ section for configuration).
311 Otherwise, use as name of program to run that acts like sendmail
312 Otherwise, use as name of program to run that acts like sendmail
312 (takes ``-f`` option for sender, list of recipients on command line,
313 (takes ``-f`` option for sender, list of recipients on command line,
313 message on stdin). Normally, setting this to ``sendmail`` or
314 message on stdin). Normally, setting this to ``sendmail`` or
314 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
315 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
315 ``charsets``
316 ``charsets``
316 Optional. Comma-separated list of character sets considered
317 Optional. Comma-separated list of character sets considered
317 convenient for recipients. Addresses, headers, and parts not
318 convenient for recipients. Addresses, headers, and parts not
318 containing patches of outgoing messages will be encoded in the
319 containing patches of outgoing messages will be encoded in the
319 first character set to which conversion from local encoding
320 first character set to which conversion from local encoding
320 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
321 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
321 conversion fails, the text in question is sent as is. Defaults to
322 conversion fails, the text in question is sent as is. Defaults to
322 empty (explicit) list.
323 empty (explicit) list.
323
324
324 Order of outgoing email character sets:
325 Order of outgoing email character sets:
325
326
326 1. ``us-ascii``: always first, regardless of settings
327 1. ``us-ascii``: always first, regardless of settings
327 2. ``email.charsets``: in order given by user
328 2. ``email.charsets``: in order given by user
328 3. ``ui.fallbackencoding``: if not in email.charsets
329 3. ``ui.fallbackencoding``: if not in email.charsets
329 4. ``$HGENCODING``: if not in email.charsets
330 4. ``$HGENCODING``: if not in email.charsets
330 5. ``utf-8``: always last, regardless of settings
331 5. ``utf-8``: always last, regardless of settings
331
332
332 Email example::
333 Email example::
333
334
334 [email]
335 [email]
335 from = Joseph User <joe.user@example.com>
336 from = Joseph User <joe.user@example.com>
336 method = /usr/sbin/sendmail
337 method = /usr/sbin/sendmail
337 # charsets for western Europeans
338 # charsets for western Europeans
338 # us-ascii, utf-8 omitted, as they are tried first and last
339 # us-ascii, utf-8 omitted, as they are tried first and last
339 charsets = iso-8859-1, iso-8859-15, windows-1252
340 charsets = iso-8859-1, iso-8859-15, windows-1252
340
341
341
342
342 ``extensions``
343 ``extensions``
343 """"""""""""""
344 """"""""""""""
344
345
345 Mercurial has an extension mechanism for adding new features. To
346 Mercurial has an extension mechanism for adding new features. To
346 enable an extension, create an entry for it in this section.
347 enable an extension, create an entry for it in this section.
347
348
348 If you know that the extension is already in Python's search path,
349 If you know that the extension is already in Python's search path,
349 you can give the name of the module, followed by ``=``, with nothing
350 you can give the name of the module, followed by ``=``, with nothing
350 after the ``=``.
351 after the ``=``.
351
352
352 Otherwise, give a name that you choose, followed by ``=``, followed by
353 Otherwise, give a name that you choose, followed by ``=``, followed by
353 the path to the ``.py`` file (including the file name extension) that
354 the path to the ``.py`` file (including the file name extension) that
354 defines the extension.
355 defines the extension.
355
356
356 To explicitly disable an extension that is enabled in an hgrc of
357 To explicitly disable an extension that is enabled in an hgrc of
357 broader scope, prepend its path with ``!``, as in
358 broader scope, prepend its path with ``!``, as in
358 ``hgext.foo = !/ext/path`` or ``hgext.foo = !`` when path is not
359 ``hgext.foo = !/ext/path`` or ``hgext.foo = !`` when path is not
359 supplied.
360 supplied.
360
361
361 Example for ``~/.hgrc``::
362 Example for ``~/.hgrc``::
362
363
363 [extensions]
364 [extensions]
364 # (the mq extension will get loaded from Mercurial's path)
365 # (the mq extension will get loaded from Mercurial's path)
365 hgext.mq =
366 hgext.mq =
366 # (this extension will get loaded from the file specified)
367 # (this extension will get loaded from the file specified)
367 myfeature = ~/.hgext/myfeature.py
368 myfeature = ~/.hgext/myfeature.py
368
369
369
370
370 ``format``
371 ``format``
371 """"""""""
372 """"""""""
372
373
373 ``usestore``
374 ``usestore``
374 Enable or disable the "store" repository format which improves
375 Enable or disable the "store" repository format which improves
375 compatibility with systems that fold case or otherwise mangle
376 compatibility with systems that fold case or otherwise mangle
376 filenames. Enabled by default. Disabling this option will allow
377 filenames. Enabled by default. Disabling this option will allow
377 you to store longer filenames in some situations at the expense of
378 you to store longer filenames in some situations at the expense of
378 compatibility and ensures that the on-disk format of newly created
379 compatibility and ensures that the on-disk format of newly created
379 repositories will be compatible with Mercurial before version 0.9.4.
380 repositories will be compatible with Mercurial before version 0.9.4.
380
381
381 ``usefncache``
382 ``usefncache``
382 Enable or disable the "fncache" repository format which enhances
383 Enable or disable the "fncache" repository format which enhances
383 the "store" repository format (which has to be enabled to use
384 the "store" repository format (which has to be enabled to use
384 fncache) to allow longer filenames and avoids using Windows
385 fncache) to allow longer filenames and avoids using Windows
385 reserved names, e.g. "nul". Enabled by default. Disabling this
386 reserved names, e.g. "nul". Enabled by default. Disabling this
386 option ensures that the on-disk format of newly created
387 option ensures that the on-disk format of newly created
387 repositories will be compatible with Mercurial before version 1.1.
388 repositories will be compatible with Mercurial before version 1.1.
388
389
389 ``merge-patterns``
390 ``merge-patterns``
390 """"""""""""""""""
391 """"""""""""""""""
391
392
392 This section specifies merge tools to associate with particular file
393 This section specifies merge tools to associate with particular file
393 patterns. Tools matched here will take precedence over the default
394 patterns. Tools matched here will take precedence over the default
394 merge tool. Patterns are globs by default, rooted at the repository
395 merge tool. Patterns are globs by default, rooted at the repository
395 root.
396 root.
396
397
397 Example::
398 Example::
398
399
399 [merge-patterns]
400 [merge-patterns]
400 **.c = kdiff3
401 **.c = kdiff3
401 **.jpg = myimgmerge
402 **.jpg = myimgmerge
402
403
403 ``merge-tools``
404 ``merge-tools``
404 """""""""""""""
405 """""""""""""""
405
406
406 This section configures external merge tools to use for file-level
407 This section configures external merge tools to use for file-level
407 merges.
408 merges.
408
409
409 Example ``~/.hgrc``::
410 Example ``~/.hgrc``::
410
411
411 [merge-tools]
412 [merge-tools]
412 # Override stock tool location
413 # Override stock tool location
413 kdiff3.executable = ~/bin/kdiff3
414 kdiff3.executable = ~/bin/kdiff3
414 # Specify command line
415 # Specify command line
415 kdiff3.args = $base $local $other -o $output
416 kdiff3.args = $base $local $other -o $output
416 # Give higher priority
417 # Give higher priority
417 kdiff3.priority = 1
418 kdiff3.priority = 1
418
419
419 # Define new tool
420 # Define new tool
420 myHtmlTool.args = -m $local $other $base $output
421 myHtmlTool.args = -m $local $other $base $output
421 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
422 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
422 myHtmlTool.priority = 1
423 myHtmlTool.priority = 1
423
424
424 Supported arguments:
425 Supported arguments:
425
426
426 ``priority``
427 ``priority``
427 The priority in which to evaluate this tool.
428 The priority in which to evaluate this tool.
428 Default: 0.
429 Default: 0.
429 ``executable``
430 ``executable``
430 Either just the name of the executable or its pathname.
431 Either just the name of the executable or its pathname.
431 Default: the tool name.
432 Default: the tool name.
432 ``args``
433 ``args``
433 The arguments to pass to the tool executable. You can refer to the
434 The arguments to pass to the tool executable. You can refer to the
434 files being merged as well as the output file through these
435 files being merged as well as the output file through these
435 variables: ``$base``, ``$local``, ``$other``, ``$output``.
436 variables: ``$base``, ``$local``, ``$other``, ``$output``.
436 Default: ``$local $base $other``
437 Default: ``$local $base $other``
437 ``premerge``
438 ``premerge``
438 Attempt to run internal non-interactive 3-way merge tool before
439 Attempt to run internal non-interactive 3-way merge tool before
439 launching external tool.
440 launching external tool.
440 Default: True
441 Default: True
441 ``binary``
442 ``binary``
442 This tool can merge binary files. Defaults to False, unless tool
443 This tool can merge binary files. Defaults to False, unless tool
443 was selected by file pattern match.
444 was selected by file pattern match.
444 ``symlink``
445 ``symlink``
445 This tool can merge symlinks. Defaults to False, even if tool was
446 This tool can merge symlinks. Defaults to False, even if tool was
446 selected by file pattern match.
447 selected by file pattern match.
447 ``checkconflicts``
448 ``checkconflicts``
448 Check whether there are conflicts even though the tool reported
449 Check whether there are conflicts even though the tool reported
449 success.
450 success.
450 Default: False
451 Default: False
451 ``checkchanged``
452 ``checkchanged``
452 Check whether outputs were written even though the tool reported
453 Check whether outputs were written even though the tool reported
453 success.
454 success.
454 Default: False
455 Default: False
455 ``fixeol``
456 ``fixeol``
456 Attempt to fix up EOL changes caused by the merge tool.
457 Attempt to fix up EOL changes caused by the merge tool.
457 Default: False
458 Default: False
458 ``gui``
459 ``gui``
459 This tool requires a graphical interface to run. Default: False
460 This tool requires a graphical interface to run. Default: False
460 ``regkey``
461 ``regkey``
461 Windows registry key which describes install location of this
462 Windows registry key which describes install location of this
462 tool. Mercurial will search for this key first under
463 tool. Mercurial will search for this key first under
463 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
464 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
464 Default: None
465 Default: None
465 ``regname``
466 ``regname``
466 Name of value to read from specified registry key. Defaults to the
467 Name of value to read from specified registry key. Defaults to the
467 unnamed (default) value.
468 unnamed (default) value.
468 ``regappend``
469 ``regappend``
469 String to append to the value read from the registry, typically
470 String to append to the value read from the registry, typically
470 the executable name of the tool.
471 the executable name of the tool.
471 Default: None
472 Default: None
472
473
473
474
474 ``hooks``
475 ``hooks``
475 """""""""
476 """""""""
476 Commands or Python functions that get automatically executed by
477 Commands or Python functions that get automatically executed by
477 various actions such as starting or finishing a commit. Multiple
478 various actions such as starting or finishing a commit. Multiple
478 hooks can be run for the same action by appending a suffix to the
479 hooks can be run for the same action by appending a suffix to the
479 action. Overriding a site-wide hook can be done by changing its
480 action. Overriding a site-wide hook can be done by changing its
480 value or setting it to an empty string.
481 value or setting it to an empty string.
481
482
482 Example ``.hg/hgrc``::
483 Example ``.hg/hgrc``::
483
484
484 [hooks]
485 [hooks]
485 # update working directory after adding changesets
486 # update working directory after adding changesets
486 changegroup.update = hg update
487 changegroup.update = hg update
487 # do not use the site-wide hook
488 # do not use the site-wide hook
488 incoming =
489 incoming =
489 incoming.email = /my/email/hook
490 incoming.email = /my/email/hook
490 incoming.autobuild = /my/build/hook
491 incoming.autobuild = /my/build/hook
491
492
492 Most hooks are run with environment variables set that give useful
493 Most hooks are run with environment variables set that give useful
493 additional information. For each hook below, the environment
494 additional information. For each hook below, the environment
494 variables it is passed are listed with names of the form ``$HG_foo``.
495 variables it is passed are listed with names of the form ``$HG_foo``.
495
496
496 ``changegroup``
497 ``changegroup``
497 Run after a changegroup has been added via push, pull or unbundle.
498 Run after a changegroup has been added via push, pull or unbundle.
498 ID of the first new changeset is in ``$HG_NODE``. URL from which
499 ID of the first new changeset is in ``$HG_NODE``. URL from which
499 changes came is in ``$HG_URL``.
500 changes came is in ``$HG_URL``.
500 ``commit``
501 ``commit``
501 Run after a changeset has been created in the local repository. ID
502 Run after a changeset has been created in the local repository. ID
502 of the newly created changeset is in ``$HG_NODE``. Parent changeset
503 of the newly created changeset is in ``$HG_NODE``. Parent changeset
503 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
504 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
504 ``incoming``
505 ``incoming``
505 Run after a changeset has been pulled, pushed, or unbundled into
506 Run after a changeset has been pulled, pushed, or unbundled into
506 the local repository. The ID of the newly arrived changeset is in
507 the local repository. The ID of the newly arrived changeset is in
507 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
508 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
508 ``outgoing``
509 ``outgoing``
509 Run after sending changes from local repository to another. ID of
510 Run after sending changes from local repository to another. ID of
510 first changeset sent is in ``$HG_NODE``. Source of operation is in
511 first changeset sent is in ``$HG_NODE``. Source of operation is in
511 ``$HG_SOURCE``; see "preoutgoing" hook for description.
512 ``$HG_SOURCE``; see "preoutgoing" hook for description.
512 ``post-<command>``
513 ``post-<command>``
513 Run after successful invocations of the associated command. The
514 Run after successful invocations of the associated command. The
514 contents of the command line are passed as ``$HG_ARGS`` and the result
515 contents of the command line are passed as ``$HG_ARGS`` and the result
515 code in ``$HG_RESULT``. Hook failure is ignored.
516 code in ``$HG_RESULT``. Hook failure is ignored.
516 ``pre-<command>``
517 ``pre-<command>``
517 Run before executing the associated command. The contents of the
518 Run before executing the associated command. The contents of the
518 command line are passed as ``$HG_ARGS``. If the hook returns failure,
519 command line are passed as ``$HG_ARGS``. If the hook returns failure,
519 the command doesn't execute and Mercurial returns the failure
520 the command doesn't execute and Mercurial returns the failure
520 code.
521 code.
521 ``prechangegroup``
522 ``prechangegroup``
522 Run before a changegroup is added via push, pull or unbundle. Exit
523 Run before a changegroup is added via push, pull or unbundle. Exit
523 status 0 allows the changegroup to proceed. Non-zero status will
524 status 0 allows the changegroup to proceed. Non-zero status will
524 cause the push, pull or unbundle to fail. URL from which changes
525 cause the push, pull or unbundle to fail. URL from which changes
525 will come is in ``$HG_URL``.
526 will come is in ``$HG_URL``.
526 ``precommit``
527 ``precommit``
527 Run before starting a local commit. Exit status 0 allows the
528 Run before starting a local commit. Exit status 0 allows the
528 commit to proceed. Non-zero status will cause the commit to fail.
529 commit to proceed. Non-zero status will cause the commit to fail.
529 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
530 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
530 ``preoutgoing``
531 ``preoutgoing``
531 Run before collecting changes to send from the local repository to
532 Run before collecting changes to send from the local repository to
532 another. Non-zero status will cause failure. This lets you prevent
533 another. Non-zero status will cause failure. This lets you prevent
533 pull over HTTP or SSH. Also prevents against local pull, push
534 pull over HTTP or SSH. Also prevents against local pull, push
534 (outbound) or bundle commands, but not effective, since you can
535 (outbound) or bundle commands, but not effective, since you can
535 just copy files instead then. Source of operation is in
536 just copy files instead then. Source of operation is in
536 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
537 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
537 SSH or HTTP repository. If "push", "pull" or "bundle", operation
538 SSH or HTTP repository. If "push", "pull" or "bundle", operation
538 is happening on behalf of repository on same system.
539 is happening on behalf of repository on same system.
539 ``pretag``
540 ``pretag``
540 Run before creating a tag. Exit status 0 allows the tag to be
541 Run before creating a tag. Exit status 0 allows the tag to be
541 created. Non-zero status will cause the tag to fail. ID of
542 created. Non-zero status will cause the tag to fail. ID of
542 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
543 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
543 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
544 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
544 ``pretxnchangegroup``
545 ``pretxnchangegroup``
545 Run after a changegroup has been added via push, pull or unbundle,
546 Run after a changegroup has been added via push, pull or unbundle,
546 but before the transaction has been committed. Changegroup is
547 but before the transaction has been committed. Changegroup is
547 visible to hook program. This lets you validate incoming changes
548 visible to hook program. This lets you validate incoming changes
548 before accepting them. Passed the ID of the first new changeset in
549 before accepting them. Passed the ID of the first new changeset in
549 ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero
550 ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero
550 status will cause the transaction to be rolled back and the push,
551 status will cause the transaction to be rolled back and the push,
551 pull or unbundle will fail. URL that was source of changes is in
552 pull or unbundle will fail. URL that was source of changes is in
552 ``$HG_URL``.
553 ``$HG_URL``.
553 ``pretxncommit``
554 ``pretxncommit``
554 Run after a changeset has been created but the transaction not yet
555 Run after a changeset has been created but the transaction not yet
555 committed. Changeset is visible to hook program. This lets you
556 committed. Changeset is visible to hook program. This lets you
556 validate commit message and changes. Exit status 0 allows the
557 validate commit message and changes. Exit status 0 allows the
557 commit to proceed. Non-zero status will cause the transaction to
558 commit to proceed. Non-zero status will cause the transaction to
558 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
559 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
559 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
560 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
560 ``preupdate``
561 ``preupdate``
561 Run before updating the working directory. Exit status 0 allows
562 Run before updating the working directory. Exit status 0 allows
562 the update to proceed. Non-zero status will prevent the update.
563 the update to proceed. Non-zero status will prevent the update.
563 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
564 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
564 of second new parent is in ``$HG_PARENT2``.
565 of second new parent is in ``$HG_PARENT2``.
565 ``tag``
566 ``tag``
566 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
567 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
567 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
568 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
568 repository if ``$HG_LOCAL=0``.
569 repository if ``$HG_LOCAL=0``.
569 ``update``
570 ``update``
570 Run after updating the working directory. Changeset ID of first
571 Run after updating the working directory. Changeset ID of first
571 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
572 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
572 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
573 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
573 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
574 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
574
575
575 .. note:: It is generally better to use standard hooks rather than the
576 .. note:: It is generally better to use standard hooks rather than the
576 generic pre- and post- command hooks as they are guaranteed to be
577 generic pre- and post- command hooks as they are guaranteed to be
577 called in the appropriate contexts for influencing transactions.
578 called in the appropriate contexts for influencing transactions.
578 Also, hooks like "commit" will be called in all contexts that
579 Also, hooks like "commit" will be called in all contexts that
579 generate a commit (e.g. tag) and not just the commit command.
580 generate a commit (e.g. tag) and not just the commit command.
580
581
581 .. note:: Environment variables with empty values may not be passed to
582 .. note:: Environment variables with empty values may not be passed to
582 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
583 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
583 will have an empty value under Unix-like platforms for non-merge
584 will have an empty value under Unix-like platforms for non-merge
584 changesets, while it will not be available at all under Windows.
585 changesets, while it will not be available at all under Windows.
585
586
586 The syntax for Python hooks is as follows::
587 The syntax for Python hooks is as follows::
587
588
588 hookname = python:modulename.submodule.callable
589 hookname = python:modulename.submodule.callable
589 hookname = python:/path/to/python/module.py:callable
590 hookname = python:/path/to/python/module.py:callable
590
591
591 Python hooks are run within the Mercurial process. Each hook is
592 Python hooks are run within the Mercurial process. Each hook is
592 called with at least three keyword arguments: a ui object (keyword
593 called with at least three keyword arguments: a ui object (keyword
593 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
594 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
594 keyword that tells what kind of hook is used. Arguments listed as
595 keyword that tells what kind of hook is used. Arguments listed as
595 environment variables above are passed as keyword arguments, with no
596 environment variables above are passed as keyword arguments, with no
596 ``HG_`` prefix, and names in lower case.
597 ``HG_`` prefix, and names in lower case.
597
598
598 If a Python hook returns a "true" value or raises an exception, this
599 If a Python hook returns a "true" value or raises an exception, this
599 is treated as a failure.
600 is treated as a failure.
600
601
601
602
602 ``http_proxy``
603 ``http_proxy``
603 """"""""""""""
604 """"""""""""""
604 Used to access web-based Mercurial repositories through a HTTP
605 Used to access web-based Mercurial repositories through a HTTP
605 proxy.
606 proxy.
606
607
607 ``host``
608 ``host``
608 Host name and (optional) port of the proxy server, for example
609 Host name and (optional) port of the proxy server, for example
609 "myproxy:8000".
610 "myproxy:8000".
610 ``no``
611 ``no``
611 Optional. Comma-separated list of host names that should bypass
612 Optional. Comma-separated list of host names that should bypass
612 the proxy.
613 the proxy.
613 ``passwd``
614 ``passwd``
614 Optional. Password to authenticate with at the proxy server.
615 Optional. Password to authenticate with at the proxy server.
615 ``user``
616 ``user``
616 Optional. User name to authenticate with at the proxy server.
617 Optional. User name to authenticate with at the proxy server.
617
618
618 ``smtp``
619 ``smtp``
619 """"""""
620 """"""""
620 Configuration for extensions that need to send email messages.
621 Configuration for extensions that need to send email messages.
621
622
622 ``host``
623 ``host``
623 Host name of mail server, e.g. "mail.example.com".
624 Host name of mail server, e.g. "mail.example.com".
624 ``port``
625 ``port``
625 Optional. Port to connect to on mail server. Default: 25.
626 Optional. Port to connect to on mail server. Default: 25.
626 ``tls``
627 ``tls``
627 Optional. Whether to connect to mail server using TLS. True or
628 Optional. Whether to connect to mail server using TLS. True or
628 False. Default: False.
629 False. Default: False.
629 ``username``
630 ``username``
630 Optional. User name to authenticate to SMTP server with. If
631 Optional. User name to authenticate to SMTP server with. If
631 username is specified, password must also be specified.
632 username is specified, password must also be specified.
632 Default: none.
633 Default: none.
633 ``password``
634 ``password``
634 Optional. Password to authenticate to SMTP server with. If
635 Optional. Password to authenticate to SMTP server with. If
635 username is specified, password must also be specified.
636 username is specified, password must also be specified.
636 Default: none.
637 Default: none.
637 ``local_hostname``
638 ``local_hostname``
638 Optional. It's the hostname that the sender can use to identify
639 Optional. It's the hostname that the sender can use to identify
639 itself to the MTA.
640 itself to the MTA.
640
641
641
642
642 ``patch``
643 ``patch``
643 """""""""
644 """""""""
644 Settings used when applying patches, for instance through the 'import'
645 Settings used when applying patches, for instance through the 'import'
645 command or with Mercurial Queues extension.
646 command or with Mercurial Queues extension.
646
647
647 ``eol``
648 ``eol``
648 When set to 'strict' patch content and patched files end of lines
649 When set to 'strict' patch content and patched files end of lines
649 are preserved. When set to ``lf`` or ``crlf``, both files end of lines
650 are preserved. When set to ``lf`` or ``crlf``, both files end of lines
650 are ignored when patching and the result line endings are
651 are ignored when patching and the result line endings are
651 normalized to either LF (Unix) or CRLF (Windows).
652 normalized to either LF (Unix) or CRLF (Windows).
652 Default: strict.
653 Default: strict.
653
654
654
655
655 ``paths``
656 ``paths``
656 """""""""
657 """""""""
657 Assigns symbolic names to repositories. The left side is the
658 Assigns symbolic names to repositories. The left side is the
658 symbolic name, and the right gives the directory or URL that is the
659 symbolic name, and the right gives the directory or URL that is the
659 location of the repository. Default paths can be declared by setting
660 location of the repository. Default paths can be declared by setting
660 the following entries.
661 the following entries.
661
662
662 ``default``
663 ``default``
663 Directory or URL to use when pulling if no source is specified.
664 Directory or URL to use when pulling if no source is specified.
664 Default is set to repository from which the current repository was
665 Default is set to repository from which the current repository was
665 cloned.
666 cloned.
666 ``default-push``
667 ``default-push``
667 Optional. Directory or URL to use when pushing if no destination
668 Optional. Directory or URL to use when pushing if no destination
668 is specified.
669 is specified.
669
670
670
671
671 ``profiling``
672 ``profiling``
672 """""""""""""
673 """""""""""""
673 Specifies profiling format and file output. In this section
674 Specifies profiling format and file output. In this section
674 description, 'profiling data' stands for the raw data collected
675 description, 'profiling data' stands for the raw data collected
675 during profiling, while 'profiling report' stands for a statistical
676 during profiling, while 'profiling report' stands for a statistical
676 text report generated from the profiling data. The profiling is done
677 text report generated from the profiling data. The profiling is done
677 using lsprof.
678 using lsprof.
678
679
679 ``format``
680 ``format``
680 Profiling format.
681 Profiling format.
681 Default: text.
682 Default: text.
682
683
683 ``text``
684 ``text``
684 Generate a profiling report. When saving to a file, it should be
685 Generate a profiling report. When saving to a file, it should be
685 noted that only the report is saved, and the profiling data is
686 noted that only the report is saved, and the profiling data is
686 not kept.
687 not kept.
687 ``kcachegrind``
688 ``kcachegrind``
688 Format profiling data for kcachegrind use: when saving to a
689 Format profiling data for kcachegrind use: when saving to a
689 file, the generated file can directly be loaded into
690 file, the generated file can directly be loaded into
690 kcachegrind.
691 kcachegrind.
691 ``output``
692 ``output``
692 File path where profiling data or report should be saved. If the
693 File path where profiling data or report should be saved. If the
693 file exists, it is replaced. Default: None, data is printed on
694 file exists, it is replaced. Default: None, data is printed on
694 stderr
695 stderr
695
696
696 ``server``
697 ``server``
697 """"""""""
698 """"""""""
698 Controls generic server settings.
699 Controls generic server settings.
699
700
700 ``uncompressed``
701 ``uncompressed``
701 Whether to allow clients to clone a repository using the
702 Whether to allow clients to clone a repository using the
702 uncompressed streaming protocol. This transfers about 40% more
703 uncompressed streaming protocol. This transfers about 40% more
703 data than a regular clone, but uses less memory and CPU on both
704 data than a regular clone, but uses less memory and CPU on both
704 server and client. Over a LAN (100 Mbps or better) or a very fast
705 server and client. Over a LAN (100 Mbps or better) or a very fast
705 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
706 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
706 regular clone. Over most WAN connections (anything slower than
707 regular clone. Over most WAN connections (anything slower than
707 about 6 Mbps), uncompressed streaming is slower, because of the
708 about 6 Mbps), uncompressed streaming is slower, because of the
708 extra data transfer overhead. Default is False.
709 extra data transfer overhead. Default is False.
709
710
710
711
711 ``trusted``
712 ``trusted``
712 """""""""""
713 """""""""""
713 For security reasons, Mercurial will not use the settings in the
714 For security reasons, Mercurial will not use the settings in the
714 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
715 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
715 user or to a trusted group. The main exception is the web interface,
716 user or to a trusted group. The main exception is the web interface,
716 which automatically uses some safe settings, since it's common to
717 which automatically uses some safe settings, since it's common to
717 serve repositories from different users.
718 serve repositories from different users.
718
719
719 This section specifies what users and groups are trusted. The
720 This section specifies what users and groups are trusted. The
720 current user is always trusted. To trust everybody, list a user or a
721 current user is always trusted. To trust everybody, list a user or a
721 group with name ``*``.
722 group with name ``*``.
722
723
723 ``users``
724 ``users``
724 Comma-separated list of trusted users.
725 Comma-separated list of trusted users.
725 ``groups``
726 ``groups``
726 Comma-separated list of trusted groups.
727 Comma-separated list of trusted groups.
727
728
728
729
729 ``ui``
730 ``ui``
730 """"""
731 """"""
731
732
732 User interface controls.
733 User interface controls.
733
734
734 ``archivemeta``
735 ``archivemeta``
735 Whether to include the .hg_archival.txt file containing meta data
736 Whether to include the .hg_archival.txt file containing meta data
736 (hashes for the repository base and for tip) in archives created
737 (hashes for the repository base and for tip) in archives created
737 by the hg archive command or downloaded via hgweb.
738 by the hg archive command or downloaded via hgweb.
738 Default is True.
739 Default is True.
739 ``askusername``
740 ``askusername``
740 Whether to prompt for a username when committing. If True, and
741 Whether to prompt for a username when committing. If True, and
741 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
742 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
742 be prompted to enter a username. If no username is entered, the
743 be prompted to enter a username. If no username is entered, the
743 default ``USER@HOST`` is used instead.
744 default ``USER@HOST`` is used instead.
744 Default is False.
745 Default is False.
745 ``debug``
746 ``debug``
746 Print debugging information. True or False. Default is False.
747 Print debugging information. True or False. Default is False.
747 ``editor``
748 ``editor``
748 The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
749 The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
749 ``fallbackencoding``
750 ``fallbackencoding``
750 Encoding to try if it's not possible to decode the changelog using
751 Encoding to try if it's not possible to decode the changelog using
751 UTF-8. Default is ISO-8859-1.
752 UTF-8. Default is ISO-8859-1.
752 ``ignore``
753 ``ignore``
753 A file to read per-user ignore patterns from. This file should be
754 A file to read per-user ignore patterns from. This file should be
754 in the same format as a repository-wide .hgignore file. This
755 in the same format as a repository-wide .hgignore file. This
755 option supports hook syntax, so if you want to specify multiple
756 option supports hook syntax, so if you want to specify multiple
756 ignore files, you can do so by setting something like
757 ignore files, you can do so by setting something like
757 ``ignore.other = ~/.hgignore2``. For details of the ignore file
758 ``ignore.other = ~/.hgignore2``. For details of the ignore file
758 format, see the |hgignore(5)|_ man page.
759 format, see the |hgignore(5)|_ man page.
759 ``interactive``
760 ``interactive``
760 Allow to prompt the user. True or False. Default is True.
761 Allow to prompt the user. True or False. Default is True.
761 ``logtemplate``
762 ``logtemplate``
762 Template string for commands that print changesets.
763 Template string for commands that print changesets.
763 ``merge``
764 ``merge``
764 The conflict resolution program to use during a manual merge.
765 The conflict resolution program to use during a manual merge.
765 There are some internal tools available:
766 There are some internal tools available:
766
767
767 ``internal:local``
768 ``internal:local``
768 keep the local version
769 keep the local version
769 ``internal:other``
770 ``internal:other``
770 use the other version
771 use the other version
771 ``internal:merge``
772 ``internal:merge``
772 use the internal non-interactive merge tool
773 use the internal non-interactive merge tool
773 ``internal:fail``
774 ``internal:fail``
774 fail to merge
775 fail to merge
775
776
776 For more information on configuring merge tools see the
777 For more information on configuring merge tools see the
777 merge-tools_ section.
778 merge-tools_ section.
778
779
779 ``patch``
780 ``patch``
780 command to use to apply patches. Look for ``gpatch`` or ``patch`` in
781 command to use to apply patches. Look for ``gpatch`` or ``patch`` in
781 PATH if unset.
782 PATH if unset.
782 ``quiet``
783 ``quiet``
783 Reduce the amount of output printed. True or False. Default is False.
784 Reduce the amount of output printed. True or False. Default is False.
784 ``remotecmd``
785 ``remotecmd``
785 remote command to use for clone/push/pull operations. Default is ``hg``.
786 remote command to use for clone/push/pull operations. Default is ``hg``.
786 ``report_untrusted``
787 ``report_untrusted``
787 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
788 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
788 trusted user or group. True or False. Default is True.
789 trusted user or group. True or False. Default is True.
789 ``slash``
790 ``slash``
790 Display paths using a slash (``/``) as the path separator. This
791 Display paths using a slash (``/``) as the path separator. This
791 only makes a difference on systems where the default path
792 only makes a difference on systems where the default path
792 separator is not the slash character (e.g. Windows uses the
793 separator is not the slash character (e.g. Windows uses the
793 backslash character (``\``)).
794 backslash character (``\``)).
794 Default is False.
795 Default is False.
795 ``ssh``
796 ``ssh``
796 command to use for SSH connections. Default is ``ssh``.
797 command to use for SSH connections. Default is ``ssh``.
797 ``strict``
798 ``strict``
798 Require exact command names, instead of allowing unambiguous
799 Require exact command names, instead of allowing unambiguous
799 abbreviations. True or False. Default is False.
800 abbreviations. True or False. Default is False.
800 ``style``
801 ``style``
801 Name of style to use for command output.
802 Name of style to use for command output.
802 ``timeout``
803 ``timeout``
803 The timeout used when a lock is held (in seconds), a negative value
804 The timeout used when a lock is held (in seconds), a negative value
804 means no timeout. Default is 600.
805 means no timeout. Default is 600.
805 ``traceback``
806 ``traceback``
806 Mercurial always prints a traceback when an unknown exception
807 Mercurial always prints a traceback when an unknown exception
807 occurs. Setting this to True will make Mercurial print a traceback
808 occurs. Setting this to True will make Mercurial print a traceback
808 on all exceptions, even those recognized by Mercurial (such as
809 on all exceptions, even those recognized by Mercurial (such as
809 IOError or MemoryError). Default is False.
810 IOError or MemoryError). Default is False.
810 ``username``
811 ``username``
811 The committer of a changeset created when running "commit".
812 The committer of a changeset created when running "commit".
812 Typically a person's name and email address, e.g. ``Fred Widget
813 Typically a person's name and email address, e.g. ``Fred Widget
813 <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If
814 <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If
814 the username in hgrc is empty, it has to be specified manually or
815 the username in hgrc is empty, it has to be specified manually or
815 in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set
816 in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set
816 ``username =`` in the system hgrc).
817 ``username =`` in the system hgrc).
817 ``verbose``
818 ``verbose``
818 Increase the amount of output printed. True or False. Default is False.
819 Increase the amount of output printed. True or False. Default is False.
819
820
820
821
821 ``web``
822 ``web``
822 """""""
823 """""""
823 Web interface configuration.
824 Web interface configuration.
824
825
825 ``accesslog``
826 ``accesslog``
826 Where to output the access log. Default is stdout.
827 Where to output the access log. Default is stdout.
827 ``address``
828 ``address``
828 Interface address to bind to. Default is all.
829 Interface address to bind to. Default is all.
829 ``allow_archive``
830 ``allow_archive``
830 List of archive format (bz2, gz, zip) allowed for downloading.
831 List of archive format (bz2, gz, zip) allowed for downloading.
831 Default is empty.
832 Default is empty.
832 ``allowbz2``
833 ``allowbz2``
833 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
834 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
834 revisions.
835 revisions.
835 Default is False.
836 Default is False.
836 ``allowgz``
837 ``allowgz``
837 (DEPRECATED) Whether to allow .tar.gz downloading of repository
838 (DEPRECATED) Whether to allow .tar.gz downloading of repository
838 revisions.
839 revisions.
839 Default is False.
840 Default is False.
840 ``allowpull``
841 ``allowpull``
841 Whether to allow pulling from the repository. Default is True.
842 Whether to allow pulling from the repository. Default is True.
842 ``allow_push``
843 ``allow_push``
843 Whether to allow pushing to the repository. If empty or not set,
844 Whether to allow pushing to the repository. If empty or not set,
844 push is not allowed. If the special value ``*``, any remote user can
845 push is not allowed. If the special value ``*``, any remote user can
845 push, including unauthenticated users. Otherwise, the remote user
846 push, including unauthenticated users. Otherwise, the remote user
846 must have been authenticated, and the authenticated user name must
847 must have been authenticated, and the authenticated user name must
847 be present in this list (separated by whitespace or ``,``). The
848 be present in this list (separated by whitespace or ``,``). The
848 contents of the allow_push list are examined after the deny_push
849 contents of the allow_push list are examined after the deny_push
849 list.
850 list.
850 ``allow_read``
851 ``allow_read``
851 If the user has not already been denied repository access due to
852 If the user has not already been denied repository access due to
852 the contents of deny_read, this list determines whether to grant
853 the contents of deny_read, this list determines whether to grant
853 repository access to the user. If this list is not empty, and the
854 repository access to the user. If this list is not empty, and the
854 user is unauthenticated or not present in the list (separated by
855 user is unauthenticated or not present in the list (separated by
855 whitespace or ``,``), then access is denied for the user. If the
856 whitespace or ``,``), then access is denied for the user. If the
856 list is empty or not set, then access is permitted to all users by
857 list is empty or not set, then access is permitted to all users by
857 default. Setting allow_read to the special value ``*`` is equivalent
858 default. Setting allow_read to the special value ``*`` is equivalent
858 to it not being set (i.e. access is permitted to all users). The
859 to it not being set (i.e. access is permitted to all users). The
859 contents of the allow_read list are examined after the deny_read
860 contents of the allow_read list are examined after the deny_read
860 list.
861 list.
861 ``allowzip``
862 ``allowzip``
862 (DEPRECATED) Whether to allow .zip downloading of repository
863 (DEPRECATED) Whether to allow .zip downloading of repository
863 revisions. Default is False. This feature creates temporary files.
864 revisions. Default is False. This feature creates temporary files.
864 ``baseurl``
865 ``baseurl``
865 Base URL to use when publishing URLs in other locations, so
866 Base URL to use when publishing URLs in other locations, so
866 third-party tools like email notification hooks can construct
867 third-party tools like email notification hooks can construct
867 URLs. Example: ``http://hgserver/repos/``.
868 URLs. Example: ``http://hgserver/repos/``.
868 ``contact``
869 ``contact``
869 Name or email address of the person in charge of the repository.
870 Name or email address of the person in charge of the repository.
870 Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
871 Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
871 ``deny_push``
872 ``deny_push``
872 Whether to deny pushing to the repository. If empty or not set,
873 Whether to deny pushing to the repository. If empty or not set,
873 push is not denied. If the special value ``*``, all remote users are
874 push is not denied. If the special value ``*``, all remote users are
874 denied push. Otherwise, unauthenticated users are all denied, and
875 denied push. Otherwise, unauthenticated users are all denied, and
875 any authenticated user name present in this list (separated by
876 any authenticated user name present in this list (separated by
876 whitespace or ``,``) is also denied. The contents of the deny_push
877 whitespace or ``,``) is also denied. The contents of the deny_push
877 list are examined before the allow_push list.
878 list are examined before the allow_push list.
878 ``deny_read``
879 ``deny_read``
879 Whether to deny reading/viewing of the repository. If this list is
880 Whether to deny reading/viewing of the repository. If this list is
880 not empty, unauthenticated users are all denied, and any
881 not empty, unauthenticated users are all denied, and any
881 authenticated user name present in this list (separated by
882 authenticated user name present in this list (separated by
882 whitespace or ``,``) is also denied access to the repository. If set
883 whitespace or ``,``) is also denied access to the repository. If set
883 to the special value ``*``, all remote users are denied access
884 to the special value ``*``, all remote users are denied access
884 (rarely needed ;). If deny_read is empty or not set, the
885 (rarely needed ;). If deny_read is empty or not set, the
885 determination of repository access depends on the presence and
886 determination of repository access depends on the presence and
886 content of the allow_read list (see description). If both
887 content of the allow_read list (see description). If both
887 deny_read and allow_read are empty or not set, then access is
888 deny_read and allow_read are empty or not set, then access is
888 permitted to all users by default. If the repository is being
889 permitted to all users by default. If the repository is being
889 served via hgwebdir, denied users will not be able to see it in
890 served via hgwebdir, denied users will not be able to see it in
890 the list of repositories. The contents of the deny_read list have
891 the list of repositories. The contents of the deny_read list have
891 priority over (are examined before) the contents of the allow_read
892 priority over (are examined before) the contents of the allow_read
892 list.
893 list.
893 ``descend``
894 ``descend``
894 hgwebdir indexes will not descend into subdirectories. Only repositories
895 hgwebdir indexes will not descend into subdirectories. Only repositories
895 directly in the current path will be shown (other repositories are still
896 directly in the current path will be shown (other repositories are still
896 available from the index corresponding to their containing path).
897 available from the index corresponding to their containing path).
897 ``description``
898 ``description``
898 Textual description of the repository's purpose or contents.
899 Textual description of the repository's purpose or contents.
899 Default is "unknown".
900 Default is "unknown".
900 ``encoding``
901 ``encoding``
901 Character encoding name.
902 Character encoding name.
902 Example: "UTF-8"
903 Example: "UTF-8"
903 ``errorlog``
904 ``errorlog``
904 Where to output the error log. Default is stderr.
905 Where to output the error log. Default is stderr.
905 ``hidden``
906 ``hidden``
906 Whether to hide the repository in the hgwebdir index.
907 Whether to hide the repository in the hgwebdir index.
907 Default is False.
908 Default is False.
908 ``ipv6``
909 ``ipv6``
909 Whether to use IPv6. Default is False.
910 Whether to use IPv6. Default is False.
910 ``name``
911 ``name``
911 Repository name to use in the web interface. Default is current
912 Repository name to use in the web interface. Default is current
912 working directory.
913 working directory.
913 ``maxchanges``
914 ``maxchanges``
914 Maximum number of changes to list on the changelog. Default is 10.
915 Maximum number of changes to list on the changelog. Default is 10.
915 ``maxfiles``
916 ``maxfiles``
916 Maximum number of files to list per changeset. Default is 10.
917 Maximum number of files to list per changeset. Default is 10.
917 ``port``
918 ``port``
918 Port to listen on. Default is 8000.
919 Port to listen on. Default is 8000.
919 ``prefix``
920 ``prefix``
920 Prefix path to serve from. Default is '' (server root).
921 Prefix path to serve from. Default is '' (server root).
921 ``push_ssl``
922 ``push_ssl``
922 Whether to require that inbound pushes be transported over SSL to
923 Whether to require that inbound pushes be transported over SSL to
923 prevent password sniffing. Default is True.
924 prevent password sniffing. Default is True.
924 ``staticurl``
925 ``staticurl``
925 Base URL to use for static files. If unset, static files (e.g. the
926 Base URL to use for static files. If unset, static files (e.g. the
926 hgicon.png favicon) will be served by the CGI script itself. Use
927 hgicon.png favicon) will be served by the CGI script itself. Use
927 this setting to serve them directly with the HTTP server.
928 this setting to serve them directly with the HTTP server.
928 Example: ``http://hgserver/static/``.
929 Example: ``http://hgserver/static/``.
929 ``stripes``
930 ``stripes``
930 How many lines a "zebra stripe" should span in multiline output.
931 How many lines a "zebra stripe" should span in multiline output.
931 Default is 1; set to 0 to disable.
932 Default is 1; set to 0 to disable.
932 ``style``
933 ``style``
933 Which template map style to use.
934 Which template map style to use.
934 ``templates``
935 ``templates``
935 Where to find the HTML templates. Default is install path.
936 Where to find the HTML templates. Default is install path.
936
937
937
938
938 Author
939 Author
939 ------
940 ------
940 Bryan O'Sullivan <bos@serpentine.com>.
941 Bryan O'Sullivan <bos@serpentine.com>.
941
942
942 Mercurial was written by Matt Mackall <mpm@selenic.com>.
943 Mercurial was written by Matt Mackall <mpm@selenic.com>.
943
944
944 See Also
945 See Also
945 --------
946 --------
946 |hg(1)|_, |hgignore(5)|_
947 |hg(1)|_, |hgignore(5)|_
947
948
948 Copying
949 Copying
949 -------
950 -------
950 This manual page is copyright 2005 Bryan O'Sullivan.
951 This manual page is copyright 2005 Bryan O'Sullivan.
951 Mercurial is copyright 2005-2010 Matt Mackall.
952 Mercurial is copyright 2005-2010 Matt Mackall.
952 Free use of this software is granted under the terms of the GNU General
953 Free use of this software is granted under the terms of the GNU General
953 Public License version 2.
954 Public License version 2.
954
955
955 .. include:: common.txt
956 .. include:: common.txt
@@ -1,42 +1,48
1 #!/bin/sh
1 #!/bin/sh
2
2
3 hg init
3 hg init
4
4
5 cat > .hg/hgrc <<EOF
5 cat > .hg/hgrc <<EOF
6 [encode]
6 [encode]
7 not.gz = tr a-z A-Z
7 *.gz = gzip -d
8 *.gz = gzip -d
8
9
9 [decode]
10 [decode]
11 not.gz = tr A-Z a-z
10 *.gz = gzip
12 *.gz = gzip
11
13
12 EOF
14 EOF
13
15
14 echo "this is a test" | gzip > a.gz
16 echo "this is a test" | gzip > a.gz
15 hg add a.gz
17 echo "this is a test" > not.gz
18 hg add *
16 hg ci -m "test" -d "1000000 0"
19 hg ci -m "test" -d "1000000 0"
17 echo %% no changes
20 echo %% no changes
18 hg status
21 hg status
19 touch a.gz
22 touch *
20
23
21 echo %% no changes
24 echo %% no changes
22 hg status
25 hg status
23
26
24 echo %% uncompressed contents in repo
27 echo %% check contents in repo are encoded
25 hg debugdata .hg/store/data/a.gz.d 0
28 hg debugdata .hg/store/data/a.gz.d 0
29 hg debugdata .hg/store/data/not.gz.d 0
26
30
27 echo %% uncompress our working dir copy
31 echo %% check committed content was decoded
28 gunzip < a.gz
32 gunzip < a.gz
33 cat not.gz
29
34
30 rm a.gz
35 rm *
31 hg co -C
36 hg co -C
32
37
33 echo %% uncompress our new working dir copy
38 echo %% check decoding of our new working dir copy
34 gunzip < a.gz
39 gunzip < a.gz
40 cat not.gz
35
41
36 echo %% check hg cat operation
42 echo %% check hg cat operation
37 hg cat a.gz
43 hg cat a.gz
38 hg cat --decode a.gz | gunzip
44 hg cat --decode a.gz | gunzip
39 mkdir subdir
45 mkdir subdir
40 cd subdir
46 cd subdir
41 hg -R .. cat ../a.gz
47 hg -R .. cat ../a.gz
42 hg -R .. cat --decode ../a.gz | gunzip
48 hg -R .. cat --decode ../a.gz | gunzip
@@ -1,14 +1,17
1 %% no changes
1 %% no changes
2 %% no changes
2 %% no changes
3 %% uncompressed contents in repo
3 %% check contents in repo are encoded
4 this is a test
5 THIS IS A TEST
6 %% check committed content was decoded
4 this is a test
7 this is a test
5 %% uncompress our working dir copy
6 this is a test
8 this is a test
7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
8 %% uncompress our new working dir copy
10 %% check decoding of our new working dir copy
11 this is a test
9 this is a test
12 this is a test
10 %% check hg cat operation
13 %% check hg cat operation
11 this is a test
14 this is a test
12 this is a test
15 this is a test
13 this is a test
16 this is a test
14 this is a test
17 this is a test
General Comments 0
You need to be logged in to leave comments. Login now