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