##// END OF EJS Templates
url: support auth.cookiesfile for adding cookies to HTTP requests...
Gregory Szorc -
r31936:806f9a88 default
parent child Browse files
Show More
@@ -1,2369 +1,2389 b''
1 1 The Mercurial system uses a set of configuration files to control
2 2 aspects of its behavior.
3 3
4 4 Troubleshooting
5 5 ===============
6 6
7 7 If you're having problems with your configuration,
8 8 :hg:`config --debug` can help you understand what is introducing
9 9 a setting into your environment.
10 10
11 11 See :hg:`help config.syntax` and :hg:`help config.files`
12 12 for information about how and where to override things.
13 13
14 14 Structure
15 15 =========
16 16
17 17 The configuration files use a simple ini-file format. A configuration
18 18 file consists of sections, led by a ``[section]`` header and followed
19 19 by ``name = value`` entries::
20 20
21 21 [ui]
22 22 username = Firstname Lastname <firstname.lastname@example.net>
23 23 verbose = True
24 24
25 25 The above entries will be referred to as ``ui.username`` and
26 26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
27 27
28 28 Files
29 29 =====
30 30
31 31 Mercurial reads configuration data from several files, if they exist.
32 32 These files do not exist by default and you will have to create the
33 33 appropriate configuration files yourself:
34 34
35 35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
36 36
37 37 Global configuration like the username setting is typically put into:
38 38
39 39 .. container:: windows
40 40
41 41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
42 42
43 43 .. container:: unix.plan9
44 44
45 45 - ``$HOME/.hgrc`` (on Unix, Plan9)
46 46
47 47 The names of these files depend on the system on which Mercurial is
48 48 installed. ``*.rc`` files from a single directory are read in
49 49 alphabetical order, later ones overriding earlier ones. Where multiple
50 50 paths are given below, settings from earlier paths override later
51 51 ones.
52 52
53 53 .. container:: verbose.unix
54 54
55 55 On Unix, the following files are consulted:
56 56
57 57 - ``<repo>/.hg/hgrc`` (per-repository)
58 58 - ``$HOME/.hgrc`` (per-user)
59 59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
60 60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
61 61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
62 62 - ``/etc/mercurial/hgrc`` (per-system)
63 63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
64 64 - ``<internal>/default.d/*.rc`` (defaults)
65 65
66 66 .. container:: verbose.windows
67 67
68 68 On Windows, the following files are consulted:
69 69
70 70 - ``<repo>/.hg/hgrc`` (per-repository)
71 71 - ``%USERPROFILE%\.hgrc`` (per-user)
72 72 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
73 73 - ``%HOME%\.hgrc`` (per-user)
74 74 - ``%HOME%\Mercurial.ini`` (per-user)
75 75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
76 76 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
77 77 - ``<install-dir>\Mercurial.ini`` (per-installation)
78 78 - ``<internal>/default.d/*.rc`` (defaults)
79 79
80 80 .. note::
81 81
82 82 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
83 83 is used when running 32-bit Python on 64-bit Windows.
84 84
85 85 .. container:: windows
86 86
87 87 On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
88 88
89 89 .. container:: verbose.plan9
90 90
91 91 On Plan9, the following files are consulted:
92 92
93 93 - ``<repo>/.hg/hgrc`` (per-repository)
94 94 - ``$home/lib/hgrc`` (per-user)
95 95 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
96 96 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
97 97 - ``/lib/mercurial/hgrc`` (per-system)
98 98 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
99 99 - ``<internal>/default.d/*.rc`` (defaults)
100 100
101 101 Per-repository configuration options only apply in a
102 102 particular repository. This file is not version-controlled, and
103 103 will not get transferred during a "clone" operation. Options in
104 104 this file override options in all other configuration files.
105 105
106 106 .. container:: unix.plan9
107 107
108 108 On Plan 9 and Unix, most of this file will be ignored if it doesn't
109 109 belong to a trusted user or to a trusted group. See
110 110 :hg:`help config.trusted` for more details.
111 111
112 112 Per-user configuration file(s) are for the user running Mercurial. Options
113 113 in these files apply to all Mercurial commands executed by this user in any
114 114 directory. Options in these files override per-system and per-installation
115 115 options.
116 116
117 117 Per-installation configuration files are searched for in the
118 118 directory where Mercurial is installed. ``<install-root>`` is the
119 119 parent directory of the **hg** executable (or symlink) being run.
120 120
121 121 .. container:: unix.plan9
122 122
123 123 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
124 124 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
125 125 files apply to all Mercurial commands executed by any user in any
126 126 directory.
127 127
128 128 Per-installation configuration files are for the system on
129 129 which Mercurial is running. Options in these files apply to all
130 130 Mercurial commands executed by any user in any directory. Registry
131 131 keys contain PATH-like strings, every part of which must reference
132 132 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
133 133 be read. Mercurial checks each of these locations in the specified
134 134 order until one or more configuration files are detected.
135 135
136 136 Per-system configuration files are for the system on which Mercurial
137 137 is running. Options in these files apply to all Mercurial commands
138 138 executed by any user in any directory. Options in these files
139 139 override per-installation options.
140 140
141 141 Mercurial comes with some default configuration. The default configuration
142 142 files are installed with Mercurial and will be overwritten on upgrades. Default
143 143 configuration files should never be edited by users or administrators but can
144 144 be overridden in other configuration files. So far the directory only contains
145 145 merge tool configuration but packagers can also put other default configuration
146 146 there.
147 147
148 148 Syntax
149 149 ======
150 150
151 151 A configuration file consists of sections, led by a ``[section]`` header
152 152 and followed by ``name = value`` entries (sometimes called
153 153 ``configuration keys``)::
154 154
155 155 [spam]
156 156 eggs=ham
157 157 green=
158 158 eggs
159 159
160 160 Each line contains one entry. If the lines that follow are indented,
161 161 they are treated as continuations of that entry. Leading whitespace is
162 162 removed from values. Empty lines are skipped. Lines beginning with
163 163 ``#`` or ``;`` are ignored and may be used to provide comments.
164 164
165 165 Configuration keys can be set multiple times, in which case Mercurial
166 166 will use the value that was configured last. As an example::
167 167
168 168 [spam]
169 169 eggs=large
170 170 ham=serrano
171 171 eggs=small
172 172
173 173 This would set the configuration key named ``eggs`` to ``small``.
174 174
175 175 It is also possible to define a section multiple times. A section can
176 176 be redefined on the same and/or on different configuration files. For
177 177 example::
178 178
179 179 [foo]
180 180 eggs=large
181 181 ham=serrano
182 182 eggs=small
183 183
184 184 [bar]
185 185 eggs=ham
186 186 green=
187 187 eggs
188 188
189 189 [foo]
190 190 ham=prosciutto
191 191 eggs=medium
192 192 bread=toasted
193 193
194 194 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
195 195 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
196 196 respectively. As you can see there only thing that matters is the last
197 197 value that was set for each of the configuration keys.
198 198
199 199 If a configuration key is set multiple times in different
200 200 configuration files the final value will depend on the order in which
201 201 the different configuration files are read, with settings from earlier
202 202 paths overriding later ones as described on the ``Files`` section
203 203 above.
204 204
205 205 A line of the form ``%include file`` will include ``file`` into the
206 206 current configuration file. The inclusion is recursive, which means
207 207 that included files can include other files. Filenames are relative to
208 208 the configuration file in which the ``%include`` directive is found.
209 209 Environment variables and ``~user`` constructs are expanded in
210 210 ``file``. This lets you do something like::
211 211
212 212 %include ~/.hgrc.d/$HOST.rc
213 213
214 214 to include a different configuration file on each computer you use.
215 215
216 216 A line with ``%unset name`` will remove ``name`` from the current
217 217 section, if it has been set previously.
218 218
219 219 The values are either free-form text strings, lists of text strings,
220 220 or Boolean values. Boolean values can be set to true using any of "1",
221 221 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
222 222 (all case insensitive).
223 223
224 224 List values are separated by whitespace or comma, except when values are
225 225 placed in double quotation marks::
226 226
227 227 allow_read = "John Doe, PhD", brian, betty
228 228
229 229 Quotation marks can be escaped by prefixing them with a backslash. Only
230 230 quotation marks at the beginning of a word is counted as a quotation
231 231 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
232 232
233 233 Sections
234 234 ========
235 235
236 236 This section describes the different sections that may appear in a
237 237 Mercurial configuration file, the purpose of each section, its possible
238 238 keys, and their possible values.
239 239
240 240 ``alias``
241 241 ---------
242 242
243 243 Defines command aliases.
244 244
245 245 Aliases allow you to define your own commands in terms of other
246 246 commands (or aliases), optionally including arguments. Positional
247 247 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
248 248 are expanded by Mercurial before execution. Positional arguments not
249 249 already used by ``$N`` in the definition are put at the end of the
250 250 command to be executed.
251 251
252 252 Alias definitions consist of lines of the form::
253 253
254 254 <alias> = <command> [<argument>]...
255 255
256 256 For example, this definition::
257 257
258 258 latest = log --limit 5
259 259
260 260 creates a new command ``latest`` that shows only the five most recent
261 261 changesets. You can define subsequent aliases using earlier ones::
262 262
263 263 stable5 = latest -b stable
264 264
265 265 .. note::
266 266
267 267 It is possible to create aliases with the same names as
268 268 existing commands, which will then override the original
269 269 definitions. This is almost always a bad idea!
270 270
271 271 An alias can start with an exclamation point (``!``) to make it a
272 272 shell alias. A shell alias is executed with the shell and will let you
273 273 run arbitrary commands. As an example, ::
274 274
275 275 echo = !echo $@
276 276
277 277 will let you do ``hg echo foo`` to have ``foo`` printed in your
278 278 terminal. A better example might be::
279 279
280 280 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
281 281
282 282 which will make ``hg purge`` delete all unknown files in the
283 283 repository in the same manner as the purge extension.
284 284
285 285 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
286 286 expand to the command arguments. Unmatched arguments are
287 287 removed. ``$0`` expands to the alias name and ``$@`` expands to all
288 288 arguments separated by a space. ``"$@"`` (with quotes) expands to all
289 289 arguments quoted individually and separated by a space. These expansions
290 290 happen before the command is passed to the shell.
291 291
292 292 Shell aliases are executed in an environment where ``$HG`` expands to
293 293 the path of the Mercurial that was used to execute the alias. This is
294 294 useful when you want to call further Mercurial commands in a shell
295 295 alias, as was done above for the purge alias. In addition,
296 296 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
297 297 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
298 298
299 299 .. note::
300 300
301 301 Some global configuration options such as ``-R`` are
302 302 processed before shell aliases and will thus not be passed to
303 303 aliases.
304 304
305 305
306 306 ``annotate``
307 307 ------------
308 308
309 309 Settings used when displaying file annotations. All values are
310 310 Booleans and default to False. See :hg:`help config.diff` for
311 311 related options for the diff command.
312 312
313 313 ``ignorews``
314 314 Ignore white space when comparing lines.
315 315
316 316 ``ignorewsamount``
317 317 Ignore changes in the amount of white space.
318 318
319 319 ``ignoreblanklines``
320 320 Ignore changes whose lines are all blank.
321 321
322 322
323 323 ``auth``
324 324 --------
325 325
326 Authentication credentials for HTTP authentication. This section
327 allows you to store usernames and passwords for use when logging
328 *into* HTTP servers. See :hg:`help config.web` if
329 you want to configure *who* can login to your HTTP server.
330
331 Each line has the following format::
326 Authentication credentials and other authentication-like configuration
327 for HTTP connections. This section allows you to store usernames and
328 passwords for use when logging *into* HTTP servers. See
329 :hg:`help config.web` if you want to configure *who* can login to
330 your HTTP server.
331
332 The following options apply to all hosts.
333
334 ``cookiefile``
335 Path to a file containing HTTP cookie lines. Cookies matching a
336 host will be sent automatically.
337
338 The file format uses the Mozilla cookies.txt format, which defines cookies
339 on their own lines. Each line contains 7 fields delimited by the tab
340 character (domain, is_domain_cookie, path, is_secure, expires, name,
341 value). For more info, do an Internet search for "Netscape cookies.txt
342 format."
343
344 Note: the cookies parser does not handle port numbers on domains. You
345 will need to remove ports from the domain for the cookie to be recognized.
346 This could result in a cookie being disclosed to an unwanted server.
347
348 The cookies file is read-only.
349
350 Other options in this section are grouped by name and have the following
351 format::
332 352
333 353 <name>.<argument> = <value>
334 354
335 355 where ``<name>`` is used to group arguments into authentication
336 356 entries. Example::
337 357
338 358 foo.prefix = hg.intevation.de/mercurial
339 359 foo.username = foo
340 360 foo.password = bar
341 361 foo.schemes = http https
342 362
343 363 bar.prefix = secure.example.org
344 364 bar.key = path/to/file.key
345 365 bar.cert = path/to/file.cert
346 366 bar.schemes = https
347 367
348 368 Supported arguments:
349 369
350 370 ``prefix``
351 371 Either ``*`` or a URI prefix with or without the scheme part.
352 372 The authentication entry with the longest matching prefix is used
353 373 (where ``*`` matches everything and counts as a match of length
354 374 1). If the prefix doesn't include a scheme, the match is performed
355 375 against the URI with its scheme stripped as well, and the schemes
356 376 argument, q.v., is then subsequently consulted.
357 377
358 378 ``username``
359 379 Optional. Username to authenticate with. If not given, and the
360 380 remote site requires basic or digest authentication, the user will
361 381 be prompted for it. Environment variables are expanded in the
362 382 username letting you do ``foo.username = $USER``. If the URI
363 383 includes a username, only ``[auth]`` entries with a matching
364 384 username or without a username will be considered.
365 385
366 386 ``password``
367 387 Optional. Password to authenticate with. If not given, and the
368 388 remote site requires basic or digest authentication, the user
369 389 will be prompted for it.
370 390
371 391 ``key``
372 392 Optional. PEM encoded client certificate key file. Environment
373 393 variables are expanded in the filename.
374 394
375 395 ``cert``
376 396 Optional. PEM encoded client certificate chain file. Environment
377 397 variables are expanded in the filename.
378 398
379 399 ``schemes``
380 400 Optional. Space separated list of URI schemes to use this
381 401 authentication entry with. Only used if the prefix doesn't include
382 402 a scheme. Supported schemes are http and https. They will match
383 403 static-http and static-https respectively, as well.
384 404 (default: https)
385 405
386 406 If no suitable authentication entry is found, the user is prompted
387 407 for credentials as usual if required by the remote.
388 408
389 409 ``color``
390 410 ---------
391 411
392 412 Configure the Mercurial color mode. For details about how to define your custom
393 413 effect and style see :hg:`help color`.
394 414
395 415 ``mode``
396 416 String: control the method used to output color. One of ``auto``, ``ansi``,
397 417 ``win32``, ``terminfo`` or ``debug``. In auto mode the color extension will
398 418 use ANSI mode by default (or win32 mode on Windows) if it detects a
399 419 terminal. Any invalid value will disable color.
400 420
401 421 ``pagermode``
402 422 String: optinal override of ``color.mode`` used with pager (from the pager
403 423 extensions).
404 424
405 425 On some systems, terminfo mode may cause problems when using
406 426 color with the pager extension and less -R. less with the -R option
407 427 will only display ECMA-48 color codes, and terminfo mode may sometimes
408 428 emit codes that less doesn't understand. You can work around this by
409 429 either using ansi mode (or auto mode), or by using less -r (which will
410 430 pass through all terminal control codes, not just color control
411 431 codes).
412 432
413 433 On some systems (such as MSYS in Windows), the terminal may support
414 434 a different color mode than the pager (activated via the "pager"
415 435 extension).
416 436
417 437 ``commands``
418 438 ------------
419 439
420 440 ``status.relative``
421 441 Make paths in ``hg status`` output relative to the current directory.
422 442 (default: False)
423 443
424 444 ``update.requiredest``
425 445 Require that the user pass a destination when running ``hg update``.
426 446 For example, ``hg update .::`` will be allowed, but a plain ``hg update``
427 447 will be disallowed.
428 448 (default: False)
429 449
430 450 ``committemplate``
431 451 ------------------
432 452
433 453 ``changeset``
434 454 String: configuration in this section is used as the template to
435 455 customize the text shown in the editor when committing.
436 456
437 457 In addition to pre-defined template keywords, commit log specific one
438 458 below can be used for customization:
439 459
440 460 ``extramsg``
441 461 String: Extra message (typically 'Leave message empty to abort
442 462 commit.'). This may be changed by some commands or extensions.
443 463
444 464 For example, the template configuration below shows as same text as
445 465 one shown by default::
446 466
447 467 [committemplate]
448 468 changeset = {desc}\n\n
449 469 HG: Enter commit message. Lines beginning with 'HG:' are removed.
450 470 HG: {extramsg}
451 471 HG: --
452 472 HG: user: {author}\n{ifeq(p2rev, "-1", "",
453 473 "HG: branch merge\n")
454 474 }HG: branch '{branch}'\n{if(activebookmark,
455 475 "HG: bookmark '{activebookmark}'\n") }{subrepos %
456 476 "HG: subrepo {subrepo}\n" }{file_adds %
457 477 "HG: added {file}\n" }{file_mods %
458 478 "HG: changed {file}\n" }{file_dels %
459 479 "HG: removed {file}\n" }{if(files, "",
460 480 "HG: no files changed\n")}
461 481
462 482 ``diff()``
463 483 String: show the diff (see :hg:`help templates` for detail)
464 484
465 485 Sometimes it is helpful to show the diff of the changeset in the editor without
466 486 having to prefix 'HG: ' to each line so that highlighting works correctly. For
467 487 this, Mercurial provides a special string which will ignore everything below
468 488 it::
469 489
470 490 HG: ------------------------ >8 ------------------------
471 491
472 492 For example, the template configuration below will show the diff below the
473 493 extra message::
474 494
475 495 [committemplate]
476 496 changeset = {desc}\n\n
477 497 HG: Enter commit message. Lines beginning with 'HG:' are removed.
478 498 HG: {extramsg}
479 499 HG: ------------------------ >8 ------------------------
480 500 HG: Do not touch the line above.
481 501 HG: Everything below will be removed.
482 502 {diff()}
483 503
484 504 .. note::
485 505
486 506 For some problematic encodings (see :hg:`help win32mbcs` for
487 507 detail), this customization should be configured carefully, to
488 508 avoid showing broken characters.
489 509
490 510 For example, if a multibyte character ending with backslash (0x5c) is
491 511 followed by the ASCII character 'n' in the customized template,
492 512 the sequence of backslash and 'n' is treated as line-feed unexpectedly
493 513 (and the multibyte character is broken, too).
494 514
495 515 Customized template is used for commands below (``--edit`` may be
496 516 required):
497 517
498 518 - :hg:`backout`
499 519 - :hg:`commit`
500 520 - :hg:`fetch` (for merge commit only)
501 521 - :hg:`graft`
502 522 - :hg:`histedit`
503 523 - :hg:`import`
504 524 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
505 525 - :hg:`rebase`
506 526 - :hg:`shelve`
507 527 - :hg:`sign`
508 528 - :hg:`tag`
509 529 - :hg:`transplant`
510 530
511 531 Configuring items below instead of ``changeset`` allows showing
512 532 customized message only for specific actions, or showing different
513 533 messages for each action.
514 534
515 535 - ``changeset.backout`` for :hg:`backout`
516 536 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
517 537 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
518 538 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
519 539 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
520 540 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
521 541 - ``changeset.gpg.sign`` for :hg:`sign`
522 542 - ``changeset.graft`` for :hg:`graft`
523 543 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
524 544 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
525 545 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
526 546 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
527 547 - ``changeset.import.bypass`` for :hg:`import --bypass`
528 548 - ``changeset.import.normal.merge`` for :hg:`import` on merges
529 549 - ``changeset.import.normal.normal`` for :hg:`import` on other
530 550 - ``changeset.mq.qnew`` for :hg:`qnew`
531 551 - ``changeset.mq.qfold`` for :hg:`qfold`
532 552 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
533 553 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
534 554 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
535 555 - ``changeset.rebase.normal`` for :hg:`rebase` on other
536 556 - ``changeset.shelve.shelve`` for :hg:`shelve`
537 557 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
538 558 - ``changeset.tag.remove`` for :hg:`tag --remove`
539 559 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
540 560 - ``changeset.transplant.normal`` for :hg:`transplant` on other
541 561
542 562 These dot-separated lists of names are treated as hierarchical ones.
543 563 For example, ``changeset.tag.remove`` customizes the commit message
544 564 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
545 565 commit message for :hg:`tag` regardless of ``--remove`` option.
546 566
547 567 When the external editor is invoked for a commit, the corresponding
548 568 dot-separated list of names without the ``changeset.`` prefix
549 569 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
550 570 variable.
551 571
552 572 In this section, items other than ``changeset`` can be referred from
553 573 others. For example, the configuration to list committed files up
554 574 below can be referred as ``{listupfiles}``::
555 575
556 576 [committemplate]
557 577 listupfiles = {file_adds %
558 578 "HG: added {file}\n" }{file_mods %
559 579 "HG: changed {file}\n" }{file_dels %
560 580 "HG: removed {file}\n" }{if(files, "",
561 581 "HG: no files changed\n")}
562 582
563 583 ``decode/encode``
564 584 -----------------
565 585
566 586 Filters for transforming files on checkout/checkin. This would
567 587 typically be used for newline processing or other
568 588 localization/canonicalization of files.
569 589
570 590 Filters consist of a filter pattern followed by a filter command.
571 591 Filter patterns are globs by default, rooted at the repository root.
572 592 For example, to match any file ending in ``.txt`` in the root
573 593 directory only, use the pattern ``*.txt``. To match any file ending
574 594 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
575 595 For each file only the first matching filter applies.
576 596
577 597 The filter command can start with a specifier, either ``pipe:`` or
578 598 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
579 599
580 600 A ``pipe:`` command must accept data on stdin and return the transformed
581 601 data on stdout.
582 602
583 603 Pipe example::
584 604
585 605 [encode]
586 606 # uncompress gzip files on checkin to improve delta compression
587 607 # note: not necessarily a good idea, just an example
588 608 *.gz = pipe: gunzip
589 609
590 610 [decode]
591 611 # recompress gzip files when writing them to the working dir (we
592 612 # can safely omit "pipe:", because it's the default)
593 613 *.gz = gzip
594 614
595 615 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
596 616 with the name of a temporary file that contains the data to be
597 617 filtered by the command. The string ``OUTFILE`` is replaced with the name
598 618 of an empty temporary file, where the filtered data must be written by
599 619 the command.
600 620
601 621 .. container:: windows
602 622
603 623 .. note::
604 624
605 625 The tempfile mechanism is recommended for Windows systems,
606 626 where the standard shell I/O redirection operators often have
607 627 strange effects and may corrupt the contents of your files.
608 628
609 629 This filter mechanism is used internally by the ``eol`` extension to
610 630 translate line ending characters between Windows (CRLF) and Unix (LF)
611 631 format. We suggest you use the ``eol`` extension for convenience.
612 632
613 633
614 634 ``defaults``
615 635 ------------
616 636
617 637 (defaults are deprecated. Don't use them. Use aliases instead.)
618 638
619 639 Use the ``[defaults]`` section to define command defaults, i.e. the
620 640 default options/arguments to pass to the specified commands.
621 641
622 642 The following example makes :hg:`log` run in verbose mode, and
623 643 :hg:`status` show only the modified files, by default::
624 644
625 645 [defaults]
626 646 log = -v
627 647 status = -m
628 648
629 649 The actual commands, instead of their aliases, must be used when
630 650 defining command defaults. The command defaults will also be applied
631 651 to the aliases of the commands defined.
632 652
633 653
634 654 ``diff``
635 655 --------
636 656
637 657 Settings used when displaying diffs. Everything except for ``unified``
638 658 is a Boolean and defaults to False. See :hg:`help config.annotate`
639 659 for related options for the annotate command.
640 660
641 661 ``git``
642 662 Use git extended diff format.
643 663
644 664 ``nobinary``
645 665 Omit git binary patches.
646 666
647 667 ``nodates``
648 668 Don't include dates in diff headers.
649 669
650 670 ``noprefix``
651 671 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
652 672
653 673 ``showfunc``
654 674 Show which function each change is in.
655 675
656 676 ``ignorews``
657 677 Ignore white space when comparing lines.
658 678
659 679 ``ignorewsamount``
660 680 Ignore changes in the amount of white space.
661 681
662 682 ``ignoreblanklines``
663 683 Ignore changes whose lines are all blank.
664 684
665 685 ``unified``
666 686 Number of lines of context to show.
667 687
668 688 ``email``
669 689 ---------
670 690
671 691 Settings for extensions that send email messages.
672 692
673 693 ``from``
674 694 Optional. Email address to use in "From" header and SMTP envelope
675 695 of outgoing messages.
676 696
677 697 ``to``
678 698 Optional. Comma-separated list of recipients' email addresses.
679 699
680 700 ``cc``
681 701 Optional. Comma-separated list of carbon copy recipients'
682 702 email addresses.
683 703
684 704 ``bcc``
685 705 Optional. Comma-separated list of blind carbon copy recipients'
686 706 email addresses.
687 707
688 708 ``method``
689 709 Optional. Method to use to send email messages. If value is ``smtp``
690 710 (default), use SMTP (see the ``[smtp]`` section for configuration).
691 711 Otherwise, use as name of program to run that acts like sendmail
692 712 (takes ``-f`` option for sender, list of recipients on command line,
693 713 message on stdin). Normally, setting this to ``sendmail`` or
694 714 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
695 715
696 716 ``charsets``
697 717 Optional. Comma-separated list of character sets considered
698 718 convenient for recipients. Addresses, headers, and parts not
699 719 containing patches of outgoing messages will be encoded in the
700 720 first character set to which conversion from local encoding
701 721 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
702 722 conversion fails, the text in question is sent as is.
703 723 (default: '')
704 724
705 725 Order of outgoing email character sets:
706 726
707 727 1. ``us-ascii``: always first, regardless of settings
708 728 2. ``email.charsets``: in order given by user
709 729 3. ``ui.fallbackencoding``: if not in email.charsets
710 730 4. ``$HGENCODING``: if not in email.charsets
711 731 5. ``utf-8``: always last, regardless of settings
712 732
713 733 Email example::
714 734
715 735 [email]
716 736 from = Joseph User <joe.user@example.com>
717 737 method = /usr/sbin/sendmail
718 738 # charsets for western Europeans
719 739 # us-ascii, utf-8 omitted, as they are tried first and last
720 740 charsets = iso-8859-1, iso-8859-15, windows-1252
721 741
722 742
723 743 ``extensions``
724 744 --------------
725 745
726 746 Mercurial has an extension mechanism for adding new features. To
727 747 enable an extension, create an entry for it in this section.
728 748
729 749 If you know that the extension is already in Python's search path,
730 750 you can give the name of the module, followed by ``=``, with nothing
731 751 after the ``=``.
732 752
733 753 Otherwise, give a name that you choose, followed by ``=``, followed by
734 754 the path to the ``.py`` file (including the file name extension) that
735 755 defines the extension.
736 756
737 757 To explicitly disable an extension that is enabled in an hgrc of
738 758 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
739 759 or ``foo = !`` when path is not supplied.
740 760
741 761 Example for ``~/.hgrc``::
742 762
743 763 [extensions]
744 764 # (the churn extension will get loaded from Mercurial's path)
745 765 churn =
746 766 # (this extension will get loaded from the file specified)
747 767 myfeature = ~/.hgext/myfeature.py
748 768
749 769
750 770 ``format``
751 771 ----------
752 772
753 773 ``usegeneraldelta``
754 774 Enable or disable the "generaldelta" repository format which improves
755 775 repository compression by allowing "revlog" to store delta against arbitrary
756 776 revision instead of the previous stored one. This provides significant
757 777 improvement for repositories with branches.
758 778
759 779 Repositories with this on-disk format require Mercurial version 1.9.
760 780
761 781 Enabled by default.
762 782
763 783 ``dotencode``
764 784 Enable or disable the "dotencode" repository format which enhances
765 785 the "fncache" repository format (which has to be enabled to use
766 786 dotencode) to avoid issues with filenames starting with ._ on
767 787 Mac OS X and spaces on Windows.
768 788
769 789 Repositories with this on-disk format require Mercurial version 1.7.
770 790
771 791 Enabled by default.
772 792
773 793 ``usefncache``
774 794 Enable or disable the "fncache" repository format which enhances
775 795 the "store" repository format (which has to be enabled to use
776 796 fncache) to allow longer filenames and avoids using Windows
777 797 reserved names, e.g. "nul".
778 798
779 799 Repositories with this on-disk format require Mercurial version 1.1.
780 800
781 801 Enabled by default.
782 802
783 803 ``usestore``
784 804 Enable or disable the "store" repository format which improves
785 805 compatibility with systems that fold case or otherwise mangle
786 806 filenames. Disabling this option will allow you to store longer filenames
787 807 in some situations at the expense of compatibility.
788 808
789 809 Repositories with this on-disk format require Mercurial version 0.9.4.
790 810
791 811 Enabled by default.
792 812
793 813 ``graph``
794 814 ---------
795 815
796 816 Web graph view configuration. This section let you change graph
797 817 elements display properties by branches, for instance to make the
798 818 ``default`` branch stand out.
799 819
800 820 Each line has the following format::
801 821
802 822 <branch>.<argument> = <value>
803 823
804 824 where ``<branch>`` is the name of the branch being
805 825 customized. Example::
806 826
807 827 [graph]
808 828 # 2px width
809 829 default.width = 2
810 830 # red color
811 831 default.color = FF0000
812 832
813 833 Supported arguments:
814 834
815 835 ``width``
816 836 Set branch edges width in pixels.
817 837
818 838 ``color``
819 839 Set branch edges color in hexadecimal RGB notation.
820 840
821 841 ``hooks``
822 842 ---------
823 843
824 844 Commands or Python functions that get automatically executed by
825 845 various actions such as starting or finishing a commit. Multiple
826 846 hooks can be run for the same action by appending a suffix to the
827 847 action. Overriding a site-wide hook can be done by changing its
828 848 value or setting it to an empty string. Hooks can be prioritized
829 849 by adding a prefix of ``priority.`` to the hook name on a new line
830 850 and setting the priority. The default priority is 0.
831 851
832 852 Example ``.hg/hgrc``::
833 853
834 854 [hooks]
835 855 # update working directory after adding changesets
836 856 changegroup.update = hg update
837 857 # do not use the site-wide hook
838 858 incoming =
839 859 incoming.email = /my/email/hook
840 860 incoming.autobuild = /my/build/hook
841 861 # force autobuild hook to run before other incoming hooks
842 862 priority.incoming.autobuild = 1
843 863
844 864 Most hooks are run with environment variables set that give useful
845 865 additional information. For each hook below, the environment variables
846 866 it is passed are listed with names of the form ``$HG_foo``. The
847 867 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
848 868 their respectively contains the type of hook which triggered the run and
849 869 the full name of the hooks in the config. In the example about this will
850 870 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
851 871
852 872 ``changegroup``
853 873 Run after a changegroup has been added via push, pull or unbundle. ID of the
854 874 first new changeset is in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. URL
855 875 from which changes came is in ``$HG_URL``.
856 876
857 877 ``commit``
858 878 Run after a changeset has been created in the local repository. ID
859 879 of the newly created changeset is in ``$HG_NODE``. Parent changeset
860 880 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
861 881
862 882 ``incoming``
863 883 Run after a changeset has been pulled, pushed, or unbundled into
864 884 the local repository. The ID of the newly arrived changeset is in
865 885 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
866 886
867 887 ``outgoing``
868 888 Run after sending changes from local repository to another. ID of
869 889 first changeset sent is in ``$HG_NODE``. Source of operation is in
870 890 ``$HG_SOURCE``; Also see :hg:`help config.hooks.preoutgoing` hook.
871 891
872 892 ``post-<command>``
873 893 Run after successful invocations of the associated command. The
874 894 contents of the command line are passed as ``$HG_ARGS`` and the result
875 895 code in ``$HG_RESULT``. Parsed command line arguments are passed as
876 896 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
877 897 the python data internally passed to <command>. ``$HG_OPTS`` is a
878 898 dictionary of options (with unspecified options set to their defaults).
879 899 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
880 900
881 901 ``fail-<command>``
882 902 Run after a failed invocation of an associated command. The contents
883 903 of the command line are passed as ``$HG_ARGS``. Parsed command line
884 904 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
885 905 string representations of the python data internally passed to
886 906 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
887 907 options set to their defaults). ``$HG_PATS`` is a list of arguments.
888 908 Hook failure is ignored.
889 909
890 910 ``pre-<command>``
891 911 Run before executing the associated command. The contents of the
892 912 command line are passed as ``$HG_ARGS``. Parsed command line arguments
893 913 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
894 914 representations of the data internally passed to <command>. ``$HG_OPTS``
895 915 is a dictionary of options (with unspecified options set to their
896 916 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
897 917 failure, the command doesn't execute and Mercurial returns the failure
898 918 code.
899 919
900 920 ``prechangegroup``
901 921 Run before a changegroup is added via push, pull or unbundle. Exit
902 922 status 0 allows the changegroup to proceed. Non-zero status will
903 923 cause the push, pull or unbundle to fail. URL from which changes
904 924 will come is in ``$HG_URL``.
905 925
906 926 ``precommit``
907 927 Run before starting a local commit. Exit status 0 allows the
908 928 commit to proceed. Non-zero status will cause the commit to fail.
909 929 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
910 930
911 931 ``prelistkeys``
912 932 Run before listing pushkeys (like bookmarks) in the
913 933 repository. Non-zero status will cause failure. The key namespace is
914 934 in ``$HG_NAMESPACE``.
915 935
916 936 ``preoutgoing``
917 937 Run before collecting changes to send from the local repository to
918 938 another. Non-zero status will cause failure. This lets you prevent
919 939 pull over HTTP or SSH. Also prevents against local pull, push
920 940 (outbound) or bundle commands, but not effective, since you can
921 941 just copy files instead then. Source of operation is in
922 942 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
923 943 SSH or HTTP repository. If "push", "pull" or "bundle", operation
924 944 is happening on behalf of repository on same system.
925 945
926 946 ``prepushkey``
927 947 Run before a pushkey (like a bookmark) is added to the
928 948 repository. Non-zero status will cause the key to be rejected. The
929 949 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
930 950 the old value (if any) is in ``$HG_OLD``, and the new value is in
931 951 ``$HG_NEW``.
932 952
933 953 ``pretag``
934 954 Run before creating a tag. Exit status 0 allows the tag to be
935 955 created. Non-zero status will cause the tag to fail. ID of
936 956 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
937 957 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
938 958
939 959 ``pretxnopen``
940 960 Run before any new repository transaction is open. The reason for the
941 961 transaction will be in ``$HG_TXNNAME`` and a unique identifier for the
942 962 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
943 963 transaction from being opened.
944 964
945 965 ``pretxnclose``
946 966 Run right before the transaction is actually finalized. Any repository change
947 967 will be visible to the hook program. This lets you validate the transaction
948 968 content or change it. Exit status 0 allows the commit to proceed. Non-zero
949 969 status will cause the transaction to be rolled back. The reason for the
950 970 transaction opening will be in ``$HG_TXNNAME`` and a unique identifier for
951 971 the transaction will be in ``HG_TXNID``. The rest of the available data will
952 972 vary according the transaction type. New changesets will add ``$HG_NODE`` (id
953 973 of the first added changeset), ``$HG_NODE_LAST`` (id of the last added
954 974 changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables, bookmarks and phases
955 975 changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``, etc.
956 976
957 977 ``txnclose``
958 978 Run after any repository transaction has been committed. At this
959 979 point, the transaction can no longer be rolled back. The hook will run
960 980 after the lock is released. See :hg:`help config.hooks.pretxnclose` docs for
961 981 details about available variables.
962 982
963 983 ``txnabort``
964 984 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
965 985 docs for details about available variables.
966 986
967 987 ``pretxnchangegroup``
968 988 Run after a changegroup has been added via push, pull or unbundle, but before
969 989 the transaction has been committed. Changegroup is visible to hook program.
970 990 This lets you validate incoming changes before accepting them. Passed the ID
971 991 of the first new changeset in ``$HG_NODE`` and last in ``$HG_NODE_LAST``.
972 992 Exit status 0 allows the transaction to commit. Non-zero status will cause
973 993 the transaction to be rolled back and the push, pull or unbundle will fail.
974 994 URL that was source of changes is in ``$HG_URL``.
975 995
976 996 ``pretxncommit``
977 997 Run after a changeset has been created but the transaction not yet
978 998 committed. Changeset is visible to hook program. This lets you
979 999 validate commit message and changes. Exit status 0 allows the
980 1000 commit to proceed. Non-zero status will cause the transaction to
981 1001 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
982 1002 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
983 1003
984 1004 ``preupdate``
985 1005 Run before updating the working directory. Exit status 0 allows
986 1006 the update to proceed. Non-zero status will prevent the update.
987 1007 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
988 1008 of second new parent is in ``$HG_PARENT2``.
989 1009
990 1010 ``listkeys``
991 1011 Run after listing pushkeys (like bookmarks) in the repository. The
992 1012 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
993 1013 dictionary containing the keys and values.
994 1014
995 1015 ``pushkey``
996 1016 Run after a pushkey (like a bookmark) is added to the
997 1017 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
998 1018 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
999 1019 value is in ``$HG_NEW``.
1000 1020
1001 1021 ``tag``
1002 1022 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
1003 1023 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
1004 1024 repository if ``$HG_LOCAL=0``.
1005 1025
1006 1026 ``update``
1007 1027 Run after updating the working directory. Changeset ID of first
1008 1028 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
1009 1029 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1010 1030 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
1011 1031
1012 1032 .. note::
1013 1033
1014 1034 It is generally better to use standard hooks rather than the
1015 1035 generic pre- and post- command hooks as they are guaranteed to be
1016 1036 called in the appropriate contexts for influencing transactions.
1017 1037 Also, hooks like "commit" will be called in all contexts that
1018 1038 generate a commit (e.g. tag) and not just the commit command.
1019 1039
1020 1040 .. note::
1021 1041
1022 1042 Environment variables with empty values may not be passed to
1023 1043 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1024 1044 will have an empty value under Unix-like platforms for non-merge
1025 1045 changesets, while it will not be available at all under Windows.
1026 1046
1027 1047 The syntax for Python hooks is as follows::
1028 1048
1029 1049 hookname = python:modulename.submodule.callable
1030 1050 hookname = python:/path/to/python/module.py:callable
1031 1051
1032 1052 Python hooks are run within the Mercurial process. Each hook is
1033 1053 called with at least three keyword arguments: a ui object (keyword
1034 1054 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1035 1055 keyword that tells what kind of hook is used. Arguments listed as
1036 1056 environment variables above are passed as keyword arguments, with no
1037 1057 ``HG_`` prefix, and names in lower case.
1038 1058
1039 1059 If a Python hook returns a "true" value or raises an exception, this
1040 1060 is treated as a failure.
1041 1061
1042 1062
1043 1063 ``hostfingerprints``
1044 1064 --------------------
1045 1065
1046 1066 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1047 1067
1048 1068 Fingerprints of the certificates of known HTTPS servers.
1049 1069
1050 1070 A HTTPS connection to a server with a fingerprint configured here will
1051 1071 only succeed if the servers certificate matches the fingerprint.
1052 1072 This is very similar to how ssh known hosts works.
1053 1073
1054 1074 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1055 1075 Multiple values can be specified (separated by spaces or commas). This can
1056 1076 be used to define both old and new fingerprints while a host transitions
1057 1077 to a new certificate.
1058 1078
1059 1079 The CA chain and web.cacerts is not used for servers with a fingerprint.
1060 1080
1061 1081 For example::
1062 1082
1063 1083 [hostfingerprints]
1064 1084 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1065 1085 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1066 1086
1067 1087 ``hostsecurity``
1068 1088 ----------------
1069 1089
1070 1090 Used to specify global and per-host security settings for connecting to
1071 1091 other machines.
1072 1092
1073 1093 The following options control default behavior for all hosts.
1074 1094
1075 1095 ``ciphers``
1076 1096 Defines the cryptographic ciphers to use for connections.
1077 1097
1078 1098 Value must be a valid OpenSSL Cipher List Format as documented at
1079 1099 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1080 1100
1081 1101 This setting is for advanced users only. Setting to incorrect values
1082 1102 can significantly lower connection security or decrease performance.
1083 1103 You have been warned.
1084 1104
1085 1105 This option requires Python 2.7.
1086 1106
1087 1107 ``minimumprotocol``
1088 1108 Defines the minimum channel encryption protocol to use.
1089 1109
1090 1110 By default, the highest version of TLS supported by both client and server
1091 1111 is used.
1092 1112
1093 1113 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1094 1114
1095 1115 When running on an old Python version, only ``tls1.0`` is allowed since
1096 1116 old versions of Python only support up to TLS 1.0.
1097 1117
1098 1118 When running a Python that supports modern TLS versions, the default is
1099 1119 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1100 1120 weakens security and should only be used as a feature of last resort if
1101 1121 a server does not support TLS 1.1+.
1102 1122
1103 1123 Options in the ``[hostsecurity]`` section can have the form
1104 1124 ``hostname``:``setting``. This allows multiple settings to be defined on a
1105 1125 per-host basis.
1106 1126
1107 1127 The following per-host settings can be defined.
1108 1128
1109 1129 ``ciphers``
1110 1130 This behaves like ``ciphers`` as described above except it only applies
1111 1131 to the host on which it is defined.
1112 1132
1113 1133 ``fingerprints``
1114 1134 A list of hashes of the DER encoded peer/remote certificate. Values have
1115 1135 the form ``algorithm``:``fingerprint``. e.g.
1116 1136 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1117 1137
1118 1138 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1119 1139 ``sha512``.
1120 1140
1121 1141 Use of ``sha256`` or ``sha512`` is preferred.
1122 1142
1123 1143 If a fingerprint is specified, the CA chain is not validated for this
1124 1144 host and Mercurial will require the remote certificate to match one
1125 1145 of the fingerprints specified. This means if the server updates its
1126 1146 certificate, Mercurial will abort until a new fingerprint is defined.
1127 1147 This can provide stronger security than traditional CA-based validation
1128 1148 at the expense of convenience.
1129 1149
1130 1150 This option takes precedence over ``verifycertsfile``.
1131 1151
1132 1152 ``minimumprotocol``
1133 1153 This behaves like ``minimumprotocol`` as described above except it
1134 1154 only applies to the host on which it is defined.
1135 1155
1136 1156 ``verifycertsfile``
1137 1157 Path to file a containing a list of PEM encoded certificates used to
1138 1158 verify the server certificate. Environment variables and ``~user``
1139 1159 constructs are expanded in the filename.
1140 1160
1141 1161 The server certificate or the certificate's certificate authority (CA)
1142 1162 must match a certificate from this file or certificate verification
1143 1163 will fail and connections to the server will be refused.
1144 1164
1145 1165 If defined, only certificates provided by this file will be used:
1146 1166 ``web.cacerts`` and any system/default certificates will not be
1147 1167 used.
1148 1168
1149 1169 This option has no effect if the per-host ``fingerprints`` option
1150 1170 is set.
1151 1171
1152 1172 The format of the file is as follows::
1153 1173
1154 1174 -----BEGIN CERTIFICATE-----
1155 1175 ... (certificate in base64 PEM encoding) ...
1156 1176 -----END CERTIFICATE-----
1157 1177 -----BEGIN CERTIFICATE-----
1158 1178 ... (certificate in base64 PEM encoding) ...
1159 1179 -----END CERTIFICATE-----
1160 1180
1161 1181 For example::
1162 1182
1163 1183 [hostsecurity]
1164 1184 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1165 1185 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1166 1186 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1167 1187
1168 1188 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1169 1189 when connecting to ``hg.example.com``::
1170 1190
1171 1191 [hostsecurity]
1172 1192 minimumprotocol = tls1.2
1173 1193 hg.example.com:minimumprotocol = tls1.1
1174 1194
1175 1195 ``http_proxy``
1176 1196 --------------
1177 1197
1178 1198 Used to access web-based Mercurial repositories through a HTTP
1179 1199 proxy.
1180 1200
1181 1201 ``host``
1182 1202 Host name and (optional) port of the proxy server, for example
1183 1203 "myproxy:8000".
1184 1204
1185 1205 ``no``
1186 1206 Optional. Comma-separated list of host names that should bypass
1187 1207 the proxy.
1188 1208
1189 1209 ``passwd``
1190 1210 Optional. Password to authenticate with at the proxy server.
1191 1211
1192 1212 ``user``
1193 1213 Optional. User name to authenticate with at the proxy server.
1194 1214
1195 1215 ``always``
1196 1216 Optional. Always use the proxy, even for localhost and any entries
1197 1217 in ``http_proxy.no``. (default: False)
1198 1218
1199 1219 ``merge``
1200 1220 ---------
1201 1221
1202 1222 This section specifies behavior during merges and updates.
1203 1223
1204 1224 ``checkignored``
1205 1225 Controls behavior when an ignored file on disk has the same name as a tracked
1206 1226 file in the changeset being merged or updated to, and has different
1207 1227 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1208 1228 abort on such files. With ``warn``, warn on such files and back them up as
1209 1229 ``.orig``. With ``ignore``, don't print a warning and back them up as
1210 1230 ``.orig``. (default: ``abort``)
1211 1231
1212 1232 ``checkunknown``
1213 1233 Controls behavior when an unknown file that isn't ignored has the same name
1214 1234 as a tracked file in the changeset being merged or updated to, and has
1215 1235 different contents. Similar to ``merge.checkignored``, except for files that
1216 1236 are not ignored. (default: ``abort``)
1217 1237
1218 1238 ``merge-patterns``
1219 1239 ------------------
1220 1240
1221 1241 This section specifies merge tools to associate with particular file
1222 1242 patterns. Tools matched here will take precedence over the default
1223 1243 merge tool. Patterns are globs by default, rooted at the repository
1224 1244 root.
1225 1245
1226 1246 Example::
1227 1247
1228 1248 [merge-patterns]
1229 1249 **.c = kdiff3
1230 1250 **.jpg = myimgmerge
1231 1251
1232 1252 ``merge-tools``
1233 1253 ---------------
1234 1254
1235 1255 This section configures external merge tools to use for file-level
1236 1256 merges. This section has likely been preconfigured at install time.
1237 1257 Use :hg:`config merge-tools` to check the existing configuration.
1238 1258 Also see :hg:`help merge-tools` for more details.
1239 1259
1240 1260 Example ``~/.hgrc``::
1241 1261
1242 1262 [merge-tools]
1243 1263 # Override stock tool location
1244 1264 kdiff3.executable = ~/bin/kdiff3
1245 1265 # Specify command line
1246 1266 kdiff3.args = $base $local $other -o $output
1247 1267 # Give higher priority
1248 1268 kdiff3.priority = 1
1249 1269
1250 1270 # Changing the priority of preconfigured tool
1251 1271 meld.priority = 0
1252 1272
1253 1273 # Disable a preconfigured tool
1254 1274 vimdiff.disabled = yes
1255 1275
1256 1276 # Define new tool
1257 1277 myHtmlTool.args = -m $local $other $base $output
1258 1278 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1259 1279 myHtmlTool.priority = 1
1260 1280
1261 1281 Supported arguments:
1262 1282
1263 1283 ``priority``
1264 1284 The priority in which to evaluate this tool.
1265 1285 (default: 0)
1266 1286
1267 1287 ``executable``
1268 1288 Either just the name of the executable or its pathname.
1269 1289
1270 1290 .. container:: windows
1271 1291
1272 1292 On Windows, the path can use environment variables with ${ProgramFiles}
1273 1293 syntax.
1274 1294
1275 1295 (default: the tool name)
1276 1296
1277 1297 ``args``
1278 1298 The arguments to pass to the tool executable. You can refer to the
1279 1299 files being merged as well as the output file through these
1280 1300 variables: ``$base``, ``$local``, ``$other``, ``$output``. The meaning
1281 1301 of ``$local`` and ``$other`` can vary depending on which action is being
1282 1302 performed. During and update or merge, ``$local`` represents the original
1283 1303 state of the file, while ``$other`` represents the commit you are updating
1284 1304 to or the commit you are merging with. During a rebase ``$local``
1285 1305 represents the destination of the rebase, and ``$other`` represents the
1286 1306 commit being rebased.
1287 1307 (default: ``$local $base $other``)
1288 1308
1289 1309 ``premerge``
1290 1310 Attempt to run internal non-interactive 3-way merge tool before
1291 1311 launching external tool. Options are ``true``, ``false``, ``keep`` or
1292 1312 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1293 1313 premerge fails. The ``keep-merge3`` will do the same but include information
1294 1314 about the base of the merge in the marker (see internal :merge3 in
1295 1315 :hg:`help merge-tools`).
1296 1316 (default: True)
1297 1317
1298 1318 ``binary``
1299 1319 This tool can merge binary files. (default: False, unless tool
1300 1320 was selected by file pattern match)
1301 1321
1302 1322 ``symlink``
1303 1323 This tool can merge symlinks. (default: False)
1304 1324
1305 1325 ``check``
1306 1326 A list of merge success-checking options:
1307 1327
1308 1328 ``changed``
1309 1329 Ask whether merge was successful when the merged file shows no changes.
1310 1330 ``conflicts``
1311 1331 Check whether there are conflicts even though the tool reported success.
1312 1332 ``prompt``
1313 1333 Always prompt for merge success, regardless of success reported by tool.
1314 1334
1315 1335 ``fixeol``
1316 1336 Attempt to fix up EOL changes caused by the merge tool.
1317 1337 (default: False)
1318 1338
1319 1339 ``gui``
1320 1340 This tool requires a graphical interface to run. (default: False)
1321 1341
1322 1342 .. container:: windows
1323 1343
1324 1344 ``regkey``
1325 1345 Windows registry key which describes install location of this
1326 1346 tool. Mercurial will search for this key first under
1327 1347 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1328 1348 (default: None)
1329 1349
1330 1350 ``regkeyalt``
1331 1351 An alternate Windows registry key to try if the first key is not
1332 1352 found. The alternate key uses the same ``regname`` and ``regappend``
1333 1353 semantics of the primary key. The most common use for this key
1334 1354 is to search for 32bit applications on 64bit operating systems.
1335 1355 (default: None)
1336 1356
1337 1357 ``regname``
1338 1358 Name of value to read from specified registry key.
1339 1359 (default: the unnamed (default) value)
1340 1360
1341 1361 ``regappend``
1342 1362 String to append to the value read from the registry, typically
1343 1363 the executable name of the tool.
1344 1364 (default: None)
1345 1365
1346 1366
1347 1367 ``patch``
1348 1368 ---------
1349 1369
1350 1370 Settings used when applying patches, for instance through the 'import'
1351 1371 command or with Mercurial Queues extension.
1352 1372
1353 1373 ``eol``
1354 1374 When set to 'strict' patch content and patched files end of lines
1355 1375 are preserved. When set to ``lf`` or ``crlf``, both files end of
1356 1376 lines are ignored when patching and the result line endings are
1357 1377 normalized to either LF (Unix) or CRLF (Windows). When set to
1358 1378 ``auto``, end of lines are again ignored while patching but line
1359 1379 endings in patched files are normalized to their original setting
1360 1380 on a per-file basis. If target file does not exist or has no end
1361 1381 of line, patch line endings are preserved.
1362 1382 (default: strict)
1363 1383
1364 1384 ``fuzz``
1365 1385 The number of lines of 'fuzz' to allow when applying patches. This
1366 1386 controls how much context the patcher is allowed to ignore when
1367 1387 trying to apply a patch.
1368 1388 (default: 2)
1369 1389
1370 1390 ``paths``
1371 1391 ---------
1372 1392
1373 1393 Assigns symbolic names and behavior to repositories.
1374 1394
1375 1395 Options are symbolic names defining the URL or directory that is the
1376 1396 location of the repository. Example::
1377 1397
1378 1398 [paths]
1379 1399 my_server = https://example.com/my_repo
1380 1400 local_path = /home/me/repo
1381 1401
1382 1402 These symbolic names can be used from the command line. To pull
1383 1403 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1384 1404 :hg:`push local_path`.
1385 1405
1386 1406 Options containing colons (``:``) denote sub-options that can influence
1387 1407 behavior for that specific path. Example::
1388 1408
1389 1409 [paths]
1390 1410 my_server = https://example.com/my_path
1391 1411 my_server:pushurl = ssh://example.com/my_path
1392 1412
1393 1413 The following sub-options can be defined:
1394 1414
1395 1415 ``pushurl``
1396 1416 The URL to use for push operations. If not defined, the location
1397 1417 defined by the path's main entry is used.
1398 1418
1399 1419 ``pushrev``
1400 1420 A revset defining which revisions to push by default.
1401 1421
1402 1422 When :hg:`push` is executed without a ``-r`` argument, the revset
1403 1423 defined by this sub-option is evaluated to determine what to push.
1404 1424
1405 1425 For example, a value of ``.`` will push the working directory's
1406 1426 revision by default.
1407 1427
1408 1428 Revsets specifying bookmarks will not result in the bookmark being
1409 1429 pushed.
1410 1430
1411 1431 The following special named paths exist:
1412 1432
1413 1433 ``default``
1414 1434 The URL or directory to use when no source or remote is specified.
1415 1435
1416 1436 :hg:`clone` will automatically define this path to the location the
1417 1437 repository was cloned from.
1418 1438
1419 1439 ``default-push``
1420 1440 (deprecated) The URL or directory for the default :hg:`push` location.
1421 1441 ``default:pushurl`` should be used instead.
1422 1442
1423 1443 ``phases``
1424 1444 ----------
1425 1445
1426 1446 Specifies default handling of phases. See :hg:`help phases` for more
1427 1447 information about working with phases.
1428 1448
1429 1449 ``publish``
1430 1450 Controls draft phase behavior when working as a server. When true,
1431 1451 pushed changesets are set to public in both client and server and
1432 1452 pulled or cloned changesets are set to public in the client.
1433 1453 (default: True)
1434 1454
1435 1455 ``new-commit``
1436 1456 Phase of newly-created commits.
1437 1457 (default: draft)
1438 1458
1439 1459 ``checksubrepos``
1440 1460 Check the phase of the current revision of each subrepository. Allowed
1441 1461 values are "ignore", "follow" and "abort". For settings other than
1442 1462 "ignore", the phase of the current revision of each subrepository is
1443 1463 checked before committing the parent repository. If any of those phases is
1444 1464 greater than the phase of the parent repository (e.g. if a subrepo is in a
1445 1465 "secret" phase while the parent repo is in "draft" phase), the commit is
1446 1466 either aborted (if checksubrepos is set to "abort") or the higher phase is
1447 1467 used for the parent repository commit (if set to "follow").
1448 1468 (default: follow)
1449 1469
1450 1470
1451 1471 ``profiling``
1452 1472 -------------
1453 1473
1454 1474 Specifies profiling type, format, and file output. Two profilers are
1455 1475 supported: an instrumenting profiler (named ``ls``), and a sampling
1456 1476 profiler (named ``stat``).
1457 1477
1458 1478 In this section description, 'profiling data' stands for the raw data
1459 1479 collected during profiling, while 'profiling report' stands for a
1460 1480 statistical text report generated from the profiling data. The
1461 1481 profiling is done using lsprof.
1462 1482
1463 1483 ``enabled``
1464 1484 Enable the profiler.
1465 1485 (default: false)
1466 1486
1467 1487 This is equivalent to passing ``--profile`` on the command line.
1468 1488
1469 1489 ``type``
1470 1490 The type of profiler to use.
1471 1491 (default: stat)
1472 1492
1473 1493 ``ls``
1474 1494 Use Python's built-in instrumenting profiler. This profiler
1475 1495 works on all platforms, but each line number it reports is the
1476 1496 first line of a function. This restriction makes it difficult to
1477 1497 identify the expensive parts of a non-trivial function.
1478 1498 ``stat``
1479 1499 Use a statistical profiler, statprof. This profiler is most
1480 1500 useful for profiling commands that run for longer than about 0.1
1481 1501 seconds.
1482 1502
1483 1503 ``format``
1484 1504 Profiling format. Specific to the ``ls`` instrumenting profiler.
1485 1505 (default: text)
1486 1506
1487 1507 ``text``
1488 1508 Generate a profiling report. When saving to a file, it should be
1489 1509 noted that only the report is saved, and the profiling data is
1490 1510 not kept.
1491 1511 ``kcachegrind``
1492 1512 Format profiling data for kcachegrind use: when saving to a
1493 1513 file, the generated file can directly be loaded into
1494 1514 kcachegrind.
1495 1515
1496 1516 ``statformat``
1497 1517 Profiling format for the ``stat`` profiler.
1498 1518 (default: hotpath)
1499 1519
1500 1520 ``hotpath``
1501 1521 Show a tree-based display containing the hot path of execution (where
1502 1522 most time was spent).
1503 1523 ``bymethod``
1504 1524 Show a table of methods ordered by how frequently they are active.
1505 1525 ``byline``
1506 1526 Show a table of lines in files ordered by how frequently they are active.
1507 1527 ``json``
1508 1528 Render profiling data as JSON.
1509 1529
1510 1530 ``frequency``
1511 1531 Sampling frequency. Specific to the ``stat`` sampling profiler.
1512 1532 (default: 1000)
1513 1533
1514 1534 ``output``
1515 1535 File path where profiling data or report should be saved. If the
1516 1536 file exists, it is replaced. (default: None, data is printed on
1517 1537 stderr)
1518 1538
1519 1539 ``sort``
1520 1540 Sort field. Specific to the ``ls`` instrumenting profiler.
1521 1541 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1522 1542 ``inlinetime``.
1523 1543 (default: inlinetime)
1524 1544
1525 1545 ``limit``
1526 1546 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1527 1547 (default: 30)
1528 1548
1529 1549 ``nested``
1530 1550 Show at most this number of lines of drill-down info after each main entry.
1531 1551 This can help explain the difference between Total and Inline.
1532 1552 Specific to the ``ls`` instrumenting profiler.
1533 1553 (default: 5)
1534 1554
1535 1555 ``progress``
1536 1556 ------------
1537 1557
1538 1558 Mercurial commands can draw progress bars that are as informative as
1539 1559 possible. Some progress bars only offer indeterminate information, while others
1540 1560 have a definite end point.
1541 1561
1542 1562 ``delay``
1543 1563 Number of seconds (float) before showing the progress bar. (default: 3)
1544 1564
1545 1565 ``changedelay``
1546 1566 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1547 1567 that value will be used instead. (default: 1)
1548 1568
1549 1569 ``refresh``
1550 1570 Time in seconds between refreshes of the progress bar. (default: 0.1)
1551 1571
1552 1572 ``format``
1553 1573 Format of the progress bar.
1554 1574
1555 1575 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1556 1576 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1557 1577 last 20 characters of the item, but this can be changed by adding either
1558 1578 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1559 1579 first num characters.
1560 1580
1561 1581 (default: topic bar number estimate)
1562 1582
1563 1583 ``width``
1564 1584 If set, the maximum width of the progress information (that is, min(width,
1565 1585 term width) will be used).
1566 1586
1567 1587 ``clear-complete``
1568 1588 Clear the progress bar after it's done. (default: True)
1569 1589
1570 1590 ``disable``
1571 1591 If true, don't show a progress bar.
1572 1592
1573 1593 ``assume-tty``
1574 1594 If true, ALWAYS show a progress bar, unless disable is given.
1575 1595
1576 1596 ``rebase``
1577 1597 ----------
1578 1598
1579 1599 ``allowdivergence``
1580 1600 Default to False, when True allow creating divergence when performing
1581 1601 rebase of obsolete changesets.
1582 1602
1583 1603 ``revsetalias``
1584 1604 ---------------
1585 1605
1586 1606 Alias definitions for revsets. See :hg:`help revsets` for details.
1587 1607
1588 1608 ``server``
1589 1609 ----------
1590 1610
1591 1611 Controls generic server settings.
1592 1612
1593 1613 ``compressionengines``
1594 1614 List of compression engines and their relative priority to advertise
1595 1615 to clients.
1596 1616
1597 1617 The order of compression engines determines their priority, the first
1598 1618 having the highest priority. If a compression engine is not listed
1599 1619 here, it won't be advertised to clients.
1600 1620
1601 1621 If not set (the default), built-in defaults are used. Run
1602 1622 :hg:`debuginstall` to list available compression engines and their
1603 1623 default wire protocol priority.
1604 1624
1605 1625 Older Mercurial clients only support zlib compression and this setting
1606 1626 has no effect for legacy clients.
1607 1627
1608 1628 ``uncompressed``
1609 1629 Whether to allow clients to clone a repository using the
1610 1630 uncompressed streaming protocol. This transfers about 40% more
1611 1631 data than a regular clone, but uses less memory and CPU on both
1612 1632 server and client. Over a LAN (100 Mbps or better) or a very fast
1613 1633 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1614 1634 regular clone. Over most WAN connections (anything slower than
1615 1635 about 6 Mbps), uncompressed streaming is slower, because of the
1616 1636 extra data transfer overhead. This mode will also temporarily hold
1617 1637 the write lock while determining what data to transfer.
1618 1638 (default: True)
1619 1639
1620 1640 ``preferuncompressed``
1621 1641 When set, clients will try to use the uncompressed streaming
1622 1642 protocol. (default: False)
1623 1643
1624 1644 ``validate``
1625 1645 Whether to validate the completeness of pushed changesets by
1626 1646 checking that all new file revisions specified in manifests are
1627 1647 present. (default: False)
1628 1648
1629 1649 ``maxhttpheaderlen``
1630 1650 Instruct HTTP clients not to send request headers longer than this
1631 1651 many bytes. (default: 1024)
1632 1652
1633 1653 ``bundle1``
1634 1654 Whether to allow clients to push and pull using the legacy bundle1
1635 1655 exchange format. (default: True)
1636 1656
1637 1657 ``bundle1gd``
1638 1658 Like ``bundle1`` but only used if the repository is using the
1639 1659 *generaldelta* storage format. (default: True)
1640 1660
1641 1661 ``bundle1.push``
1642 1662 Whether to allow clients to push using the legacy bundle1 exchange
1643 1663 format. (default: True)
1644 1664
1645 1665 ``bundle1gd.push``
1646 1666 Like ``bundle1.push`` but only used if the repository is using the
1647 1667 *generaldelta* storage format. (default: True)
1648 1668
1649 1669 ``bundle1.pull``
1650 1670 Whether to allow clients to pull using the legacy bundle1 exchange
1651 1671 format. (default: True)
1652 1672
1653 1673 ``bundle1gd.pull``
1654 1674 Like ``bundle1.pull`` but only used if the repository is using the
1655 1675 *generaldelta* storage format. (default: True)
1656 1676
1657 1677 Large repositories using the *generaldelta* storage format should
1658 1678 consider setting this option because converting *generaldelta*
1659 1679 repositories to the exchange format required by the bundle1 data
1660 1680 format can consume a lot of CPU.
1661 1681
1662 1682 ``zliblevel``
1663 1683 Integer between ``-1`` and ``9`` that controls the zlib compression level
1664 1684 for wire protocol commands that send zlib compressed output (notably the
1665 1685 commands that send repository history data).
1666 1686
1667 1687 The default (``-1``) uses the default zlib compression level, which is
1668 1688 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
1669 1689 maximum compression.
1670 1690
1671 1691 Setting this option allows server operators to make trade-offs between
1672 1692 bandwidth and CPU used. Lowering the compression lowers CPU utilization
1673 1693 but sends more bytes to clients.
1674 1694
1675 1695 This option only impacts the HTTP server.
1676 1696
1677 1697 ``zstdlevel``
1678 1698 Integer between ``1`` and ``22`` that controls the zstd compression level
1679 1699 for wire protocol commands. ``1`` is the minimal amount of compression and
1680 1700 ``22`` is the highest amount of compression.
1681 1701
1682 1702 The default (``3``) should be significantly faster than zlib while likely
1683 1703 delivering better compression ratios.
1684 1704
1685 1705 This option only impacts the HTTP server.
1686 1706
1687 1707 See also ``server.zliblevel``.
1688 1708
1689 1709 ``smtp``
1690 1710 --------
1691 1711
1692 1712 Configuration for extensions that need to send email messages.
1693 1713
1694 1714 ``host``
1695 1715 Host name of mail server, e.g. "mail.example.com".
1696 1716
1697 1717 ``port``
1698 1718 Optional. Port to connect to on mail server. (default: 465 if
1699 1719 ``tls`` is smtps; 25 otherwise)
1700 1720
1701 1721 ``tls``
1702 1722 Optional. Method to enable TLS when connecting to mail server: starttls,
1703 1723 smtps or none. (default: none)
1704 1724
1705 1725 ``username``
1706 1726 Optional. User name for authenticating with the SMTP server.
1707 1727 (default: None)
1708 1728
1709 1729 ``password``
1710 1730 Optional. Password for authenticating with the SMTP server. If not
1711 1731 specified, interactive sessions will prompt the user for a
1712 1732 password; non-interactive sessions will fail. (default: None)
1713 1733
1714 1734 ``local_hostname``
1715 1735 Optional. The hostname that the sender can use to identify
1716 1736 itself to the MTA.
1717 1737
1718 1738
1719 1739 ``subpaths``
1720 1740 ------------
1721 1741
1722 1742 Subrepository source URLs can go stale if a remote server changes name
1723 1743 or becomes temporarily unavailable. This section lets you define
1724 1744 rewrite rules of the form::
1725 1745
1726 1746 <pattern> = <replacement>
1727 1747
1728 1748 where ``pattern`` is a regular expression matching a subrepository
1729 1749 source URL and ``replacement`` is the replacement string used to
1730 1750 rewrite it. Groups can be matched in ``pattern`` and referenced in
1731 1751 ``replacements``. For instance::
1732 1752
1733 1753 http://server/(.*)-hg/ = http://hg.server/\1/
1734 1754
1735 1755 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1736 1756
1737 1757 Relative subrepository paths are first made absolute, and the
1738 1758 rewrite rules are then applied on the full (absolute) path. If ``pattern``
1739 1759 doesn't match the full path, an attempt is made to apply it on the
1740 1760 relative path alone. The rules are applied in definition order.
1741 1761
1742 1762 ``templatealias``
1743 1763 -----------------
1744 1764
1745 1765 Alias definitions for templates. See :hg:`help templates` for details.
1746 1766
1747 1767 ``templates``
1748 1768 -------------
1749 1769
1750 1770 Use the ``[templates]`` section to define template strings.
1751 1771 See :hg:`help templates` for details.
1752 1772
1753 1773 ``trusted``
1754 1774 -----------
1755 1775
1756 1776 Mercurial will not use the settings in the
1757 1777 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
1758 1778 user or to a trusted group, as various hgrc features allow arbitrary
1759 1779 commands to be run. This issue is often encountered when configuring
1760 1780 hooks or extensions for shared repositories or servers. However,
1761 1781 the web interface will use some safe settings from the ``[web]``
1762 1782 section.
1763 1783
1764 1784 This section specifies what users and groups are trusted. The
1765 1785 current user is always trusted. To trust everybody, list a user or a
1766 1786 group with name ``*``. These settings must be placed in an
1767 1787 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
1768 1788 user or service running Mercurial.
1769 1789
1770 1790 ``users``
1771 1791 Comma-separated list of trusted users.
1772 1792
1773 1793 ``groups``
1774 1794 Comma-separated list of trusted groups.
1775 1795
1776 1796
1777 1797 ``ui``
1778 1798 ------
1779 1799
1780 1800 User interface controls.
1781 1801
1782 1802 ``archivemeta``
1783 1803 Whether to include the .hg_archival.txt file containing meta data
1784 1804 (hashes for the repository base and for tip) in archives created
1785 1805 by the :hg:`archive` command or downloaded via hgweb.
1786 1806 (default: True)
1787 1807
1788 1808 ``askusername``
1789 1809 Whether to prompt for a username when committing. If True, and
1790 1810 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
1791 1811 be prompted to enter a username. If no username is entered, the
1792 1812 default ``USER@HOST`` is used instead.
1793 1813 (default: False)
1794 1814
1795 1815 ``clonebundles``
1796 1816 Whether the "clone bundles" feature is enabled.
1797 1817
1798 1818 When enabled, :hg:`clone` may download and apply a server-advertised
1799 1819 bundle file from a URL instead of using the normal exchange mechanism.
1800 1820
1801 1821 This can likely result in faster and more reliable clones.
1802 1822
1803 1823 (default: True)
1804 1824
1805 1825 ``clonebundlefallback``
1806 1826 Whether failure to apply an advertised "clone bundle" from a server
1807 1827 should result in fallback to a regular clone.
1808 1828
1809 1829 This is disabled by default because servers advertising "clone
1810 1830 bundles" often do so to reduce server load. If advertised bundles
1811 1831 start mass failing and clients automatically fall back to a regular
1812 1832 clone, this would add significant and unexpected load to the server
1813 1833 since the server is expecting clone operations to be offloaded to
1814 1834 pre-generated bundles. Failing fast (the default behavior) ensures
1815 1835 clients don't overwhelm the server when "clone bundle" application
1816 1836 fails.
1817 1837
1818 1838 (default: False)
1819 1839
1820 1840 ``clonebundleprefers``
1821 1841 Defines preferences for which "clone bundles" to use.
1822 1842
1823 1843 Servers advertising "clone bundles" may advertise multiple available
1824 1844 bundles. Each bundle may have different attributes, such as the bundle
1825 1845 type and compression format. This option is used to prefer a particular
1826 1846 bundle over another.
1827 1847
1828 1848 The following keys are defined by Mercurial:
1829 1849
1830 1850 BUNDLESPEC
1831 1851 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
1832 1852 e.g. ``gzip-v2`` or ``bzip2-v1``.
1833 1853
1834 1854 COMPRESSION
1835 1855 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
1836 1856
1837 1857 Server operators may define custom keys.
1838 1858
1839 1859 Example values: ``COMPRESSION=bzip2``,
1840 1860 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
1841 1861
1842 1862 By default, the first bundle advertised by the server is used.
1843 1863
1844 1864 ``color``
1845 1865 String: when to use to colorize output. possible value are auto, always,
1846 1866 never, or debug (default: never). 'auto' will use color whenever it seems
1847 1867 possible. See :hg:`help color` for details.
1848 1868
1849 1869 (in addition a boolean can be used in place always/never)
1850 1870
1851 1871 ``commitsubrepos``
1852 1872 Whether to commit modified subrepositories when committing the
1853 1873 parent repository. If False and one subrepository has uncommitted
1854 1874 changes, abort the commit.
1855 1875 (default: False)
1856 1876
1857 1877 ``debug``
1858 1878 Print debugging information. (default: False)
1859 1879
1860 1880 ``editor``
1861 1881 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
1862 1882
1863 1883 ``fallbackencoding``
1864 1884 Encoding to try if it's not possible to decode the changelog using
1865 1885 UTF-8. (default: ISO-8859-1)
1866 1886
1867 1887 ``graphnodetemplate``
1868 1888 The template used to print changeset nodes in an ASCII revision graph.
1869 1889 (default: ``{graphnode}``)
1870 1890
1871 1891 ``ignore``
1872 1892 A file to read per-user ignore patterns from. This file should be
1873 1893 in the same format as a repository-wide .hgignore file. Filenames
1874 1894 are relative to the repository root. This option supports hook syntax,
1875 1895 so if you want to specify multiple ignore files, you can do so by
1876 1896 setting something like ``ignore.other = ~/.hgignore2``. For details
1877 1897 of the ignore file format, see the ``hgignore(5)`` man page.
1878 1898
1879 1899 ``interactive``
1880 1900 Allow to prompt the user. (default: True)
1881 1901
1882 1902 ``interface``
1883 1903 Select the default interface for interactive features (default: text).
1884 1904 Possible values are 'text' and 'curses'.
1885 1905
1886 1906 ``interface.chunkselector``
1887 1907 Select the interface for change recording (e.g. :hg:`commit -i`).
1888 1908 Possible values are 'text' and 'curses'.
1889 1909 This config overrides the interface specified by ui.interface.
1890 1910
1891 1911 ``logtemplate``
1892 1912 Template string for commands that print changesets.
1893 1913
1894 1914 ``merge``
1895 1915 The conflict resolution program to use during a manual merge.
1896 1916 For more information on merge tools see :hg:`help merge-tools`.
1897 1917 For configuring merge tools see the ``[merge-tools]`` section.
1898 1918
1899 1919 ``mergemarkers``
1900 1920 Sets the merge conflict marker label styling. The ``detailed``
1901 1921 style uses the ``mergemarkertemplate`` setting to style the labels.
1902 1922 The ``basic`` style just uses 'local' and 'other' as the marker label.
1903 1923 One of ``basic`` or ``detailed``.
1904 1924 (default: ``basic``)
1905 1925
1906 1926 ``mergemarkertemplate``
1907 1927 The template used to print the commit description next to each conflict
1908 1928 marker during merge conflicts. See :hg:`help templates` for the template
1909 1929 format.
1910 1930
1911 1931 Defaults to showing the hash, tags, branches, bookmarks, author, and
1912 1932 the first line of the commit description.
1913 1933
1914 1934 If you use non-ASCII characters in names for tags, branches, bookmarks,
1915 1935 authors, and/or commit descriptions, you must pay attention to encodings of
1916 1936 managed files. At template expansion, non-ASCII characters use the encoding
1917 1937 specified by the ``--encoding`` global option, ``HGENCODING`` or other
1918 1938 environment variables that govern your locale. If the encoding of the merge
1919 1939 markers is different from the encoding of the merged files,
1920 1940 serious problems may occur.
1921 1941
1922 1942 ``origbackuppath``
1923 1943 The path to a directory used to store generated .orig files. If the path is
1924 1944 not a directory, one will be created.
1925 1945
1926 1946 ``patch``
1927 1947 An optional external tool that ``hg import`` and some extensions
1928 1948 will use for applying patches. By default Mercurial uses an
1929 1949 internal patch utility. The external tool must work as the common
1930 1950 Unix ``patch`` program. In particular, it must accept a ``-p``
1931 1951 argument to strip patch headers, a ``-d`` argument to specify the
1932 1952 current directory, a file name to patch, and a patch file to take
1933 1953 from stdin.
1934 1954
1935 1955 It is possible to specify a patch tool together with extra
1936 1956 arguments. For example, setting this option to ``patch --merge``
1937 1957 will use the ``patch`` program with its 2-way merge option.
1938 1958
1939 1959 ``portablefilenames``
1940 1960 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
1941 1961 (default: ``warn``)
1942 1962
1943 1963 ``warn``
1944 1964 Print a warning message on POSIX platforms, if a file with a non-portable
1945 1965 filename is added (e.g. a file with a name that can't be created on
1946 1966 Windows because it contains reserved parts like ``AUX``, reserved
1947 1967 characters like ``:``, or would cause a case collision with an existing
1948 1968 file).
1949 1969
1950 1970 ``ignore``
1951 1971 Don't print a warning.
1952 1972
1953 1973 ``abort``
1954 1974 The command is aborted.
1955 1975
1956 1976 ``true``
1957 1977 Alias for ``warn``.
1958 1978
1959 1979 ``false``
1960 1980 Alias for ``ignore``.
1961 1981
1962 1982 .. container:: windows
1963 1983
1964 1984 On Windows, this configuration option is ignored and the command aborted.
1965 1985
1966 1986 ``quiet``
1967 1987 Reduce the amount of output printed.
1968 1988 (default: False)
1969 1989
1970 1990 ``remotecmd``
1971 1991 Remote command to use for clone/push/pull operations.
1972 1992 (default: ``hg``)
1973 1993
1974 1994 ``report_untrusted``
1975 1995 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
1976 1996 trusted user or group.
1977 1997 (default: True)
1978 1998
1979 1999 ``slash``
1980 2000 Display paths using a slash (``/``) as the path separator. This
1981 2001 only makes a difference on systems where the default path
1982 2002 separator is not the slash character (e.g. Windows uses the
1983 2003 backslash character (``\``)).
1984 2004 (default: False)
1985 2005
1986 2006 ``statuscopies``
1987 2007 Display copies in the status command.
1988 2008
1989 2009 ``ssh``
1990 2010 Command to use for SSH connections. (default: ``ssh``)
1991 2011
1992 2012 ``strict``
1993 2013 Require exact command names, instead of allowing unambiguous
1994 2014 abbreviations. (default: False)
1995 2015
1996 2016 ``style``
1997 2017 Name of style to use for command output.
1998 2018
1999 2019 ``supportcontact``
2000 2020 A URL where users should report a Mercurial traceback. Use this if you are a
2001 2021 large organisation with its own Mercurial deployment process and crash
2002 2022 reports should be addressed to your internal support.
2003 2023
2004 2024 ``textwidth``
2005 2025 Maximum width of help text. A longer line generated by ``hg help`` or
2006 2026 ``hg subcommand --help`` will be broken after white space to get this
2007 2027 width or the terminal width, whichever comes first.
2008 2028 A non-positive value will disable this and the terminal width will be
2009 2029 used. (default: 78)
2010 2030
2011 2031 ``timeout``
2012 2032 The timeout used when a lock is held (in seconds), a negative value
2013 2033 means no timeout. (default: 600)
2014 2034
2015 2035 ``traceback``
2016 2036 Mercurial always prints a traceback when an unknown exception
2017 2037 occurs. Setting this to True will make Mercurial print a traceback
2018 2038 on all exceptions, even those recognized by Mercurial (such as
2019 2039 IOError or MemoryError). (default: False)
2020 2040
2021 2041 ``username``
2022 2042 The committer of a changeset created when running "commit".
2023 2043 Typically a person's name and email address, e.g. ``Fred Widget
2024 2044 <fred@example.com>``. Environment variables in the
2025 2045 username are expanded.
2026 2046
2027 2047 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2028 2048 hgrc is empty, e.g. if the system admin set ``username =`` in the
2029 2049 system hgrc, it has to be specified manually or in a different
2030 2050 hgrc file)
2031 2051
2032 2052 ``verbose``
2033 2053 Increase the amount of output printed. (default: False)
2034 2054
2035 2055
2036 2056 ``web``
2037 2057 -------
2038 2058
2039 2059 Web interface configuration. The settings in this section apply to
2040 2060 both the builtin webserver (started by :hg:`serve`) and the script you
2041 2061 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2042 2062 and WSGI).
2043 2063
2044 2064 The Mercurial webserver does no authentication (it does not prompt for
2045 2065 usernames and passwords to validate *who* users are), but it does do
2046 2066 authorization (it grants or denies access for *authenticated users*
2047 2067 based on settings in this section). You must either configure your
2048 2068 webserver to do authentication for you, or disable the authorization
2049 2069 checks.
2050 2070
2051 2071 For a quick setup in a trusted environment, e.g., a private LAN, where
2052 2072 you want it to accept pushes from anybody, you can use the following
2053 2073 command line::
2054 2074
2055 2075 $ hg --config web.allow_push=* --config web.push_ssl=False serve
2056 2076
2057 2077 Note that this will allow anybody to push anything to the server and
2058 2078 that this should not be used for public servers.
2059 2079
2060 2080 The full set of options is:
2061 2081
2062 2082 ``accesslog``
2063 2083 Where to output the access log. (default: stdout)
2064 2084
2065 2085 ``address``
2066 2086 Interface address to bind to. (default: all)
2067 2087
2068 2088 ``allow_archive``
2069 2089 List of archive format (bz2, gz, zip) allowed for downloading.
2070 2090 (default: empty)
2071 2091
2072 2092 ``allowbz2``
2073 2093 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2074 2094 revisions.
2075 2095 (default: False)
2076 2096
2077 2097 ``allowgz``
2078 2098 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2079 2099 revisions.
2080 2100 (default: False)
2081 2101
2082 2102 ``allowpull``
2083 2103 Whether to allow pulling from the repository. (default: True)
2084 2104
2085 2105 ``allow_push``
2086 2106 Whether to allow pushing to the repository. If empty or not set,
2087 2107 pushing is not allowed. If the special value ``*``, any remote
2088 2108 user can push, including unauthenticated users. Otherwise, the
2089 2109 remote user must have been authenticated, and the authenticated
2090 2110 user name must be present in this list. The contents of the
2091 2111 allow_push list are examined after the deny_push list.
2092 2112
2093 2113 ``allow_read``
2094 2114 If the user has not already been denied repository access due to
2095 2115 the contents of deny_read, this list determines whether to grant
2096 2116 repository access to the user. If this list is not empty, and the
2097 2117 user is unauthenticated or not present in the list, then access is
2098 2118 denied for the user. If the list is empty or not set, then access
2099 2119 is permitted to all users by default. Setting allow_read to the
2100 2120 special value ``*`` is equivalent to it not being set (i.e. access
2101 2121 is permitted to all users). The contents of the allow_read list are
2102 2122 examined after the deny_read list.
2103 2123
2104 2124 ``allowzip``
2105 2125 (DEPRECATED) Whether to allow .zip downloading of repository
2106 2126 revisions. This feature creates temporary files.
2107 2127 (default: False)
2108 2128
2109 2129 ``archivesubrepos``
2110 2130 Whether to recurse into subrepositories when archiving.
2111 2131 (default: False)
2112 2132
2113 2133 ``baseurl``
2114 2134 Base URL to use when publishing URLs in other locations, so
2115 2135 third-party tools like email notification hooks can construct
2116 2136 URLs. Example: ``http://hgserver/repos/``.
2117 2137
2118 2138 ``cacerts``
2119 2139 Path to file containing a list of PEM encoded certificate
2120 2140 authority certificates. Environment variables and ``~user``
2121 2141 constructs are expanded in the filename. If specified on the
2122 2142 client, then it will verify the identity of remote HTTPS servers
2123 2143 with these certificates.
2124 2144
2125 2145 To disable SSL verification temporarily, specify ``--insecure`` from
2126 2146 command line.
2127 2147
2128 2148 You can use OpenSSL's CA certificate file if your platform has
2129 2149 one. On most Linux systems this will be
2130 2150 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2131 2151 generate this file manually. The form must be as follows::
2132 2152
2133 2153 -----BEGIN CERTIFICATE-----
2134 2154 ... (certificate in base64 PEM encoding) ...
2135 2155 -----END CERTIFICATE-----
2136 2156 -----BEGIN CERTIFICATE-----
2137 2157 ... (certificate in base64 PEM encoding) ...
2138 2158 -----END CERTIFICATE-----
2139 2159
2140 2160 ``cache``
2141 2161 Whether to support caching in hgweb. (default: True)
2142 2162
2143 2163 ``certificate``
2144 2164 Certificate to use when running :hg:`serve`.
2145 2165
2146 2166 ``collapse``
2147 2167 With ``descend`` enabled, repositories in subdirectories are shown at
2148 2168 a single level alongside repositories in the current path. With
2149 2169 ``collapse`` also enabled, repositories residing at a deeper level than
2150 2170 the current path are grouped behind navigable directory entries that
2151 2171 lead to the locations of these repositories. In effect, this setting
2152 2172 collapses each collection of repositories found within a subdirectory
2153 2173 into a single entry for that subdirectory. (default: False)
2154 2174
2155 2175 ``comparisoncontext``
2156 2176 Number of lines of context to show in side-by-side file comparison. If
2157 2177 negative or the value ``full``, whole files are shown. (default: 5)
2158 2178
2159 2179 This setting can be overridden by a ``context`` request parameter to the
2160 2180 ``comparison`` command, taking the same values.
2161 2181
2162 2182 ``contact``
2163 2183 Name or email address of the person in charge of the repository.
2164 2184 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2165 2185
2166 2186 ``csp``
2167 2187 Send a ``Content-Security-Policy`` HTTP header with this value.
2168 2188
2169 2189 The value may contain a special string ``%nonce%``, which will be replaced
2170 2190 by a randomly-generated one-time use value. If the value contains
2171 2191 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2172 2192 one-time property of the nonce. This nonce will also be inserted into
2173 2193 ``<script>`` elements containing inline JavaScript.
2174 2194
2175 2195 Note: lots of HTML content sent by the server is derived from repository
2176 2196 data. Please consider the potential for malicious repository data to
2177 2197 "inject" itself into generated HTML content as part of your security
2178 2198 threat model.
2179 2199
2180 2200 ``deny_push``
2181 2201 Whether to deny pushing to the repository. If empty or not set,
2182 2202 push is not denied. If the special value ``*``, all remote users are
2183 2203 denied push. Otherwise, unauthenticated users are all denied, and
2184 2204 any authenticated user name present in this list is also denied. The
2185 2205 contents of the deny_push list are examined before the allow_push list.
2186 2206
2187 2207 ``deny_read``
2188 2208 Whether to deny reading/viewing of the repository. If this list is
2189 2209 not empty, unauthenticated users are all denied, and any
2190 2210 authenticated user name present in this list is also denied access to
2191 2211 the repository. If set to the special value ``*``, all remote users
2192 2212 are denied access (rarely needed ;). If deny_read is empty or not set,
2193 2213 the determination of repository access depends on the presence and
2194 2214 content of the allow_read list (see description). If both
2195 2215 deny_read and allow_read are empty or not set, then access is
2196 2216 permitted to all users by default. If the repository is being
2197 2217 served via hgwebdir, denied users will not be able to see it in
2198 2218 the list of repositories. The contents of the deny_read list have
2199 2219 priority over (are examined before) the contents of the allow_read
2200 2220 list.
2201 2221
2202 2222 ``descend``
2203 2223 hgwebdir indexes will not descend into subdirectories. Only repositories
2204 2224 directly in the current path will be shown (other repositories are still
2205 2225 available from the index corresponding to their containing path).
2206 2226
2207 2227 ``description``
2208 2228 Textual description of the repository's purpose or contents.
2209 2229 (default: "unknown")
2210 2230
2211 2231 ``encoding``
2212 2232 Character encoding name. (default: the current locale charset)
2213 2233 Example: "UTF-8".
2214 2234
2215 2235 ``errorlog``
2216 2236 Where to output the error log. (default: stderr)
2217 2237
2218 2238 ``guessmime``
2219 2239 Control MIME types for raw download of file content.
2220 2240 Set to True to let hgweb guess the content type from the file
2221 2241 extension. This will serve HTML files as ``text/html`` and might
2222 2242 allow cross-site scripting attacks when serving untrusted
2223 2243 repositories. (default: False)
2224 2244
2225 2245 ``hidden``
2226 2246 Whether to hide the repository in the hgwebdir index.
2227 2247 (default: False)
2228 2248
2229 2249 ``ipv6``
2230 2250 Whether to use IPv6. (default: False)
2231 2251
2232 2252 ``labels``
2233 2253 List of string *labels* associated with the repository.
2234 2254
2235 2255 Labels are exposed as a template keyword and can be used to customize
2236 2256 output. e.g. the ``index`` template can group or filter repositories
2237 2257 by labels and the ``summary`` template can display additional content
2238 2258 if a specific label is present.
2239 2259
2240 2260 ``logoimg``
2241 2261 File name of the logo image that some templates display on each page.
2242 2262 The file name is relative to ``staticurl``. That is, the full path to
2243 2263 the logo image is "staticurl/logoimg".
2244 2264 If unset, ``hglogo.png`` will be used.
2245 2265
2246 2266 ``logourl``
2247 2267 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2248 2268 will be used.
2249 2269
2250 2270 ``maxchanges``
2251 2271 Maximum number of changes to list on the changelog. (default: 10)
2252 2272
2253 2273 ``maxfiles``
2254 2274 Maximum number of files to list per changeset. (default: 10)
2255 2275
2256 2276 ``maxshortchanges``
2257 2277 Maximum number of changes to list on the shortlog, graph or filelog
2258 2278 pages. (default: 60)
2259 2279
2260 2280 ``name``
2261 2281 Repository name to use in the web interface.
2262 2282 (default: current working directory)
2263 2283
2264 2284 ``port``
2265 2285 Port to listen on. (default: 8000)
2266 2286
2267 2287 ``prefix``
2268 2288 Prefix path to serve from. (default: '' (server root))
2269 2289
2270 2290 ``push_ssl``
2271 2291 Whether to require that inbound pushes be transported over SSL to
2272 2292 prevent password sniffing. (default: True)
2273 2293
2274 2294 ``refreshinterval``
2275 2295 How frequently directory listings re-scan the filesystem for new
2276 2296 repositories, in seconds. This is relevant when wildcards are used
2277 2297 to define paths. Depending on how much filesystem traversal is
2278 2298 required, refreshing may negatively impact performance.
2279 2299
2280 2300 Values less than or equal to 0 always refresh.
2281 2301 (default: 20)
2282 2302
2283 2303 ``staticurl``
2284 2304 Base URL to use for static files. If unset, static files (e.g. the
2285 2305 hgicon.png favicon) will be served by the CGI script itself. Use
2286 2306 this setting to serve them directly with the HTTP server.
2287 2307 Example: ``http://hgserver/static/``.
2288 2308
2289 2309 ``stripes``
2290 2310 How many lines a "zebra stripe" should span in multi-line output.
2291 2311 Set to 0 to disable. (default: 1)
2292 2312
2293 2313 ``style``
2294 2314 Which template map style to use. The available options are the names of
2295 2315 subdirectories in the HTML templates path. (default: ``paper``)
2296 2316 Example: ``monoblue``.
2297 2317
2298 2318 ``templates``
2299 2319 Where to find the HTML templates. The default path to the HTML templates
2300 2320 can be obtained from ``hg debuginstall``.
2301 2321
2302 2322 ``websub``
2303 2323 ----------
2304 2324
2305 2325 Web substitution filter definition. You can use this section to
2306 2326 define a set of regular expression substitution patterns which
2307 2327 let you automatically modify the hgweb server output.
2308 2328
2309 2329 The default hgweb templates only apply these substitution patterns
2310 2330 on the revision description fields. You can apply them anywhere
2311 2331 you want when you create your own templates by adding calls to the
2312 2332 "websub" filter (usually after calling the "escape" filter).
2313 2333
2314 2334 This can be used, for example, to convert issue references to links
2315 2335 to your issue tracker, or to convert "markdown-like" syntax into
2316 2336 HTML (see the examples below).
2317 2337
2318 2338 Each entry in this section names a substitution filter.
2319 2339 The value of each entry defines the substitution expression itself.
2320 2340 The websub expressions follow the old interhg extension syntax,
2321 2341 which in turn imitates the Unix sed replacement syntax::
2322 2342
2323 2343 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2324 2344
2325 2345 You can use any separator other than "/". The final "i" is optional
2326 2346 and indicates that the search must be case insensitive.
2327 2347
2328 2348 Examples::
2329 2349
2330 2350 [websub]
2331 2351 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2332 2352 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2333 2353 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2334 2354
2335 2355 ``worker``
2336 2356 ----------
2337 2357
2338 2358 Parallel master/worker configuration. We currently perform working
2339 2359 directory updates in parallel on Unix-like systems, which greatly
2340 2360 helps performance.
2341 2361
2342 2362 ``numcpus``
2343 2363 Number of CPUs to use for parallel operations. A zero or
2344 2364 negative value is treated as ``use the default``.
2345 2365 (default: 4 or the number of CPUs on the system, whichever is larger)
2346 2366
2347 2367 ``backgroundclose``
2348 2368 Whether to enable closing file handles on background threads during certain
2349 2369 operations. Some platforms aren't very efficient at closing file
2350 2370 handles that have been written or appended to. By performing file closing
2351 2371 on background threads, file write rate can increase substantially.
2352 2372 (default: true on Windows, false elsewhere)
2353 2373
2354 2374 ``backgroundcloseminfilecount``
2355 2375 Minimum number of files required to trigger background file closing.
2356 2376 Operations not writing this many files won't start background close
2357 2377 threads.
2358 2378 (default: 2048)
2359 2379
2360 2380 ``backgroundclosemaxqueue``
2361 2381 The maximum number of opened file handles waiting to be closed in the
2362 2382 background. This option only has an effect if ``backgroundclose`` is
2363 2383 enabled.
2364 2384 (default: 384)
2365 2385
2366 2386 ``backgroundclosethreadcount``
2367 2387 Number of threads to process background file closes. Only relevant if
2368 2388 ``backgroundclose`` is enabled.
2369 2389 (default: 4)
@@ -1,486 +1,516 b''
1 1 # url.py - HTTP handling for mercurial
2 2 #
3 3 # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
4 4 # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
5 5 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
6 6 #
7 7 # This software may be used and distributed according to the terms of the
8 8 # GNU General Public License version 2 or any later version.
9 9
10 10 from __future__ import absolute_import
11 11
12 12 import base64
13 13 import os
14 14 import socket
15 15
16 16 from .i18n import _
17 17 from . import (
18 18 encoding,
19 19 error,
20 20 httpconnection as httpconnectionmod,
21 21 keepalive,
22 22 sslutil,
23 23 util,
24 24 )
25 25
26 26 httplib = util.httplib
27 27 stringio = util.stringio
28 28 urlerr = util.urlerr
29 29 urlreq = util.urlreq
30 30
31 31 class passwordmgr(object):
32 32 def __init__(self, ui, passwddb):
33 33 self.ui = ui
34 34 self.passwddb = passwddb
35 35
36 36 def add_password(self, realm, uri, user, passwd):
37 37 return self.passwddb.add_password(realm, uri, user, passwd)
38 38
39 39 def find_user_password(self, realm, authuri):
40 40 authinfo = self.passwddb.find_user_password(realm, authuri)
41 41 user, passwd = authinfo
42 42 if user and passwd:
43 43 self._writedebug(user, passwd)
44 44 return (user, passwd)
45 45
46 46 if not user or not passwd:
47 47 res = httpconnectionmod.readauthforuri(self.ui, authuri, user)
48 48 if res:
49 49 group, auth = res
50 50 user, passwd = auth.get('username'), auth.get('password')
51 51 self.ui.debug("using auth.%s.* for authentication\n" % group)
52 52 if not user or not passwd:
53 53 u = util.url(authuri)
54 54 u.query = None
55 55 if not self.ui.interactive():
56 56 raise error.Abort(_('http authorization required for %s') %
57 57 util.hidepassword(str(u)))
58 58
59 59 self.ui.write(_("http authorization required for %s\n") %
60 60 util.hidepassword(str(u)))
61 61 self.ui.write(_("realm: %s\n") % realm)
62 62 if user:
63 63 self.ui.write(_("user: %s\n") % user)
64 64 else:
65 65 user = self.ui.prompt(_("user:"), default=None)
66 66
67 67 if not passwd:
68 68 passwd = self.ui.getpass()
69 69
70 70 self.passwddb.add_password(realm, authuri, user, passwd)
71 71 self._writedebug(user, passwd)
72 72 return (user, passwd)
73 73
74 74 def _writedebug(self, user, passwd):
75 75 msg = _('http auth: user %s, password %s\n')
76 76 self.ui.debug(msg % (user, passwd and '*' * len(passwd) or 'not set'))
77 77
78 78 def find_stored_password(self, authuri):
79 79 return self.passwddb.find_user_password(None, authuri)
80 80
81 81 class proxyhandler(urlreq.proxyhandler):
82 82 def __init__(self, ui):
83 83 proxyurl = (ui.config("http_proxy", "host") or
84 84 encoding.environ.get('http_proxy'))
85 85 # XXX proxyauthinfo = None
86 86
87 87 if proxyurl:
88 88 # proxy can be proper url or host[:port]
89 89 if not (proxyurl.startswith('http:') or
90 90 proxyurl.startswith('https:')):
91 91 proxyurl = 'http://' + proxyurl + '/'
92 92 proxy = util.url(proxyurl)
93 93 if not proxy.user:
94 94 proxy.user = ui.config("http_proxy", "user")
95 95 proxy.passwd = ui.config("http_proxy", "passwd")
96 96
97 97 # see if we should use a proxy for this url
98 98 no_list = ["localhost", "127.0.0.1"]
99 99 no_list.extend([p.lower() for
100 100 p in ui.configlist("http_proxy", "no")])
101 101 no_list.extend([p.strip().lower() for
102 102 p in encoding.environ.get("no_proxy", '').split(',')
103 103 if p.strip()])
104 104 # "http_proxy.always" config is for running tests on localhost
105 105 if ui.configbool("http_proxy", "always"):
106 106 self.no_list = []
107 107 else:
108 108 self.no_list = no_list
109 109
110 110 proxyurl = str(proxy)
111 111 proxies = {'http': proxyurl, 'https': proxyurl}
112 112 ui.debug('proxying through http://%s:%s\n' %
113 113 (proxy.host, proxy.port))
114 114 else:
115 115 proxies = {}
116 116
117 117 urlreq.proxyhandler.__init__(self, proxies)
118 118 self.ui = ui
119 119
120 120 def proxy_open(self, req, proxy, type_):
121 121 host = req.get_host().split(':')[0]
122 122 for e in self.no_list:
123 123 if host == e:
124 124 return None
125 125 if e.startswith('*.') and host.endswith(e[2:]):
126 126 return None
127 127 if e.startswith('.') and host.endswith(e[1:]):
128 128 return None
129 129
130 130 return urlreq.proxyhandler.proxy_open(self, req, proxy, type_)
131 131
132 132 def _gen_sendfile(orgsend):
133 133 def _sendfile(self, data):
134 134 # send a file
135 135 if isinstance(data, httpconnectionmod.httpsendfile):
136 136 # if auth required, some data sent twice, so rewind here
137 137 data.seek(0)
138 138 for chunk in util.filechunkiter(data):
139 139 orgsend(self, chunk)
140 140 else:
141 141 orgsend(self, data)
142 142 return _sendfile
143 143
144 144 has_https = util.safehasattr(urlreq, 'httpshandler')
145 145
146 146 class httpconnection(keepalive.HTTPConnection):
147 147 # must be able to send big bundle as stream.
148 148 send = _gen_sendfile(keepalive.HTTPConnection.send)
149 149
150 150 def getresponse(self):
151 151 proxyres = getattr(self, 'proxyres', None)
152 152 if proxyres:
153 153 if proxyres.will_close:
154 154 self.close()
155 155 self.proxyres = None
156 156 return proxyres
157 157 return keepalive.HTTPConnection.getresponse(self)
158 158
159 159 # general transaction handler to support different ways to handle
160 160 # HTTPS proxying before and after Python 2.6.3.
161 161 def _generic_start_transaction(handler, h, req):
162 162 tunnel_host = getattr(req, '_tunnel_host', None)
163 163 if tunnel_host:
164 164 if tunnel_host[:7] not in ['http://', 'https:/']:
165 165 tunnel_host = 'https://' + tunnel_host
166 166 new_tunnel = True
167 167 else:
168 168 tunnel_host = req.get_selector()
169 169 new_tunnel = False
170 170
171 171 if new_tunnel or tunnel_host == req.get_full_url(): # has proxy
172 172 u = util.url(tunnel_host)
173 173 if new_tunnel or u.scheme == 'https': # only use CONNECT for HTTPS
174 174 h.realhostport = ':'.join([u.host, (u.port or '443')])
175 175 h.headers = req.headers.copy()
176 176 h.headers.update(handler.parent.addheaders)
177 177 return
178 178
179 179 h.realhostport = None
180 180 h.headers = None
181 181
182 182 def _generic_proxytunnel(self):
183 183 proxyheaders = dict(
184 184 [(x, self.headers[x]) for x in self.headers
185 185 if x.lower().startswith('proxy-')])
186 186 self.send('CONNECT %s HTTP/1.0\r\n' % self.realhostport)
187 187 for header in proxyheaders.iteritems():
188 188 self.send('%s: %s\r\n' % header)
189 189 self.send('\r\n')
190 190
191 191 # majority of the following code is duplicated from
192 192 # httplib.HTTPConnection as there are no adequate places to
193 193 # override functions to provide the needed functionality
194 194 res = self.response_class(self.sock,
195 195 strict=self.strict,
196 196 method=self._method)
197 197
198 198 while True:
199 199 version, status, reason = res._read_status()
200 200 if status != httplib.CONTINUE:
201 201 break
202 202 # skip lines that are all whitespace
203 203 list(iter(lambda: res.fp.readline().strip(), ''))
204 204 res.status = status
205 205 res.reason = reason.strip()
206 206
207 207 if res.status == 200:
208 208 # skip lines until we find a blank line
209 209 list(iter(res.fp.readline, '\r\n'))
210 210 return True
211 211
212 212 if version == 'HTTP/1.0':
213 213 res.version = 10
214 214 elif version.startswith('HTTP/1.'):
215 215 res.version = 11
216 216 elif version == 'HTTP/0.9':
217 217 res.version = 9
218 218 else:
219 219 raise httplib.UnknownProtocol(version)
220 220
221 221 if res.version == 9:
222 222 res.length = None
223 223 res.chunked = 0
224 224 res.will_close = 1
225 225 res.msg = httplib.HTTPMessage(stringio())
226 226 return False
227 227
228 228 res.msg = httplib.HTTPMessage(res.fp)
229 229 res.msg.fp = None
230 230
231 231 # are we using the chunked-style of transfer encoding?
232 232 trenc = res.msg.getheader('transfer-encoding')
233 233 if trenc and trenc.lower() == "chunked":
234 234 res.chunked = 1
235 235 res.chunk_left = None
236 236 else:
237 237 res.chunked = 0
238 238
239 239 # will the connection close at the end of the response?
240 240 res.will_close = res._check_close()
241 241
242 242 # do we have a Content-Length?
243 243 # NOTE: RFC 2616, section 4.4, #3 says we ignore this if
244 244 # transfer-encoding is "chunked"
245 245 length = res.msg.getheader('content-length')
246 246 if length and not res.chunked:
247 247 try:
248 248 res.length = int(length)
249 249 except ValueError:
250 250 res.length = None
251 251 else:
252 252 if res.length < 0: # ignore nonsensical negative lengths
253 253 res.length = None
254 254 else:
255 255 res.length = None
256 256
257 257 # does the body have a fixed length? (of zero)
258 258 if (status == httplib.NO_CONTENT or status == httplib.NOT_MODIFIED or
259 259 100 <= status < 200 or # 1xx codes
260 260 res._method == 'HEAD'):
261 261 res.length = 0
262 262
263 263 # if the connection remains open, and we aren't using chunked, and
264 264 # a content-length was not provided, then assume that the connection
265 265 # WILL close.
266 266 if (not res.will_close and
267 267 not res.chunked and
268 268 res.length is None):
269 269 res.will_close = 1
270 270
271 271 self.proxyres = res
272 272
273 273 return False
274 274
275 275 class httphandler(keepalive.HTTPHandler):
276 276 def http_open(self, req):
277 277 return self.do_open(httpconnection, req)
278 278
279 279 def _start_transaction(self, h, req):
280 280 _generic_start_transaction(self, h, req)
281 281 return keepalive.HTTPHandler._start_transaction(self, h, req)
282 282
283 283 if has_https:
284 284 class httpsconnection(httplib.HTTPConnection):
285 285 response_class = keepalive.HTTPResponse
286 286 default_port = httplib.HTTPS_PORT
287 287 # must be able to send big bundle as stream.
288 288 send = _gen_sendfile(keepalive.safesend)
289 289 getresponse = keepalive.wrapgetresponse(httplib.HTTPConnection)
290 290
291 291 def __init__(self, host, port=None, key_file=None, cert_file=None,
292 292 *args, **kwargs):
293 293 httplib.HTTPConnection.__init__(self, host, port, *args, **kwargs)
294 294 self.key_file = key_file
295 295 self.cert_file = cert_file
296 296
297 297 def connect(self):
298 298 self.sock = socket.create_connection((self.host, self.port))
299 299
300 300 host = self.host
301 301 if self.realhostport: # use CONNECT proxy
302 302 _generic_proxytunnel(self)
303 303 host = self.realhostport.rsplit(':', 1)[0]
304 304 self.sock = sslutil.wrapsocket(
305 305 self.sock, self.key_file, self.cert_file, ui=self.ui,
306 306 serverhostname=host)
307 307 sslutil.validatesocket(self.sock)
308 308
309 309 class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler):
310 310 def __init__(self, ui):
311 311 keepalive.KeepAliveHandler.__init__(self)
312 312 urlreq.httpshandler.__init__(self)
313 313 self.ui = ui
314 314 self.pwmgr = passwordmgr(self.ui,
315 315 self.ui.httppasswordmgrdb)
316 316
317 317 def _start_transaction(self, h, req):
318 318 _generic_start_transaction(self, h, req)
319 319 return keepalive.KeepAliveHandler._start_transaction(self, h, req)
320 320
321 321 def https_open(self, req):
322 322 # req.get_full_url() does not contain credentials and we may
323 323 # need them to match the certificates.
324 324 url = req.get_full_url()
325 325 user, password = self.pwmgr.find_stored_password(url)
326 326 res = httpconnectionmod.readauthforuri(self.ui, url, user)
327 327 if res:
328 328 group, auth = res
329 329 self.auth = auth
330 330 self.ui.debug("using auth.%s.* for authentication\n" % group)
331 331 else:
332 332 self.auth = None
333 333 return self.do_open(self._makeconnection, req)
334 334
335 335 def _makeconnection(self, host, port=None, *args, **kwargs):
336 336 keyfile = None
337 337 certfile = None
338 338
339 339 if len(args) >= 1: # key_file
340 340 keyfile = args[0]
341 341 if len(args) >= 2: # cert_file
342 342 certfile = args[1]
343 343 args = args[2:]
344 344
345 345 # if the user has specified different key/cert files in
346 346 # hgrc, we prefer these
347 347 if self.auth and 'key' in self.auth and 'cert' in self.auth:
348 348 keyfile = self.auth['key']
349 349 certfile = self.auth['cert']
350 350
351 351 conn = httpsconnection(host, port, keyfile, certfile, *args,
352 352 **kwargs)
353 353 conn.ui = self.ui
354 354 return conn
355 355
356 356 class httpdigestauthhandler(urlreq.httpdigestauthhandler):
357 357 def __init__(self, *args, **kwargs):
358 358 urlreq.httpdigestauthhandler.__init__(self, *args, **kwargs)
359 359 self.retried_req = None
360 360
361 361 def reset_retry_count(self):
362 362 # Python 2.6.5 will call this on 401 or 407 errors and thus loop
363 363 # forever. We disable reset_retry_count completely and reset in
364 364 # http_error_auth_reqed instead.
365 365 pass
366 366
367 367 def http_error_auth_reqed(self, auth_header, host, req, headers):
368 368 # Reset the retry counter once for each request.
369 369 if req is not self.retried_req:
370 370 self.retried_req = req
371 371 self.retried = 0
372 372 return urlreq.httpdigestauthhandler.http_error_auth_reqed(
373 373 self, auth_header, host, req, headers)
374 374
375 375 class httpbasicauthhandler(urlreq.httpbasicauthhandler):
376 376 def __init__(self, *args, **kwargs):
377 377 self.auth = None
378 378 urlreq.httpbasicauthhandler.__init__(self, *args, **kwargs)
379 379 self.retried_req = None
380 380
381 381 def http_request(self, request):
382 382 if self.auth:
383 383 request.add_unredirected_header(self.auth_header, self.auth)
384 384
385 385 return request
386 386
387 387 def https_request(self, request):
388 388 if self.auth:
389 389 request.add_unredirected_header(self.auth_header, self.auth)
390 390
391 391 return request
392 392
393 393 def reset_retry_count(self):
394 394 # Python 2.6.5 will call this on 401 or 407 errors and thus loop
395 395 # forever. We disable reset_retry_count completely and reset in
396 396 # http_error_auth_reqed instead.
397 397 pass
398 398
399 399 def http_error_auth_reqed(self, auth_header, host, req, headers):
400 400 # Reset the retry counter once for each request.
401 401 if req is not self.retried_req:
402 402 self.retried_req = req
403 403 self.retried = 0
404 404 return urlreq.httpbasicauthhandler.http_error_auth_reqed(
405 405 self, auth_header, host, req, headers)
406 406
407 407 def retry_http_basic_auth(self, host, req, realm):
408 408 user, pw = self.passwd.find_user_password(realm, req.get_full_url())
409 409 if pw is not None:
410 410 raw = "%s:%s" % (user, pw)
411 411 auth = 'Basic %s' % base64.b64encode(raw).strip()
412 412 if req.get_header(self.auth_header, None) == auth:
413 413 return None
414 414 self.auth = auth
415 415 req.add_unredirected_header(self.auth_header, auth)
416 416 return self.parent.open(req)
417 417 else:
418 418 return None
419 419
420 class cookiehandler(urlreq.basehandler):
421 def __init__(self, ui):
422 self.cookiejar = None
423
424 cookiefile = ui.config('auth', 'cookiefile')
425 if not cookiefile:
426 return
427
428 cookiefile = util.expandpath(cookiefile)
429 try:
430 cookiejar = util.cookielib.MozillaCookieJar(cookiefile)
431 cookiejar.load()
432 self.cookiejar = cookiejar
433 except util.cookielib.LoadError as e:
434 ui.warn(_('(error loading cookie file %s: %s; continuing without '
435 'cookies)\n') % (cookiefile, str(e)))
436
437 def http_request(self, request):
438 if self.cookiejar:
439 self.cookiejar.add_cookie_header(request)
440
441 return request
442
443 def https_request(self, request):
444 if self.cookiejar:
445 self.cookiejar.add_cookie_header(request)
446
447 return request
448
420 449 handlerfuncs = []
421 450
422 451 def opener(ui, authinfo=None):
423 452 '''
424 453 construct an opener suitable for urllib2
425 454 authinfo will be added to the password manager
426 455 '''
427 456 # experimental config: ui.usehttp2
428 457 if ui.configbool('ui', 'usehttp2', False):
429 458 handlers = [
430 459 httpconnectionmod.http2handler(
431 460 ui,
432 461 passwordmgr(ui, ui.httppasswordmgrdb))
433 462 ]
434 463 else:
435 464 handlers = [httphandler()]
436 465 if has_https:
437 466 handlers.append(httpshandler(ui))
438 467
439 468 handlers.append(proxyhandler(ui))
440 469
441 470 passmgr = passwordmgr(ui, ui.httppasswordmgrdb)
442 471 if authinfo is not None:
443 472 realm, uris, user, passwd = authinfo
444 473 saveduser, savedpass = passmgr.find_stored_password(uris[0])
445 474 if user != saveduser or passwd:
446 475 passmgr.add_password(realm, uris, user, passwd)
447 476 ui.debug('http auth: user %s, password %s\n' %
448 477 (user, passwd and '*' * len(passwd) or 'not set'))
449 478
450 479 handlers.extend((httpbasicauthhandler(passmgr),
451 480 httpdigestauthhandler(passmgr)))
452 481 handlers.extend([h(ui, passmgr) for h in handlerfuncs])
482 handlers.append(cookiehandler(ui))
453 483 opener = urlreq.buildopener(*handlers)
454 484
455 485 # The user agent should should *NOT* be used by servers for e.g.
456 486 # protocol detection or feature negotiation: there are other
457 487 # facilities for that.
458 488 #
459 489 # "mercurial/proto-1.0" was the original user agent string and
460 490 # exists for backwards compatibility reasons.
461 491 #
462 492 # The "(Mercurial %s)" string contains the distribution
463 493 # name and version. Other client implementations should choose their
464 494 # own distribution name. Since servers should not be using the user
465 495 # agent string for anything, clients should be able to define whatever
466 496 # user agent they deem appropriate.
467 497 agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version()
468 498 opener.addheaders = [('User-agent', agent)]
469 499
470 500 # This header should only be needed by wire protocol requests. But it has
471 501 # been sent on all requests since forever. We keep sending it for backwards
472 502 # compatibility reasons. Modern versions of the wire protocol use
473 503 # X-HgProto-<N> for advertising client support.
474 504 opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
475 505 return opener
476 506
477 507 def open(ui, url_, data=None):
478 508 u = util.url(url_)
479 509 if u.scheme:
480 510 u.scheme = u.scheme.lower()
481 511 url_, authinfo = u.authinfo()
482 512 else:
483 513 path = util.normpath(os.path.abspath(url_))
484 514 url_ = 'file://' + urlreq.pathname2url(path)
485 515 authinfo = None
486 516 return opener(ui, authinfo).open(url_, data)
@@ -1,335 +1,396 b''
1 #require serve
1 #require killdaemons serve
2 2
3 3 $ hg init test
4 4 $ cd test
5 5 $ echo foo>foo
6 6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 7 $ echo foo>foo.d/foo
8 8 $ echo bar>foo.d/bAr.hg.d/BaR
9 9 $ echo bar>foo.d/baR.d.hg/bAR
10 10 $ hg commit -A -m 1
11 11 adding foo
12 12 adding foo.d/bAr.hg.d/BaR
13 13 adding foo.d/baR.d.hg/bAR
14 14 adding foo.d/foo
15 15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
16 16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
17 17
18 18 Test server address cannot be reused
19 19
20 20 #if windows
21 21 $ hg serve -p $HGPORT1 2>&1
22 22 abort: cannot start server at 'localhost:$HGPORT1': * (glob)
23 23 [255]
24 24 #else
25 25 $ hg serve -p $HGPORT1 2>&1
26 26 abort: cannot start server at 'localhost:$HGPORT1': Address already in use
27 27 [255]
28 28 #endif
29 29 $ cd ..
30 30 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
31 31
32 32 clone via stream
33 33
34 34 $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
35 35 streaming all changes
36 36 6 files to transfer, 606 bytes of data
37 37 transferred * bytes in * seconds (*/sec) (glob)
38 38 searching for changes
39 39 no changes found
40 40 updating to branch default
41 41 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 42 $ hg verify -R copy
43 43 checking changesets
44 44 checking manifests
45 45 crosschecking files in changesets and manifests
46 46 checking files
47 47 4 files, 1 changesets, 4 total revisions
48 48
49 49 try to clone via stream, should use pull instead
50 50
51 51 $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
52 52 requesting all changes
53 53 adding changesets
54 54 adding manifests
55 55 adding file changes
56 56 added 1 changesets with 4 changes to 4 files
57 57 updating to branch default
58 58 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 59
60 60 clone via pull
61 61
62 62 $ hg clone http://localhost:$HGPORT1/ copy-pull
63 63 requesting all changes
64 64 adding changesets
65 65 adding manifests
66 66 adding file changes
67 67 added 1 changesets with 4 changes to 4 files
68 68 updating to branch default
69 69 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 70 $ hg verify -R copy-pull
71 71 checking changesets
72 72 checking manifests
73 73 crosschecking files in changesets and manifests
74 74 checking files
75 75 4 files, 1 changesets, 4 total revisions
76 76 $ cd test
77 77 $ echo bar > bar
78 78 $ hg commit -A -d '1 0' -m 2
79 79 adding bar
80 80 $ cd ..
81 81
82 82 clone over http with --update
83 83
84 84 $ hg clone http://localhost:$HGPORT1/ updated --update 0
85 85 requesting all changes
86 86 adding changesets
87 87 adding manifests
88 88 adding file changes
89 89 added 2 changesets with 5 changes to 5 files
90 90 updating to branch default
91 91 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 92 $ hg log -r . -R updated
93 93 changeset: 0:8b6053c928fe
94 94 user: test
95 95 date: Thu Jan 01 00:00:00 1970 +0000
96 96 summary: 1
97 97
98 98 $ rm -rf updated
99 99
100 100 incoming via HTTP
101 101
102 102 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
103 103 adding changesets
104 104 adding manifests
105 105 adding file changes
106 106 added 1 changesets with 4 changes to 4 files
107 107 updating to branch default
108 108 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 109 $ cd partial
110 110 $ touch LOCAL
111 111 $ hg ci -qAm LOCAL
112 112 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
113 113 comparing with http://localhost:$HGPORT1/
114 114 searching for changes
115 115 2
116 116 $ cd ..
117 117
118 118 pull
119 119
120 120 $ cd copy-pull
121 121 $ cat >> .hg/hgrc <<EOF
122 122 > [hooks]
123 123 > changegroup = sh -c "printenv.py changegroup"
124 124 > EOF
125 125 $ hg pull
126 126 pulling from http://localhost:$HGPORT1/
127 127 searching for changes
128 128 adding changesets
129 129 adding manifests
130 130 adding file changes
131 131 added 1 changesets with 1 changes to 1 files
132 132 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
133 133 (run 'hg update' to get a working copy)
134 134 $ cd ..
135 135
136 136 clone from invalid URL
137 137
138 138 $ hg clone http://localhost:$HGPORT/bad
139 139 abort: HTTP Error 404: Not Found
140 140 [255]
141 141
142 142 test http authentication
143 143 + use the same server to test server side streaming preference
144 144
145 145 $ cd test
146 146 $ cat << EOT > userpass.py
147 147 > import base64
148 148 > from mercurial.hgweb import common
149 149 > def perform_authentication(hgweb, req, op):
150 150 > auth = req.env.get('HTTP_AUTHORIZATION')
151 151 > if not auth:
152 152 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
153 153 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
154 154 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
155 155 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
156 156 > def extsetup():
157 157 > common.permhooks.insert(0, perform_authentication)
158 158 > EOT
159 159 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
160 160 > --config server.preferuncompressed=True \
161 161 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
162 162 $ cat pid >> $DAEMON_PIDS
163 163
164 164 $ cat << EOF > get_pass.py
165 165 > import getpass
166 166 > def newgetpass(arg):
167 167 > return "pass"
168 168 > getpass.getpass = newgetpass
169 169 > EOF
170 170
171 171 $ hg id http://localhost:$HGPORT2/
172 172 abort: http authorization required for http://localhost:$HGPORT2/
173 173 [255]
174 174 $ hg id http://localhost:$HGPORT2/
175 175 abort: http authorization required for http://localhost:$HGPORT2/
176 176 [255]
177 177 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
178 178 http authorization required for http://localhost:$HGPORT2/
179 179 realm: mercurial
180 180 user: user
181 181 password: 5fed3813f7f5
182 182 $ hg id http://user:pass@localhost:$HGPORT2/
183 183 5fed3813f7f5
184 184 $ echo '[auth]' >> .hg/hgrc
185 185 $ echo 'l.schemes=http' >> .hg/hgrc
186 186 $ echo 'l.prefix=lo' >> .hg/hgrc
187 187 $ echo 'l.username=user' >> .hg/hgrc
188 188 $ echo 'l.password=pass' >> .hg/hgrc
189 189 $ hg id http://localhost:$HGPORT2/
190 190 5fed3813f7f5
191 191 $ hg id http://localhost:$HGPORT2/
192 192 5fed3813f7f5
193 193 $ hg id http://user@localhost:$HGPORT2/
194 194 5fed3813f7f5
195 195 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
196 196 streaming all changes
197 197 7 files to transfer, 916 bytes of data
198 198 transferred * bytes in * seconds (*/sec) (glob)
199 199 searching for changes
200 200 no changes found
201 201 updating to branch default
202 202 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 203 --pull should override server's preferuncompressed
204 204 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
205 205 requesting all changes
206 206 adding changesets
207 207 adding manifests
208 208 adding file changes
209 209 added 2 changesets with 5 changes to 5 files
210 210 updating to branch default
211 211 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 212
213 213 $ hg id http://user2@localhost:$HGPORT2/
214 214 abort: http authorization required for http://localhost:$HGPORT2/
215 215 [255]
216 216 $ hg id http://user:pass2@localhost:$HGPORT2/
217 217 abort: HTTP Error 403: no
218 218 [255]
219 219
220 220 $ hg -R dest tag -r tip top
221 221 $ hg -R dest push http://user:pass@localhost:$HGPORT2/
222 222 pushing to http://user:***@localhost:$HGPORT2/
223 223 searching for changes
224 224 remote: adding changesets
225 225 remote: adding manifests
226 226 remote: adding file changes
227 227 remote: added 1 changesets with 1 changes to 1 files
228 228 $ hg rollback -q
229 229
230 230 $ sed 's/.*] "/"/' < ../access.log
231 231 "GET /?cmd=capabilities HTTP/1.1" 200 -
232 232 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
233 233 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
234 234 "GET /?cmd=capabilities HTTP/1.1" 200 -
235 235 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
236 236 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
237 237 "GET /?cmd=capabilities HTTP/1.1" 200 -
238 238 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
239 239 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
240 240 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
241 241 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
242 242 "GET /?cmd=capabilities HTTP/1.1" 200 -
243 243 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
244 244 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
245 245 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
246 246 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
247 247 "GET /?cmd=capabilities HTTP/1.1" 200 -
248 248 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
249 249 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
250 250 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
251 251 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
252 252 "GET /?cmd=capabilities HTTP/1.1" 200 -
253 253 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
254 254 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
255 255 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
256 256 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
257 257 "GET /?cmd=capabilities HTTP/1.1" 200 -
258 258 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
259 259 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
260 260 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
261 261 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
262 262 "GET /?cmd=capabilities HTTP/1.1" 200 -
263 263 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
264 264 "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
265 265 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
266 266 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
267 267 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
268 268 "GET /?cmd=capabilities HTTP/1.1" 200 -
269 269 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
270 270 "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
271 271 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
272 272 "GET /?cmd=capabilities HTTP/1.1" 200 -
273 273 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
274 274 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
275 275 "GET /?cmd=capabilities HTTP/1.1" 200 -
276 276 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
277 277 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
278 278 "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
279 279 "GET /?cmd=capabilities HTTP/1.1" 200 -
280 280 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
281 281 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
282 282 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
283 283 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
284 284 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
285 285 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
286 286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
287 287 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
288 288 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
289 289
290 290 $ cd ..
291 291
292 292 clone of serve with repo in root and unserved subrepo (issue2970)
293 293
294 294 $ hg --cwd test init sub
295 295 $ echo empty > test/sub/empty
296 296 $ hg --cwd test/sub add empty
297 297 $ hg --cwd test/sub commit -qm 'add empty'
298 298 $ hg --cwd test/sub tag -r 0 something
299 299 $ echo sub = sub > test/.hgsub
300 300 $ hg --cwd test add .hgsub
301 301 $ hg --cwd test commit -qm 'add subrepo'
302 302 $ hg clone http://localhost:$HGPORT noslash-clone
303 303 requesting all changes
304 304 adding changesets
305 305 adding manifests
306 306 adding file changes
307 307 added 3 changesets with 7 changes to 7 files
308 308 updating to branch default
309 309 abort: HTTP Error 404: Not Found
310 310 [255]
311 311 $ hg clone http://localhost:$HGPORT/ slash-clone
312 312 requesting all changes
313 313 adding changesets
314 314 adding manifests
315 315 adding file changes
316 316 added 3 changesets with 7 changes to 7 files
317 317 updating to branch default
318 318 abort: HTTP Error 404: Not Found
319 319 [255]
320 320
321 321 check error log
322 322
323 323 $ cat error.log
324 324
325 325 check abort error reporting while pulling/cloning
326 326
327 327 $ $RUNTESTDIR/killdaemons.py
328 328 $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
329 329 $ cat hg3.pid >> $DAEMON_PIDS
330 330 $ hg clone http://localhost:$HGPORT/ abort-clone
331 331 requesting all changes
332 332 remote: abort: this is an exercise
333 333 abort: pull failed on remote
334 334 [255]
335 335 $ cat error.log
336
337 corrupt cookies file should yield a warning
338
339 $ cat > $TESTTMP/cookies.txt << EOF
340 > bad format
341 > EOF
342
343 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
344 (error loading cookie file $TESTTMP/cookies.txt: '$TESTTMP/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies)
345 56f9bc90cce6
346
347 $ killdaemons.py
348
349 Create dummy authentication handler that looks for cookies. It doesn't do anything
350 useful. It just raises an HTTP 500 with details about the Cookie request header.
351 We raise HTTP 500 because its message is printed in the abort message.
352
353 $ cat > cookieauth.py << EOF
354 > from mercurial import util
355 > from mercurial.hgweb import common
356 > def perform_authentication(hgweb, req, op):
357 > cookie = req.env.get('HTTP_COOKIE')
358 > if not cookie:
359 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie')
360 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie)
361 > def extsetup():
362 > common.permhooks.insert(0, perform_authentication)
363 > EOF
364
365 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
366 $ cat pid > $DAEMON_PIDS
367
368 Request without cookie sent should fail due to lack of cookie
369
370 $ hg id http://localhost:$HGPORT
371 abort: HTTP Error 500: no-cookie
372 [255]
373
374 Populate a cookies file
375
376 $ cat > cookies.txt << EOF
377 > # HTTP Cookie File
378 > # Expiration is 2030-01-01 at midnight
379 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
380 > EOF
381
382 Should not send a cookie for another domain
383
384 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
385 abort: HTTP Error 500: no-cookie
386 [255]
387
388 Add a cookie entry for our test server and verify it is sent
389
390 $ cat >> cookies.txt << EOF
391 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
392 > EOF
393
394 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
395 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
396 [255]
General Comments 0
You need to be logged in to leave comments. Login now