##// END OF EJS Templates
hgweb: make refresh interval configurable...
Gregory Szorc -
r26072:06320fb1 default
parent child Browse files
Show More
@@ -1,1817 +1,1825
1 1 The Mercurial system uses a set of configuration files to control
2 2 aspects of its behavior.
3 3
4 4 The configuration files use a simple ini-file format. A configuration
5 5 file consists of sections, led by a ``[section]`` header and followed
6 6 by ``name = value`` entries::
7 7
8 8 [ui]
9 9 username = Firstname Lastname <firstname.lastname@example.net>
10 10 verbose = True
11 11
12 12 The above entries will be referred to as ``ui.username`` and
13 13 ``ui.verbose``, respectively. See the Syntax section below.
14 14
15 15 Files
16 16 =====
17 17
18 18 Mercurial reads configuration data from several files, if they exist.
19 19 These files do not exist by default and you will have to create the
20 20 appropriate configuration files yourself: global configuration like
21 21 the username setting is typically put into
22 22 ``%USERPROFILE%\mercurial.ini`` or ``$HOME/.hgrc`` and local
23 23 configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
24 24
25 25 The names of these files depend on the system on which Mercurial is
26 26 installed. ``*.rc`` files from a single directory are read in
27 27 alphabetical order, later ones overriding earlier ones. Where multiple
28 28 paths are given below, settings from earlier paths override later
29 29 ones.
30 30
31 31 .. container:: verbose.unix
32 32
33 33 On Unix, the following files are consulted:
34 34
35 35 - ``<repo>/.hg/hgrc`` (per-repository)
36 36 - ``$HOME/.hgrc`` (per-user)
37 37 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
38 38 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
39 39 - ``/etc/mercurial/hgrc`` (per-system)
40 40 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
41 41 - ``<internal>/default.d/*.rc`` (defaults)
42 42
43 43 .. container:: verbose.windows
44 44
45 45 On Windows, the following files are consulted:
46 46
47 47 - ``<repo>/.hg/hgrc`` (per-repository)
48 48 - ``%USERPROFILE%\.hgrc`` (per-user)
49 49 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
50 50 - ``%HOME%\.hgrc`` (per-user)
51 51 - ``%HOME%\Mercurial.ini`` (per-user)
52 52 - ``<install-dir>\Mercurial.ini`` (per-installation)
53 53 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
54 54 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
55 55 - ``<internal>/default.d/*.rc`` (defaults)
56 56
57 57 .. note::
58 58
59 59 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
60 60 is used when running 32-bit Python on 64-bit Windows.
61 61
62 62 .. container:: verbose.plan9
63 63
64 64 On Plan9, the following files are consulted:
65 65
66 66 - ``<repo>/.hg/hgrc`` (per-repository)
67 67 - ``$home/lib/hgrc`` (per-user)
68 68 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
69 69 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
70 70 - ``/lib/mercurial/hgrc`` (per-system)
71 71 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
72 72 - ``<internal>/default.d/*.rc`` (defaults)
73 73
74 74 Per-repository configuration options only apply in a
75 75 particular repository. This file is not version-controlled, and
76 76 will not get transferred during a "clone" operation. Options in
77 77 this file override options in all other configuration files. On
78 78 Plan 9 and Unix, most of this file will be ignored if it doesn't
79 79 belong to a trusted user or to a trusted group. See the documentation
80 80 for the ``[trusted]`` section below for more details.
81 81
82 82 Per-user configuration file(s) are for the user running Mercurial. On
83 83 Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
84 84 files apply to all Mercurial commands executed by this user in any
85 85 directory. Options in these files override per-system and per-installation
86 86 options.
87 87
88 88 Per-installation configuration files are searched for in the
89 89 directory where Mercurial is installed. ``<install-root>`` is the
90 90 parent directory of the **hg** executable (or symlink) being run. For
91 91 example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
92 92 in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
93 93 to all Mercurial commands executed by any user in any directory.
94 94
95 95 Per-installation configuration files are for the system on
96 96 which Mercurial is running. Options in these files apply to all
97 97 Mercurial commands executed by any user in any directory. Registry
98 98 keys contain PATH-like strings, every part of which must reference
99 99 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
100 100 be read. Mercurial checks each of these locations in the specified
101 101 order until one or more configuration files are detected.
102 102
103 103 Per-system configuration files are for the system on which Mercurial
104 104 is running. Options in these files apply to all Mercurial commands
105 105 executed by any user in any directory. Options in these files
106 106 override per-installation options.
107 107
108 108 Mercurial comes with some default configuration. The default configuration
109 109 files are installed with Mercurial and will be overwritten on upgrades. Default
110 110 configuration files should never be edited by users or administrators but can
111 111 be overridden in other configuration files. So far the directory only contains
112 112 merge tool configuration but packagers can also put other default configuration
113 113 there.
114 114
115 115 Syntax
116 116 ======
117 117
118 118 A configuration file consists of sections, led by a ``[section]`` header
119 119 and followed by ``name = value`` entries (sometimes called
120 120 ``configuration keys``)::
121 121
122 122 [spam]
123 123 eggs=ham
124 124 green=
125 125 eggs
126 126
127 127 Each line contains one entry. If the lines that follow are indented,
128 128 they are treated as continuations of that entry. Leading whitespace is
129 129 removed from values. Empty lines are skipped. Lines beginning with
130 130 ``#`` or ``;`` are ignored and may be used to provide comments.
131 131
132 132 Configuration keys can be set multiple times, in which case Mercurial
133 133 will use the value that was configured last. As an example::
134 134
135 135 [spam]
136 136 eggs=large
137 137 ham=serrano
138 138 eggs=small
139 139
140 140 This would set the configuration key named ``eggs`` to ``small``.
141 141
142 142 It is also possible to define a section multiple times. A section can
143 143 be redefined on the same and/or on different configuration files. For
144 144 example::
145 145
146 146 [foo]
147 147 eggs=large
148 148 ham=serrano
149 149 eggs=small
150 150
151 151 [bar]
152 152 eggs=ham
153 153 green=
154 154 eggs
155 155
156 156 [foo]
157 157 ham=prosciutto
158 158 eggs=medium
159 159 bread=toasted
160 160
161 161 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
162 162 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
163 163 respectively. As you can see there only thing that matters is the last
164 164 value that was set for each of the configuration keys.
165 165
166 166 If a configuration key is set multiple times in different
167 167 configuration files the final value will depend on the order in which
168 168 the different configuration files are read, with settings from earlier
169 169 paths overriding later ones as described on the ``Files`` section
170 170 above.
171 171
172 172 A line of the form ``%include file`` will include ``file`` into the
173 173 current configuration file. The inclusion is recursive, which means
174 174 that included files can include other files. Filenames are relative to
175 175 the configuration file in which the ``%include`` directive is found.
176 176 Environment variables and ``~user`` constructs are expanded in
177 177 ``file``. This lets you do something like::
178 178
179 179 %include ~/.hgrc.d/$HOST.rc
180 180
181 181 to include a different configuration file on each computer you use.
182 182
183 183 A line with ``%unset name`` will remove ``name`` from the current
184 184 section, if it has been set previously.
185 185
186 186 The values are either free-form text strings, lists of text strings,
187 187 or Boolean values. Boolean values can be set to true using any of "1",
188 188 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
189 189 (all case insensitive).
190 190
191 191 List values are separated by whitespace or comma, except when values are
192 192 placed in double quotation marks::
193 193
194 194 allow_read = "John Doe, PhD", brian, betty
195 195
196 196 Quotation marks can be escaped by prefixing them with a backslash. Only
197 197 quotation marks at the beginning of a word is counted as a quotation
198 198 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
199 199
200 200 Sections
201 201 ========
202 202
203 203 This section describes the different sections that may appear in a
204 204 Mercurial configuration file, the purpose of each section, its possible
205 205 keys, and their possible values.
206 206
207 207 ``alias``
208 208 ---------
209 209
210 210 Defines command aliases.
211 211 Aliases allow you to define your own commands in terms of other
212 212 commands (or aliases), optionally including arguments. Positional
213 213 arguments in the form of ``$1``, ``$2``, etc in the alias definition
214 214 are expanded by Mercurial before execution. Positional arguments not
215 215 already used by ``$N`` in the definition are put at the end of the
216 216 command to be executed.
217 217
218 218 Alias definitions consist of lines of the form::
219 219
220 220 <alias> = <command> [<argument>]...
221 221
222 222 For example, this definition::
223 223
224 224 latest = log --limit 5
225 225
226 226 creates a new command ``latest`` that shows only the five most recent
227 227 changesets. You can define subsequent aliases using earlier ones::
228 228
229 229 stable5 = latest -b stable
230 230
231 231 .. note::
232 232
233 233 It is possible to create aliases with the same names as
234 234 existing commands, which will then override the original
235 235 definitions. This is almost always a bad idea!
236 236
237 237 An alias can start with an exclamation point (``!``) to make it a
238 238 shell alias. A shell alias is executed with the shell and will let you
239 239 run arbitrary commands. As an example, ::
240 240
241 241 echo = !echo $@
242 242
243 243 will let you do ``hg echo foo`` to have ``foo`` printed in your
244 244 terminal. A better example might be::
245 245
246 246 purge = !$HG status --no-status --unknown -0 | xargs -0 rm
247 247
248 248 which will make ``hg purge`` delete all unknown files in the
249 249 repository in the same manner as the purge extension.
250 250
251 251 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
252 252 expand to the command arguments. Unmatched arguments are
253 253 removed. ``$0`` expands to the alias name and ``$@`` expands to all
254 254 arguments separated by a space. ``"$@"`` (with quotes) expands to all
255 255 arguments quoted individually and separated by a space. These expansions
256 256 happen before the command is passed to the shell.
257 257
258 258 Shell aliases are executed in an environment where ``$HG`` expands to
259 259 the path of the Mercurial that was used to execute the alias. This is
260 260 useful when you want to call further Mercurial commands in a shell
261 261 alias, as was done above for the purge alias. In addition,
262 262 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
263 263 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
264 264
265 265 .. note::
266 266
267 267 Some global configuration options such as ``-R`` are
268 268 processed before shell aliases and will thus not be passed to
269 269 aliases.
270 270
271 271
272 272 ``annotate``
273 273 ------------
274 274
275 275 Settings used when displaying file annotations. All values are
276 276 Booleans and default to False. See ``diff`` section for related
277 277 options for the diff command.
278 278
279 279 ``ignorews``
280 280 Ignore white space when comparing lines.
281 281
282 282 ``ignorewsamount``
283 283 Ignore changes in the amount of white space.
284 284
285 285 ``ignoreblanklines``
286 286 Ignore changes whose lines are all blank.
287 287
288 288
289 289 ``auth``
290 290 --------
291 291
292 292 Authentication credentials for HTTP authentication. This section
293 293 allows you to store usernames and passwords for use when logging
294 294 *into* HTTP servers. See the ``[web]`` configuration section if
295 295 you want to configure *who* can login to your HTTP server.
296 296
297 297 Each line has the following format::
298 298
299 299 <name>.<argument> = <value>
300 300
301 301 where ``<name>`` is used to group arguments into authentication
302 302 entries. Example::
303 303
304 304 foo.prefix = hg.intevation.org/mercurial
305 305 foo.username = foo
306 306 foo.password = bar
307 307 foo.schemes = http https
308 308
309 309 bar.prefix = secure.example.org
310 310 bar.key = path/to/file.key
311 311 bar.cert = path/to/file.cert
312 312 bar.schemes = https
313 313
314 314 Supported arguments:
315 315
316 316 ``prefix``
317 317 Either ``*`` or a URI prefix with or without the scheme part.
318 318 The authentication entry with the longest matching prefix is used
319 319 (where ``*`` matches everything and counts as a match of length
320 320 1). If the prefix doesn't include a scheme, the match is performed
321 321 against the URI with its scheme stripped as well, and the schemes
322 322 argument, q.v., is then subsequently consulted.
323 323
324 324 ``username``
325 325 Optional. Username to authenticate with. If not given, and the
326 326 remote site requires basic or digest authentication, the user will
327 327 be prompted for it. Environment variables are expanded in the
328 328 username letting you do ``foo.username = $USER``. If the URI
329 329 includes a username, only ``[auth]`` entries with a matching
330 330 username or without a username will be considered.
331 331
332 332 ``password``
333 333 Optional. Password to authenticate with. If not given, and the
334 334 remote site requires basic or digest authentication, the user
335 335 will be prompted for it.
336 336
337 337 ``key``
338 338 Optional. PEM encoded client certificate key file. Environment
339 339 variables are expanded in the filename.
340 340
341 341 ``cert``
342 342 Optional. PEM encoded client certificate chain file. Environment
343 343 variables are expanded in the filename.
344 344
345 345 ``schemes``
346 346 Optional. Space separated list of URI schemes to use this
347 347 authentication entry with. Only used if the prefix doesn't include
348 348 a scheme. Supported schemes are http and https. They will match
349 349 static-http and static-https respectively, as well.
350 350 Default: https.
351 351
352 352 If no suitable authentication entry is found, the user is prompted
353 353 for credentials as usual if required by the remote.
354 354
355 355
356 356 ``committemplate``
357 357 ------------------
358 358
359 359 ``changeset`` configuration in this section is used as the template to
360 360 customize the text shown in the editor when committing.
361 361
362 362 In addition to pre-defined template keywords, commit log specific one
363 363 below can be used for customization:
364 364
365 365 ``extramsg``
366 366 String: Extra message (typically 'Leave message empty to abort
367 367 commit.'). This may be changed by some commands or extensions.
368 368
369 369 For example, the template configuration below shows as same text as
370 370 one shown by default::
371 371
372 372 [committemplate]
373 373 changeset = {desc}\n\n
374 374 HG: Enter commit message. Lines beginning with 'HG:' are removed.
375 375 HG: {extramsg}
376 376 HG: --
377 377 HG: user: {author}\n{ifeq(p2rev, "-1", "",
378 378 "HG: branch merge\n")
379 379 }HG: branch '{branch}'\n{if(activebookmark,
380 380 "HG: bookmark '{activebookmark}'\n") }{subrepos %
381 381 "HG: subrepo {subrepo}\n" }{file_adds %
382 382 "HG: added {file}\n" }{file_mods %
383 383 "HG: changed {file}\n" }{file_dels %
384 384 "HG: removed {file}\n" }{if(files, "",
385 385 "HG: no files changed\n")}
386 386
387 387 .. note::
388 388
389 389 For some problematic encodings (see :hg:`help win32mbcs` for
390 390 detail), this customization should be configured carefully, to
391 391 avoid showing broken characters.
392 392
393 393 For example, if multibyte character ending with backslash (0x5c) is
394 394 followed by ASCII character 'n' in the customized template,
395 395 sequence of backslash and 'n' is treated as line-feed unexpectedly
396 396 (and multibyte character is broken, too).
397 397
398 398 Customized template is used for commands below (``--edit`` may be
399 399 required):
400 400
401 401 - :hg:`backout`
402 402 - :hg:`commit`
403 403 - :hg:`fetch` (for merge commit only)
404 404 - :hg:`graft`
405 405 - :hg:`histedit`
406 406 - :hg:`import`
407 407 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
408 408 - :hg:`rebase`
409 409 - :hg:`shelve`
410 410 - :hg:`sign`
411 411 - :hg:`tag`
412 412 - :hg:`transplant`
413 413
414 414 Configuring items below instead of ``changeset`` allows showing
415 415 customized message only for specific actions, or showing different
416 416 messages for each action.
417 417
418 418 - ``changeset.backout`` for :hg:`backout`
419 419 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
420 420 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
421 421 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
422 422 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
423 423 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
424 424 - ``changeset.gpg.sign`` for :hg:`sign`
425 425 - ``changeset.graft`` for :hg:`graft`
426 426 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
427 427 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
428 428 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
429 429 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
430 430 - ``changeset.import.bypass`` for :hg:`import --bypass`
431 431 - ``changeset.import.normal.merge`` for :hg:`import` on merges
432 432 - ``changeset.import.normal.normal`` for :hg:`import` on other
433 433 - ``changeset.mq.qnew`` for :hg:`qnew`
434 434 - ``changeset.mq.qfold`` for :hg:`qfold`
435 435 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
436 436 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
437 437 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
438 438 - ``changeset.rebase.normal`` for :hg:`rebase` on other
439 439 - ``changeset.shelve.shelve`` for :hg:`shelve`
440 440 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
441 441 - ``changeset.tag.remove`` for :hg:`tag --remove`
442 442 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
443 443 - ``changeset.transplant.normal`` for :hg:`transplant` on other
444 444
445 445 These dot-separated lists of names are treated as hierarchical ones.
446 446 For example, ``changeset.tag.remove`` customizes the commit message
447 447 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
448 448 commit message for :hg:`tag` regardless of ``--remove`` option.
449 449
450 450 At the external editor invocation for committing, corresponding
451 451 dot-separated list of names without ``changeset.`` prefix
452 452 (e.g. ``commit.normal.normal``) is in ``HGEDITFORM`` environment variable.
453 453
454 454 In this section, items other than ``changeset`` can be referred from
455 455 others. For example, the configuration to list committed files up
456 456 below can be referred as ``{listupfiles}``::
457 457
458 458 [committemplate]
459 459 listupfiles = {file_adds %
460 460 "HG: added {file}\n" }{file_mods %
461 461 "HG: changed {file}\n" }{file_dels %
462 462 "HG: removed {file}\n" }{if(files, "",
463 463 "HG: no files changed\n")}
464 464
465 465 ``decode/encode``
466 466 -----------------
467 467
468 468 Filters for transforming files on checkout/checkin. This would
469 469 typically be used for newline processing or other
470 470 localization/canonicalization of files.
471 471
472 472 Filters consist of a filter pattern followed by a filter command.
473 473 Filter patterns are globs by default, rooted at the repository root.
474 474 For example, to match any file ending in ``.txt`` in the root
475 475 directory only, use the pattern ``*.txt``. To match any file ending
476 476 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
477 477 For each file only the first matching filter applies.
478 478
479 479 The filter command can start with a specifier, either ``pipe:`` or
480 480 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
481 481
482 482 A ``pipe:`` command must accept data on stdin and return the transformed
483 483 data on stdout.
484 484
485 485 Pipe example::
486 486
487 487 [encode]
488 488 # uncompress gzip files on checkin to improve delta compression
489 489 # note: not necessarily a good idea, just an example
490 490 *.gz = pipe: gunzip
491 491
492 492 [decode]
493 493 # recompress gzip files when writing them to the working dir (we
494 494 # can safely omit "pipe:", because it's the default)
495 495 *.gz = gzip
496 496
497 497 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
498 498 with the name of a temporary file that contains the data to be
499 499 filtered by the command. The string ``OUTFILE`` is replaced with the name
500 500 of an empty temporary file, where the filtered data must be written by
501 501 the command.
502 502
503 503 .. note::
504 504
505 505 The tempfile mechanism is recommended for Windows systems,
506 506 where the standard shell I/O redirection operators often have
507 507 strange effects and may corrupt the contents of your files.
508 508
509 509 This filter mechanism is used internally by the ``eol`` extension to
510 510 translate line ending characters between Windows (CRLF) and Unix (LF)
511 511 format. We suggest you use the ``eol`` extension for convenience.
512 512
513 513
514 514 ``defaults``
515 515 ------------
516 516
517 517 (defaults are deprecated. Don't use them. Use aliases instead)
518 518
519 519 Use the ``[defaults]`` section to define command defaults, i.e. the
520 520 default options/arguments to pass to the specified commands.
521 521
522 522 The following example makes :hg:`log` run in verbose mode, and
523 523 :hg:`status` show only the modified files, by default::
524 524
525 525 [defaults]
526 526 log = -v
527 527 status = -m
528 528
529 529 The actual commands, instead of their aliases, must be used when
530 530 defining command defaults. The command defaults will also be applied
531 531 to the aliases of the commands defined.
532 532
533 533
534 534 ``diff``
535 535 --------
536 536
537 537 Settings used when displaying diffs. Everything except for ``unified``
538 538 is a Boolean and defaults to False. See ``annotate`` section for
539 539 related options for the annotate command.
540 540
541 541 ``git``
542 542 Use git extended diff format.
543 543
544 544 ``nobinary``
545 545 Omit git binary patches.
546 546
547 547 ``nodates``
548 548 Don't include dates in diff headers.
549 549
550 550 ``noprefix``
551 551 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
552 552
553 553 ``showfunc``
554 554 Show which function each change is in.
555 555
556 556 ``ignorews``
557 557 Ignore white space when comparing lines.
558 558
559 559 ``ignorewsamount``
560 560 Ignore changes in the amount of white space.
561 561
562 562 ``ignoreblanklines``
563 563 Ignore changes whose lines are all blank.
564 564
565 565 ``unified``
566 566 Number of lines of context to show.
567 567
568 568 ``email``
569 569 ---------
570 570
571 571 Settings for extensions that send email messages.
572 572
573 573 ``from``
574 574 Optional. Email address to use in "From" header and SMTP envelope
575 575 of outgoing messages.
576 576
577 577 ``to``
578 578 Optional. Comma-separated list of recipients' email addresses.
579 579
580 580 ``cc``
581 581 Optional. Comma-separated list of carbon copy recipients'
582 582 email addresses.
583 583
584 584 ``bcc``
585 585 Optional. Comma-separated list of blind carbon copy recipients'
586 586 email addresses.
587 587
588 588 ``method``
589 589 Optional. Method to use to send email messages. If value is ``smtp``
590 590 (default), use SMTP (see the ``[smtp]`` section for configuration).
591 591 Otherwise, use as name of program to run that acts like sendmail
592 592 (takes ``-f`` option for sender, list of recipients on command line,
593 593 message on stdin). Normally, setting this to ``sendmail`` or
594 594 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
595 595
596 596 ``charsets``
597 597 Optional. Comma-separated list of character sets considered
598 598 convenient for recipients. Addresses, headers, and parts not
599 599 containing patches of outgoing messages will be encoded in the
600 600 first character set to which conversion from local encoding
601 601 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
602 602 conversion fails, the text in question is sent as is. Defaults to
603 603 empty (explicit) list.
604 604
605 605 Order of outgoing email character sets:
606 606
607 607 1. ``us-ascii``: always first, regardless of settings
608 608 2. ``email.charsets``: in order given by user
609 609 3. ``ui.fallbackencoding``: if not in email.charsets
610 610 4. ``$HGENCODING``: if not in email.charsets
611 611 5. ``utf-8``: always last, regardless of settings
612 612
613 613 Email example::
614 614
615 615 [email]
616 616 from = Joseph User <joe.user@example.com>
617 617 method = /usr/sbin/sendmail
618 618 # charsets for western Europeans
619 619 # us-ascii, utf-8 omitted, as they are tried first and last
620 620 charsets = iso-8859-1, iso-8859-15, windows-1252
621 621
622 622
623 623 ``extensions``
624 624 --------------
625 625
626 626 Mercurial has an extension mechanism for adding new features. To
627 627 enable an extension, create an entry for it in this section.
628 628
629 629 If you know that the extension is already in Python's search path,
630 630 you can give the name of the module, followed by ``=``, with nothing
631 631 after the ``=``.
632 632
633 633 Otherwise, give a name that you choose, followed by ``=``, followed by
634 634 the path to the ``.py`` file (including the file name extension) that
635 635 defines the extension.
636 636
637 637 To explicitly disable an extension that is enabled in an hgrc of
638 638 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
639 639 or ``foo = !`` when path is not supplied.
640 640
641 641 Example for ``~/.hgrc``::
642 642
643 643 [extensions]
644 644 # (the color extension will get loaded from Mercurial's path)
645 645 color =
646 646 # (this extension will get loaded from the file specified)
647 647 myfeature = ~/.hgext/myfeature.py
648 648
649 649
650 650 ``format``
651 651 ----------
652 652
653 653 ``usestore``
654 654 Enable or disable the "store" repository format which improves
655 655 compatibility with systems that fold case or otherwise mangle
656 656 filenames. Enabled by default. Disabling this option will allow
657 657 you to store longer filenames in some situations at the expense of
658 658 compatibility and ensures that the on-disk format of newly created
659 659 repositories will be compatible with Mercurial before version 0.9.4.
660 660
661 661 ``usefncache``
662 662 Enable or disable the "fncache" repository format which enhances
663 663 the "store" repository format (which has to be enabled to use
664 664 fncache) to allow longer filenames and avoids using Windows
665 665 reserved names, e.g. "nul". Enabled by default. Disabling this
666 666 option ensures that the on-disk format of newly created
667 667 repositories will be compatible with Mercurial before version 1.1.
668 668
669 669 ``dotencode``
670 670 Enable or disable the "dotencode" repository format which enhances
671 671 the "fncache" repository format (which has to be enabled to use
672 672 dotencode) to avoid issues with filenames starting with ._ on
673 673 Mac OS X and spaces on Windows. Enabled by default. Disabling this
674 674 option ensures that the on-disk format of newly created
675 675 repositories will be compatible with Mercurial before version 1.7.
676 676
677 677 ``graph``
678 678 ---------
679 679
680 680 Web graph view configuration. This section let you change graph
681 681 elements display properties by branches, for instance to make the
682 682 ``default`` branch stand out.
683 683
684 684 Each line has the following format::
685 685
686 686 <branch>.<argument> = <value>
687 687
688 688 where ``<branch>`` is the name of the branch being
689 689 customized. Example::
690 690
691 691 [graph]
692 692 # 2px width
693 693 default.width = 2
694 694 # red color
695 695 default.color = FF0000
696 696
697 697 Supported arguments:
698 698
699 699 ``width``
700 700 Set branch edges width in pixels.
701 701
702 702 ``color``
703 703 Set branch edges color in hexadecimal RGB notation.
704 704
705 705 ``hooks``
706 706 ---------
707 707
708 708 Commands or Python functions that get automatically executed by
709 709 various actions such as starting or finishing a commit. Multiple
710 710 hooks can be run for the same action by appending a suffix to the
711 711 action. Overriding a site-wide hook can be done by changing its
712 712 value or setting it to an empty string. Hooks can be prioritized
713 713 by adding a prefix of ``priority`` to the hook name on a new line
714 714 and setting the priority. The default priority is 0 if
715 715 not specified.
716 716
717 717 Example ``.hg/hgrc``::
718 718
719 719 [hooks]
720 720 # update working directory after adding changesets
721 721 changegroup.update = hg update
722 722 # do not use the site-wide hook
723 723 incoming =
724 724 incoming.email = /my/email/hook
725 725 incoming.autobuild = /my/build/hook
726 726 # force autobuild hook to run before other incoming hooks
727 727 priority.incoming.autobuild = 1
728 728
729 729 Most hooks are run with environment variables set that give useful
730 730 additional information. For each hook below, the environment
731 731 variables it is passed are listed with names of the form ``$HG_foo``.
732 732
733 733 ``changegroup``
734 734 Run after a changegroup has been added via push, pull or unbundle.
735 735 ID of the first new changeset is in ``$HG_NODE``. URL from which
736 736 changes came is in ``$HG_URL``.
737 737
738 738 ``commit``
739 739 Run after a changeset has been created in the local repository. ID
740 740 of the newly created changeset is in ``$HG_NODE``. Parent changeset
741 741 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
742 742
743 743 ``incoming``
744 744 Run after a changeset has been pulled, pushed, or unbundled into
745 745 the local repository. The ID of the newly arrived changeset is in
746 746 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
747 747
748 748 ``outgoing``
749 749 Run after sending changes from local repository to another. ID of
750 750 first changeset sent is in ``$HG_NODE``. Source of operation is in
751 751 ``$HG_SOURCE``; see "preoutgoing" hook for description.
752 752
753 753 ``post-<command>``
754 754 Run after successful invocations of the associated command. The
755 755 contents of the command line are passed as ``$HG_ARGS`` and the result
756 756 code in ``$HG_RESULT``. Parsed command line arguments are passed as
757 757 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
758 758 the python data internally passed to <command>. ``$HG_OPTS`` is a
759 759 dictionary of options (with unspecified options set to their defaults).
760 760 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
761 761
762 762 ``pre-<command>``
763 763 Run before executing the associated command. The contents of the
764 764 command line are passed as ``$HG_ARGS``. Parsed command line arguments
765 765 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
766 766 representations of the data internally passed to <command>. ``$HG_OPTS``
767 767 is a dictionary of options (with unspecified options set to their
768 768 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
769 769 failure, the command doesn't execute and Mercurial returns the failure
770 770 code.
771 771
772 772 ``prechangegroup``
773 773 Run before a changegroup is added via push, pull or unbundle. Exit
774 774 status 0 allows the changegroup to proceed. Non-zero status will
775 775 cause the push, pull or unbundle to fail. URL from which changes
776 776 will come is in ``$HG_URL``.
777 777
778 778 ``precommit``
779 779 Run before starting a local commit. Exit status 0 allows the
780 780 commit to proceed. Non-zero status will cause the commit to fail.
781 781 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
782 782
783 783 ``prelistkeys``
784 784 Run before listing pushkeys (like bookmarks) in the
785 785 repository. Non-zero status will cause failure. The key namespace is
786 786 in ``$HG_NAMESPACE``.
787 787
788 788 ``preoutgoing``
789 789 Run before collecting changes to send from the local repository to
790 790 another. Non-zero status will cause failure. This lets you prevent
791 791 pull over HTTP or SSH. Also prevents against local pull, push
792 792 (outbound) or bundle commands, but not effective, since you can
793 793 just copy files instead then. Source of operation is in
794 794 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
795 795 SSH or HTTP repository. If "push", "pull" or "bundle", operation
796 796 is happening on behalf of repository on same system.
797 797
798 798 ``prepushkey``
799 799 Run before a pushkey (like a bookmark) is added to the
800 800 repository. Non-zero status will cause the key to be rejected. The
801 801 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
802 802 the old value (if any) is in ``$HG_OLD``, and the new value is in
803 803 ``$HG_NEW``.
804 804
805 805 ``pretag``
806 806 Run before creating a tag. Exit status 0 allows the tag to be
807 807 created. Non-zero status will cause the tag to fail. ID of
808 808 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
809 809 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
810 810
811 811 ``pretxnopen``
812 812 Run before any new repository transaction is open. The reason for the
813 813 transaction will be in ``$HG_TXNNAME`` and a unique identifier for the
814 814 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
815 815 transaction from being opened.
816 816
817 817 ``pretxnclose``
818 818 Run right before the transaction is actually finalized. Any
819 819 repository change will be visible to the hook program. This lets you
820 820 validate the transaction content or change it. Exit status 0 allows
821 821 the commit to proceed. Non-zero status will cause the transaction to
822 822 be rolled back. The reason for the transaction opening will be in
823 823 ``$HG_TXNNAME`` and a unique identifier for the transaction will be in
824 824 ``HG_TXNID``. The rest of the available data will vary according the
825 825 transaction type. New changesets will add ``$HG_NODE`` (id of the
826 826 first added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables,
827 827 bookmarks and phases changes will set ``HG_BOOKMARK_MOVED`` and
828 828 ``HG_PHASES_MOVED`` to ``1``, etc.
829 829
830 830 ``txnclose``
831 831 Run after any repository transaction has been committed. At this
832 832 point, the transaction can no longer be rolled back. The hook will run
833 833 after the lock is released. See ``pretxnclose`` docs for details about
834 834 available variables.
835 835
836 836 ``txnabort``
837 837 Run when a transaction is aborted. See ``pretxnclose`` docs for details about
838 838 available variables.
839 839
840 840 ``pretxnchangegroup``
841 841 Run after a changegroup has been added via push, pull or unbundle,
842 842 but before the transaction has been committed. Changegroup is
843 843 visible to hook program. This lets you validate incoming changes
844 844 before accepting them. Passed the ID of the first new changeset in
845 845 ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero
846 846 status will cause the transaction to be rolled back and the push,
847 847 pull or unbundle will fail. URL that was source of changes is in
848 848 ``$HG_URL``.
849 849
850 850 ``pretxncommit``
851 851 Run after a changeset has been created but the transaction not yet
852 852 committed. Changeset is visible to hook program. This lets you
853 853 validate commit message and changes. Exit status 0 allows the
854 854 commit to proceed. Non-zero status will cause the transaction to
855 855 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
856 856 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
857 857
858 858 ``preupdate``
859 859 Run before updating the working directory. Exit status 0 allows
860 860 the update to proceed. Non-zero status will prevent the update.
861 861 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
862 862 of second new parent is in ``$HG_PARENT2``.
863 863
864 864 ``listkeys``
865 865 Run after listing pushkeys (like bookmarks) in the repository. The
866 866 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
867 867 dictionary containing the keys and values.
868 868
869 869 ``pushkey``
870 870 Run after a pushkey (like a bookmark) is added to the
871 871 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
872 872 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
873 873 value is in ``$HG_NEW``.
874 874
875 875 ``tag``
876 876 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
877 877 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
878 878 repository if ``$HG_LOCAL=0``.
879 879
880 880 ``update``
881 881 Run after updating the working directory. Changeset ID of first
882 882 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
883 883 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
884 884 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
885 885
886 886 .. note::
887 887
888 888 It is generally better to use standard hooks rather than the
889 889 generic pre- and post- command hooks as they are guaranteed to be
890 890 called in the appropriate contexts for influencing transactions.
891 891 Also, hooks like "commit" will be called in all contexts that
892 892 generate a commit (e.g. tag) and not just the commit command.
893 893
894 894 .. note::
895 895
896 896 Environment variables with empty values may not be passed to
897 897 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
898 898 will have an empty value under Unix-like platforms for non-merge
899 899 changesets, while it will not be available at all under Windows.
900 900
901 901 The syntax for Python hooks is as follows::
902 902
903 903 hookname = python:modulename.submodule.callable
904 904 hookname = python:/path/to/python/module.py:callable
905 905
906 906 Python hooks are run within the Mercurial process. Each hook is
907 907 called with at least three keyword arguments: a ui object (keyword
908 908 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
909 909 keyword that tells what kind of hook is used. Arguments listed as
910 910 environment variables above are passed as keyword arguments, with no
911 911 ``HG_`` prefix, and names in lower case.
912 912
913 913 If a Python hook returns a "true" value or raises an exception, this
914 914 is treated as a failure.
915 915
916 916
917 917 ``hostfingerprints``
918 918 --------------------
919 919
920 920 Fingerprints of the certificates of known HTTPS servers.
921 921 A HTTPS connection to a server with a fingerprint configured here will
922 922 only succeed if the servers certificate matches the fingerprint.
923 923 This is very similar to how ssh known hosts works.
924 924 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
925 925 The CA chain and web.cacerts is not used for servers with a fingerprint.
926 926
927 927 For example::
928 928
929 929 [hostfingerprints]
930 930 hg.intevation.org = fa:1f:d9:48:f1:e7:74:30:38:8d:d8:58:b6:94:b8:58:28:7d:8b:d0
931 931
932 932 This feature is only supported when using Python 2.6 or later.
933 933
934 934
935 935 ``http_proxy``
936 936 --------------
937 937
938 938 Used to access web-based Mercurial repositories through a HTTP
939 939 proxy.
940 940
941 941 ``host``
942 942 Host name and (optional) port of the proxy server, for example
943 943 "myproxy:8000".
944 944
945 945 ``no``
946 946 Optional. Comma-separated list of host names that should bypass
947 947 the proxy.
948 948
949 949 ``passwd``
950 950 Optional. Password to authenticate with at the proxy server.
951 951
952 952 ``user``
953 953 Optional. User name to authenticate with at the proxy server.
954 954
955 955 ``always``
956 956 Optional. Always use the proxy, even for localhost and any entries
957 957 in ``http_proxy.no``. True or False. Default: False.
958 958
959 959 ``merge-patterns``
960 960 ------------------
961 961
962 962 This section specifies merge tools to associate with particular file
963 963 patterns. Tools matched here will take precedence over the default
964 964 merge tool. Patterns are globs by default, rooted at the repository
965 965 root.
966 966
967 967 Example::
968 968
969 969 [merge-patterns]
970 970 **.c = kdiff3
971 971 **.jpg = myimgmerge
972 972
973 973 ``merge-tools``
974 974 ---------------
975 975
976 976 This section configures external merge tools to use for file-level
977 977 merges. This section has likely been preconfigured at install time.
978 978 Use :hg:`config merge-tools` to check the existing configuration.
979 979 Also see :hg:`help merge-tools` for more details.
980 980
981 981 Example ``~/.hgrc``::
982 982
983 983 [merge-tools]
984 984 # Override stock tool location
985 985 kdiff3.executable = ~/bin/kdiff3
986 986 # Specify command line
987 987 kdiff3.args = $base $local $other -o $output
988 988 # Give higher priority
989 989 kdiff3.priority = 1
990 990
991 991 # Changing the priority of preconfigured tool
992 992 vimdiff.priority = 0
993 993
994 994 # Define new tool
995 995 myHtmlTool.args = -m $local $other $base $output
996 996 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
997 997 myHtmlTool.priority = 1
998 998
999 999 Supported arguments:
1000 1000
1001 1001 ``priority``
1002 1002 The priority in which to evaluate this tool.
1003 1003 Default: 0.
1004 1004
1005 1005 ``executable``
1006 1006 Either just the name of the executable or its pathname. On Windows,
1007 1007 the path can use environment variables with ${ProgramFiles} syntax.
1008 1008 Default: the tool name.
1009 1009
1010 1010 ``args``
1011 1011 The arguments to pass to the tool executable. You can refer to the
1012 1012 files being merged as well as the output file through these
1013 1013 variables: ``$base``, ``$local``, ``$other``, ``$output``. The meaning
1014 1014 of ``$local`` and ``$other`` can vary depending on which action is being
1015 1015 performed. During and update or merge, ``$local`` represents the original
1016 1016 state of the file, while ``$other`` represents the commit you are updating
1017 1017 to or the commit you are merging with. During a rebase ``$local``
1018 1018 represents the destination of the rebase, and ``$other`` represents the
1019 1019 commit being rebased.
1020 1020 Default: ``$local $base $other``
1021 1021
1022 1022 ``premerge``
1023 1023 Attempt to run internal non-interactive 3-way merge tool before
1024 1024 launching external tool. Options are ``true``, ``false``, ``keep`` or
1025 1025 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1026 1026 premerge fails. The ``keep-merge3`` will do the same but include information
1027 1027 about the base of the merge in the marker (see internal :merge3 in
1028 1028 :hg:`help merge-tools`).
1029 1029 Default: True
1030 1030
1031 1031 ``binary``
1032 1032 This tool can merge binary files. Defaults to False, unless tool
1033 1033 was selected by file pattern match.
1034 1034
1035 1035 ``symlink``
1036 1036 This tool can merge symlinks. Defaults to False, even if tool was
1037 1037 selected by file pattern match.
1038 1038
1039 1039 ``check``
1040 1040 A list of merge success-checking options:
1041 1041
1042 1042 ``changed``
1043 1043 Ask whether merge was successful when the merged file shows no changes.
1044 1044 ``conflicts``
1045 1045 Check whether there are conflicts even though the tool reported success.
1046 1046 ``prompt``
1047 1047 Always prompt for merge success, regardless of success reported by tool.
1048 1048
1049 1049 ``fixeol``
1050 1050 Attempt to fix up EOL changes caused by the merge tool.
1051 1051 Default: False
1052 1052
1053 1053 ``gui``
1054 1054 This tool requires a graphical interface to run. Default: False
1055 1055
1056 1056 ``regkey``
1057 1057 Windows registry key which describes install location of this
1058 1058 tool. Mercurial will search for this key first under
1059 1059 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1060 1060 Default: None
1061 1061
1062 1062 ``regkeyalt``
1063 1063 An alternate Windows registry key to try if the first key is not
1064 1064 found. The alternate key uses the same ``regname`` and ``regappend``
1065 1065 semantics of the primary key. The most common use for this key
1066 1066 is to search for 32bit applications on 64bit operating systems.
1067 1067 Default: None
1068 1068
1069 1069 ``regname``
1070 1070 Name of value to read from specified registry key. Defaults to the
1071 1071 unnamed (default) value.
1072 1072
1073 1073 ``regappend``
1074 1074 String to append to the value read from the registry, typically
1075 1075 the executable name of the tool.
1076 1076 Default: None
1077 1077
1078 1078
1079 1079 ``patch``
1080 1080 ---------
1081 1081
1082 1082 Settings used when applying patches, for instance through the 'import'
1083 1083 command or with Mercurial Queues extension.
1084 1084
1085 1085 ``eol``
1086 1086 When set to 'strict' patch content and patched files end of lines
1087 1087 are preserved. When set to ``lf`` or ``crlf``, both files end of
1088 1088 lines are ignored when patching and the result line endings are
1089 1089 normalized to either LF (Unix) or CRLF (Windows). When set to
1090 1090 ``auto``, end of lines are again ignored while patching but line
1091 1091 endings in patched files are normalized to their original setting
1092 1092 on a per-file basis. If target file does not exist or has no end
1093 1093 of line, patch line endings are preserved.
1094 1094 Default: strict.
1095 1095
1096 1096 ``fuzz``
1097 1097 The number of lines of 'fuzz' to allow when applying patches. This
1098 1098 controls how much context the patcher is allowed to ignore when
1099 1099 trying to apply a patch.
1100 1100 Default: 2
1101 1101
1102 1102 ``paths``
1103 1103 ---------
1104 1104
1105 1105 Assigns symbolic names to repositories. The left side is the
1106 1106 symbolic name, and the right gives the directory or URL that is the
1107 1107 location of the repository. Default paths can be declared by setting
1108 1108 the following entries.
1109 1109
1110 1110 ``default``
1111 1111 Directory or URL to use when pulling if no source is specified.
1112 1112 Default is set to repository from which the current repository was
1113 1113 cloned.
1114 1114
1115 1115 ``default-push``
1116 1116 Optional. Directory or URL to use when pushing if no destination
1117 1117 is specified.
1118 1118
1119 1119 Custom paths can be defined by assigning the path to a name that later can be
1120 1120 used from the command line. Example::
1121 1121
1122 1122 [paths]
1123 1123 my_path = http://example.com/path
1124 1124
1125 1125 To push to the path defined in ``my_path`` run the command::
1126 1126
1127 1127 hg push my_path
1128 1128
1129 1129
1130 1130 ``phases``
1131 1131 ----------
1132 1132
1133 1133 Specifies default handling of phases. See :hg:`help phases` for more
1134 1134 information about working with phases.
1135 1135
1136 1136 ``publish``
1137 1137 Controls draft phase behavior when working as a server. When true,
1138 1138 pushed changesets are set to public in both client and server and
1139 1139 pulled or cloned changesets are set to public in the client.
1140 1140 Default: True
1141 1141
1142 1142 ``new-commit``
1143 1143 Phase of newly-created commits.
1144 1144 Default: draft
1145 1145
1146 1146 ``checksubrepos``
1147 1147 Check the phase of the current revision of each subrepository. Allowed
1148 1148 values are "ignore", "follow" and "abort". For settings other than
1149 1149 "ignore", the phase of the current revision of each subrepository is
1150 1150 checked before committing the parent repository. If any of those phases is
1151 1151 greater than the phase of the parent repository (e.g. if a subrepo is in a
1152 1152 "secret" phase while the parent repo is in "draft" phase), the commit is
1153 1153 either aborted (if checksubrepos is set to "abort") or the higher phase is
1154 1154 used for the parent repository commit (if set to "follow").
1155 1155 Default: "follow"
1156 1156
1157 1157
1158 1158 ``profiling``
1159 1159 -------------
1160 1160
1161 1161 Specifies profiling type, format, and file output. Two profilers are
1162 1162 supported: an instrumenting profiler (named ``ls``), and a sampling
1163 1163 profiler (named ``stat``).
1164 1164
1165 1165 In this section description, 'profiling data' stands for the raw data
1166 1166 collected during profiling, while 'profiling report' stands for a
1167 1167 statistical text report generated from the profiling data. The
1168 1168 profiling is done using lsprof.
1169 1169
1170 1170 ``type``
1171 1171 The type of profiler to use.
1172 1172 Default: ls.
1173 1173
1174 1174 ``ls``
1175 1175 Use Python's built-in instrumenting profiler. This profiler
1176 1176 works on all platforms, but each line number it reports is the
1177 1177 first line of a function. This restriction makes it difficult to
1178 1178 identify the expensive parts of a non-trivial function.
1179 1179 ``stat``
1180 1180 Use a third-party statistical profiler, statprof. This profiler
1181 1181 currently runs only on Unix systems, and is most useful for
1182 1182 profiling commands that run for longer than about 0.1 seconds.
1183 1183
1184 1184 ``format``
1185 1185 Profiling format. Specific to the ``ls`` instrumenting profiler.
1186 1186 Default: text.
1187 1187
1188 1188 ``text``
1189 1189 Generate a profiling report. When saving to a file, it should be
1190 1190 noted that only the report is saved, and the profiling data is
1191 1191 not kept.
1192 1192 ``kcachegrind``
1193 1193 Format profiling data for kcachegrind use: when saving to a
1194 1194 file, the generated file can directly be loaded into
1195 1195 kcachegrind.
1196 1196
1197 1197 ``frequency``
1198 1198 Sampling frequency. Specific to the ``stat`` sampling profiler.
1199 1199 Default: 1000.
1200 1200
1201 1201 ``output``
1202 1202 File path where profiling data or report should be saved. If the
1203 1203 file exists, it is replaced. Default: None, data is printed on
1204 1204 stderr
1205 1205
1206 1206 ``sort``
1207 1207 Sort field. Specific to the ``ls`` instrumenting profiler.
1208 1208 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1209 1209 ``inlinetime``.
1210 1210 Default: inlinetime.
1211 1211
1212 1212 ``limit``
1213 1213 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1214 1214 Default: 30.
1215 1215
1216 1216 ``nested``
1217 1217 Show at most this number of lines of drill-down info after each main entry.
1218 1218 This can help explain the difference between Total and Inline.
1219 1219 Specific to the ``ls`` instrumenting profiler.
1220 1220 Default: 5.
1221 1221
1222 1222 ``progress``
1223 1223 ------------
1224 1224
1225 1225 Mercurial commands can draw progress bars that are as informative as
1226 1226 possible. Some progress bars only offer indeterminate information, while others
1227 1227 have a definite end point.
1228 1228
1229 1229 ``delay``
1230 1230 Number of seconds (float) before showing the progress bar. (default: 3)
1231 1231
1232 1232 ``changedelay``
1233 1233 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1234 1234 that value will be used instead. (default: 1)
1235 1235
1236 1236 ``refresh``
1237 1237 Time in seconds between refreshes of the progress bar. (default: 0.1)
1238 1238
1239 1239 ``format``
1240 1240 Format of the progress bar.
1241 1241
1242 1242 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1243 1243 ``unit``, ``estimate``, speed, and item. item defaults to the last 20
1244 1244 characters of the item, but this can be changed by adding either ``-<num>``
1245 1245 which would take the last num characters, or ``+<num>`` for the first num
1246 1246 characters.
1247 1247
1248 1248 (default: Topic bar number estimate)
1249 1249
1250 1250 ``width``
1251 1251 If set, the maximum width of the progress information (that is, min(width,
1252 1252 term width) will be used)
1253 1253
1254 1254 ``clear-complete``
1255 1255 clear the progress bar after it's done (default to True)
1256 1256
1257 1257 ``disable``
1258 1258 If true, don't show a progress bar
1259 1259
1260 1260 ``assume-tty``
1261 1261 If true, ALWAYS show a progress bar, unless disable is given
1262 1262
1263 1263 ``revsetalias``
1264 1264 ---------------
1265 1265
1266 1266 Alias definitions for revsets. See :hg:`help revsets` for details.
1267 1267
1268 1268 ``server``
1269 1269 ----------
1270 1270
1271 1271 Controls generic server settings.
1272 1272
1273 1273 ``uncompressed``
1274 1274 Whether to allow clients to clone a repository using the
1275 1275 uncompressed streaming protocol. This transfers about 40% more
1276 1276 data than a regular clone, but uses less memory and CPU on both
1277 1277 server and client. Over a LAN (100 Mbps or better) or a very fast
1278 1278 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1279 1279 regular clone. Over most WAN connections (anything slower than
1280 1280 about 6 Mbps), uncompressed streaming is slower, because of the
1281 1281 extra data transfer overhead. This mode will also temporarily hold
1282 1282 the write lock while determining what data to transfer.
1283 1283 Default is True.
1284 1284
1285 1285 ``preferuncompressed``
1286 1286 When set, clients will try to use the uncompressed streaming
1287 1287 protocol. Default is False.
1288 1288
1289 1289 ``validate``
1290 1290 Whether to validate the completeness of pushed changesets by
1291 1291 checking that all new file revisions specified in manifests are
1292 1292 present. Default is False.
1293 1293
1294 1294 ``maxhttpheaderlen``
1295 1295 Instruct HTTP clients not to send request headers longer than this
1296 1296 many bytes. Default is 1024.
1297 1297
1298 1298 ``smtp``
1299 1299 --------
1300 1300
1301 1301 Configuration for extensions that need to send email messages.
1302 1302
1303 1303 ``host``
1304 1304 Host name of mail server, e.g. "mail.example.com".
1305 1305
1306 1306 ``port``
1307 1307 Optional. Port to connect to on mail server. Default: 465 (if
1308 1308 ``tls`` is smtps) or 25 (otherwise).
1309 1309
1310 1310 ``tls``
1311 1311 Optional. Method to enable TLS when connecting to mail server: starttls,
1312 1312 smtps or none. Default: none.
1313 1313
1314 1314 ``verifycert``
1315 1315 Optional. Verification for the certificate of mail server, when
1316 1316 ``tls`` is starttls or smtps. "strict", "loose" or False. For
1317 1317 "strict" or "loose", the certificate is verified as same as the
1318 1318 verification for HTTPS connections (see ``[hostfingerprints]`` and
1319 1319 ``[web] cacerts`` also). For "strict", sending email is also
1320 1320 aborted, if there is no configuration for mail server in
1321 1321 ``[hostfingerprints]`` and ``[web] cacerts``. --insecure for
1322 1322 :hg:`email` overwrites this as "loose". Default: "strict".
1323 1323
1324 1324 ``username``
1325 1325 Optional. User name for authenticating with the SMTP server.
1326 1326 Default: none.
1327 1327
1328 1328 ``password``
1329 1329 Optional. Password for authenticating with the SMTP server. If not
1330 1330 specified, interactive sessions will prompt the user for a
1331 1331 password; non-interactive sessions will fail. Default: none.
1332 1332
1333 1333 ``local_hostname``
1334 1334 Optional. It's the hostname that the sender can use to identify
1335 1335 itself to the MTA.
1336 1336
1337 1337
1338 1338 ``subpaths``
1339 1339 ------------
1340 1340
1341 1341 Subrepository source URLs can go stale if a remote server changes name
1342 1342 or becomes temporarily unavailable. This section lets you define
1343 1343 rewrite rules of the form::
1344 1344
1345 1345 <pattern> = <replacement>
1346 1346
1347 1347 where ``pattern`` is a regular expression matching a subrepository
1348 1348 source URL and ``replacement`` is the replacement string used to
1349 1349 rewrite it. Groups can be matched in ``pattern`` and referenced in
1350 1350 ``replacements``. For instance::
1351 1351
1352 1352 http://server/(.*)-hg/ = http://hg.server/\1/
1353 1353
1354 1354 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1355 1355
1356 1356 Relative subrepository paths are first made absolute, and the
1357 1357 rewrite rules are then applied on the full (absolute) path. The rules
1358 1358 are applied in definition order.
1359 1359
1360 1360 ``trusted``
1361 1361 -----------
1362 1362
1363 1363 Mercurial will not use the settings in the
1364 1364 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
1365 1365 user or to a trusted group, as various hgrc features allow arbitrary
1366 1366 commands to be run. This issue is often encountered when configuring
1367 1367 hooks or extensions for shared repositories or servers. However,
1368 1368 the web interface will use some safe settings from the ``[web]``
1369 1369 section.
1370 1370
1371 1371 This section specifies what users and groups are trusted. The
1372 1372 current user is always trusted. To trust everybody, list a user or a
1373 1373 group with name ``*``. These settings must be placed in an
1374 1374 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
1375 1375 user or service running Mercurial.
1376 1376
1377 1377 ``users``
1378 1378 Comma-separated list of trusted users.
1379 1379
1380 1380 ``groups``
1381 1381 Comma-separated list of trusted groups.
1382 1382
1383 1383
1384 1384 ``ui``
1385 1385 ------
1386 1386
1387 1387 User interface controls.
1388 1388
1389 1389 ``archivemeta``
1390 1390 Whether to include the .hg_archival.txt file containing meta data
1391 1391 (hashes for the repository base and for tip) in archives created
1392 1392 by the :hg:`archive` command or downloaded via hgweb.
1393 1393 Default is True.
1394 1394
1395 1395 ``askusername``
1396 1396 Whether to prompt for a username when committing. If True, and
1397 1397 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
1398 1398 be prompted to enter a username. If no username is entered, the
1399 1399 default ``USER@HOST`` is used instead.
1400 1400 Default is False.
1401 1401
1402 1402 ``commitsubrepos``
1403 1403 Whether to commit modified subrepositories when committing the
1404 1404 parent repository. If False and one subrepository has uncommitted
1405 1405 changes, abort the commit.
1406 1406 Default is False.
1407 1407
1408 1408 ``debug``
1409 1409 Print debugging information. True or False. Default is False.
1410 1410
1411 1411 ``editor``
1412 1412 The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
1413 1413
1414 1414 ``fallbackencoding``
1415 1415 Encoding to try if it's not possible to decode the changelog using
1416 1416 UTF-8. Default is ISO-8859-1.
1417 1417
1418 1418 ``ignore``
1419 1419 A file to read per-user ignore patterns from. This file should be
1420 1420 in the same format as a repository-wide .hgignore file. Filenames
1421 1421 are relative to the repository root. This option supports hook syntax,
1422 1422 so if you want to specify multiple ignore files, you can do so by
1423 1423 setting something like ``ignore.other = ~/.hgignore2``. For details
1424 1424 of the ignore file format, see the ``hgignore(5)`` man page.
1425 1425
1426 1426 ``interactive``
1427 1427 Allow to prompt the user. True or False. Default is True.
1428 1428
1429 1429 ``logtemplate``
1430 1430 Template string for commands that print changesets.
1431 1431
1432 1432 ``merge``
1433 1433 The conflict resolution program to use during a manual merge.
1434 1434 For more information on merge tools see :hg:`help merge-tools`.
1435 1435 For configuring merge tools see the ``[merge-tools]`` section.
1436 1436
1437 1437 ``mergemarkers``
1438 1438 Sets the merge conflict marker label styling. The ``detailed``
1439 1439 style uses the ``mergemarkertemplate`` setting to style the labels.
1440 1440 The ``basic`` style just uses 'local' and 'other' as the marker label.
1441 1441 One of ``basic`` or ``detailed``.
1442 1442 Default is ``basic``.
1443 1443
1444 1444 ``mergemarkertemplate``
1445 1445 The template used to print the commit description next to each conflict
1446 1446 marker during merge conflicts. See :hg:`help templates` for the template
1447 1447 format.
1448 1448 Defaults to showing the hash, tags, branches, bookmarks, author, and
1449 1449 the first line of the commit description.
1450 1450 If you use non-ASCII characters in names for tags, branches, bookmarks,
1451 1451 authors, and/or commit descriptions, you must pay attention to encodings of
1452 1452 managed files. At template expansion, non-ASCII characters use the encoding
1453 1453 specified by the ``--encoding`` global option, ``HGENCODING`` or other
1454 1454 environment variables that govern your locale. If the encoding of the merge
1455 1455 markers is different from the encoding of the merged files,
1456 1456 serious problems may occur.
1457 1457
1458 1458 ``patch``
1459 1459 An optional external tool that ``hg import`` and some extensions
1460 1460 will use for applying patches. By default Mercurial uses an
1461 1461 internal patch utility. The external tool must work as the common
1462 1462 Unix ``patch`` program. In particular, it must accept a ``-p``
1463 1463 argument to strip patch headers, a ``-d`` argument to specify the
1464 1464 current directory, a file name to patch, and a patch file to take
1465 1465 from stdin.
1466 1466
1467 1467 It is possible to specify a patch tool together with extra
1468 1468 arguments. For example, setting this option to ``patch --merge``
1469 1469 will use the ``patch`` program with its 2-way merge option.
1470 1470
1471 1471 ``portablefilenames``
1472 1472 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
1473 1473 Default is ``warn``.
1474 1474 If set to ``warn`` (or ``true``), a warning message is printed on POSIX
1475 1475 platforms, if a file with a non-portable filename is added (e.g. a file
1476 1476 with a name that can't be created on Windows because it contains reserved
1477 1477 parts like ``AUX``, reserved characters like ``:``, or would cause a case
1478 1478 collision with an existing file).
1479 1479 If set to ``ignore`` (or ``false``), no warning is printed.
1480 1480 If set to ``abort``, the command is aborted.
1481 1481 On Windows, this configuration option is ignored and the command aborted.
1482 1482
1483 1483 ``quiet``
1484 1484 Reduce the amount of output printed. True or False. Default is False.
1485 1485
1486 1486 ``remotecmd``
1487 1487 remote command to use for clone/push/pull operations. Default is ``hg``.
1488 1488
1489 1489 ``report_untrusted``
1490 1490 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
1491 1491 trusted user or group. True or False. Default is True.
1492 1492
1493 1493 ``slash``
1494 1494 Display paths using a slash (``/``) as the path separator. This
1495 1495 only makes a difference on systems where the default path
1496 1496 separator is not the slash character (e.g. Windows uses the
1497 1497 backslash character (``\``)).
1498 1498 Default is False.
1499 1499
1500 1500 ``statuscopies``
1501 1501 Display copies in the status command.
1502 1502
1503 1503 ``ssh``
1504 1504 command to use for SSH connections. Default is ``ssh``.
1505 1505
1506 1506 ``strict``
1507 1507 Require exact command names, instead of allowing unambiguous
1508 1508 abbreviations. True or False. Default is False.
1509 1509
1510 1510 ``style``
1511 1511 Name of style to use for command output.
1512 1512
1513 1513 ``timeout``
1514 1514 The timeout used when a lock is held (in seconds), a negative value
1515 1515 means no timeout. Default is 600.
1516 1516
1517 1517 ``traceback``
1518 1518 Mercurial always prints a traceback when an unknown exception
1519 1519 occurs. Setting this to True will make Mercurial print a traceback
1520 1520 on all exceptions, even those recognized by Mercurial (such as
1521 1521 IOError or MemoryError). Default is False.
1522 1522
1523 1523 ``username``
1524 1524 The committer of a changeset created when running "commit".
1525 1525 Typically a person's name and email address, e.g. ``Fred Widget
1526 1526 <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If
1527 1527 the username in hgrc is empty, it has to be specified manually or
1528 1528 in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set
1529 1529 ``username =`` in the system hgrc). Environment variables in the
1530 1530 username are expanded.
1531 1531
1532 1532 ``verbose``
1533 1533 Increase the amount of output printed. True or False. Default is False.
1534 1534
1535 1535
1536 1536 ``web``
1537 1537 -------
1538 1538
1539 1539 Web interface configuration. The settings in this section apply to
1540 1540 both the builtin webserver (started by :hg:`serve`) and the script you
1541 1541 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
1542 1542 and WSGI).
1543 1543
1544 1544 The Mercurial webserver does no authentication (it does not prompt for
1545 1545 usernames and passwords to validate *who* users are), but it does do
1546 1546 authorization (it grants or denies access for *authenticated users*
1547 1547 based on settings in this section). You must either configure your
1548 1548 webserver to do authentication for you, or disable the authorization
1549 1549 checks.
1550 1550
1551 1551 For a quick setup in a trusted environment, e.g., a private LAN, where
1552 1552 you want it to accept pushes from anybody, you can use the following
1553 1553 command line::
1554 1554
1555 1555 $ hg --config web.allow_push=* --config web.push_ssl=False serve
1556 1556
1557 1557 Note that this will allow anybody to push anything to the server and
1558 1558 that this should not be used for public servers.
1559 1559
1560 1560 The full set of options is:
1561 1561
1562 1562 ``accesslog``
1563 1563 Where to output the access log. Default is stdout.
1564 1564
1565 1565 ``address``
1566 1566 Interface address to bind to. Default is all.
1567 1567
1568 1568 ``allow_archive``
1569 1569 List of archive format (bz2, gz, zip) allowed for downloading.
1570 1570 Default is empty.
1571 1571
1572 1572 ``allowbz2``
1573 1573 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
1574 1574 revisions.
1575 1575 Default is False.
1576 1576
1577 1577 ``allowgz``
1578 1578 (DEPRECATED) Whether to allow .tar.gz downloading of repository
1579 1579 revisions.
1580 1580 Default is False.
1581 1581
1582 1582 ``allowpull``
1583 1583 Whether to allow pulling from the repository. Default is True.
1584 1584
1585 1585 ``allow_push``
1586 1586 Whether to allow pushing to the repository. If empty or not set,
1587 1587 push is not allowed. If the special value ``*``, any remote user can
1588 1588 push, including unauthenticated users. Otherwise, the remote user
1589 1589 must have been authenticated, and the authenticated user name must
1590 1590 be present in this list. The contents of the allow_push list are
1591 1591 examined after the deny_push list.
1592 1592
1593 1593 ``allow_read``
1594 1594 If the user has not already been denied repository access due to
1595 1595 the contents of deny_read, this list determines whether to grant
1596 1596 repository access to the user. If this list is not empty, and the
1597 1597 user is unauthenticated or not present in the list, then access is
1598 1598 denied for the user. If the list is empty or not set, then access
1599 1599 is permitted to all users by default. Setting allow_read to the
1600 1600 special value ``*`` is equivalent to it not being set (i.e. access
1601 1601 is permitted to all users). The contents of the allow_read list are
1602 1602 examined after the deny_read list.
1603 1603
1604 1604 ``allowzip``
1605 1605 (DEPRECATED) Whether to allow .zip downloading of repository
1606 1606 revisions. Default is False. This feature creates temporary files.
1607 1607
1608 1608 ``archivesubrepos``
1609 1609 Whether to recurse into subrepositories when archiving. Default is
1610 1610 False.
1611 1611
1612 1612 ``baseurl``
1613 1613 Base URL to use when publishing URLs in other locations, so
1614 1614 third-party tools like email notification hooks can construct
1615 1615 URLs. Example: ``http://hgserver/repos/``.
1616 1616
1617 1617 ``cacerts``
1618 1618 Path to file containing a list of PEM encoded certificate
1619 1619 authority certificates. Environment variables and ``~user``
1620 1620 constructs are expanded in the filename. If specified on the
1621 1621 client, then it will verify the identity of remote HTTPS servers
1622 1622 with these certificates.
1623 1623
1624 1624 This feature is only supported when using Python 2.6 or later. If you wish
1625 1625 to use it with earlier versions of Python, install the backported
1626 1626 version of the ssl library that is available from
1627 1627 ``http://pypi.python.org``.
1628 1628
1629 1629 To disable SSL verification temporarily, specify ``--insecure`` from
1630 1630 command line.
1631 1631
1632 1632 You can use OpenSSL's CA certificate file if your platform has
1633 1633 one. On most Linux systems this will be
1634 1634 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
1635 1635 generate this file manually. The form must be as follows::
1636 1636
1637 1637 -----BEGIN CERTIFICATE-----
1638 1638 ... (certificate in base64 PEM encoding) ...
1639 1639 -----END CERTIFICATE-----
1640 1640 -----BEGIN CERTIFICATE-----
1641 1641 ... (certificate in base64 PEM encoding) ...
1642 1642 -----END CERTIFICATE-----
1643 1643
1644 1644 ``cache``
1645 1645 Whether to support caching in hgweb. Defaults to True.
1646 1646
1647 1647 ``certificate``
1648 1648 Certificate to use when running :hg:`serve`.
1649 1649
1650 1650 ``collapse``
1651 1651 With ``descend`` enabled, repositories in subdirectories are shown at
1652 1652 a single level alongside repositories in the current path. With
1653 1653 ``collapse`` also enabled, repositories residing at a deeper level than
1654 1654 the current path are grouped behind navigable directory entries that
1655 1655 lead to the locations of these repositories. In effect, this setting
1656 1656 collapses each collection of repositories found within a subdirectory
1657 1657 into a single entry for that subdirectory. Default is False.
1658 1658
1659 1659 ``comparisoncontext``
1660 1660 Number of lines of context to show in side-by-side file comparison. If
1661 1661 negative or the value ``full``, whole files are shown. Default is 5.
1662 1662 This setting can be overridden by a ``context`` request parameter to the
1663 1663 ``comparison`` command, taking the same values.
1664 1664
1665 1665 ``contact``
1666 1666 Name or email address of the person in charge of the repository.
1667 1667 Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
1668 1668
1669 1669 ``deny_push``
1670 1670 Whether to deny pushing to the repository. If empty or not set,
1671 1671 push is not denied. If the special value ``*``, all remote users are
1672 1672 denied push. Otherwise, unauthenticated users are all denied, and
1673 1673 any authenticated user name present in this list is also denied. The
1674 1674 contents of the deny_push list are examined before the allow_push list.
1675 1675
1676 1676 ``deny_read``
1677 1677 Whether to deny reading/viewing of the repository. If this list is
1678 1678 not empty, unauthenticated users are all denied, and any
1679 1679 authenticated user name present in this list is also denied access to
1680 1680 the repository. If set to the special value ``*``, all remote users
1681 1681 are denied access (rarely needed ;). If deny_read is empty or not set,
1682 1682 the determination of repository access depends on the presence and
1683 1683 content of the allow_read list (see description). If both
1684 1684 deny_read and allow_read are empty or not set, then access is
1685 1685 permitted to all users by default. If the repository is being
1686 1686 served via hgwebdir, denied users will not be able to see it in
1687 1687 the list of repositories. The contents of the deny_read list have
1688 1688 priority over (are examined before) the contents of the allow_read
1689 1689 list.
1690 1690
1691 1691 ``descend``
1692 1692 hgwebdir indexes will not descend into subdirectories. Only repositories
1693 1693 directly in the current path will be shown (other repositories are still
1694 1694 available from the index corresponding to their containing path).
1695 1695
1696 1696 ``description``
1697 1697 Textual description of the repository's purpose or contents.
1698 1698 Default is "unknown".
1699 1699
1700 1700 ``encoding``
1701 1701 Character encoding name. Default is the current locale charset.
1702 1702 Example: "UTF-8"
1703 1703
1704 1704 ``errorlog``
1705 1705 Where to output the error log. Default is stderr.
1706 1706
1707 1707 ``guessmime``
1708 1708 Control MIME types for raw download of file content.
1709 1709 Set to True to let hgweb guess the content type from the file
1710 1710 extension. This will serve HTML files as ``text/html`` and might
1711 1711 allow cross-site scripting attacks when serving untrusted
1712 1712 repositories. Default is False.
1713 1713
1714 1714 ``hidden``
1715 1715 Whether to hide the repository in the hgwebdir index.
1716 1716 Default is False.
1717 1717
1718 1718 ``ipv6``
1719 1719 Whether to use IPv6. Default is False.
1720 1720
1721 1721 ``logoimg``
1722 1722 File name of the logo image that some templates display on each page.
1723 1723 The file name is relative to ``staticurl``. That is, the full path to
1724 1724 the logo image is "staticurl/logoimg".
1725 1725 If unset, ``hglogo.png`` will be used.
1726 1726
1727 1727 ``logourl``
1728 1728 Base URL to use for logos. If unset, ``http://mercurial.selenic.com/``
1729 1729 will be used.
1730 1730
1731 1731 ``maxchanges``
1732 1732 Maximum number of changes to list on the changelog. Default is 10.
1733 1733
1734 1734 ``maxfiles``
1735 1735 Maximum number of files to list per changeset. Default is 10.
1736 1736
1737 1737 ``maxshortchanges``
1738 1738 Maximum number of changes to list on the shortlog, graph or filelog
1739 1739 pages. Default is 60.
1740 1740
1741 1741 ``name``
1742 1742 Repository name to use in the web interface. Default is current
1743 1743 working directory.
1744 1744
1745 1745 ``port``
1746 1746 Port to listen on. Default is 8000.
1747 1747
1748 1748 ``prefix``
1749 1749 Prefix path to serve from. Default is '' (server root).
1750 1750
1751 1751 ``push_ssl``
1752 1752 Whether to require that inbound pushes be transported over SSL to
1753 1753 prevent password sniffing. Default is True.
1754 1754
1755 ``refreshinterval``
1756 How frequently directory listings re-scan the filesystem for new
1757 repositories, in seconds. This is relevant when wildcards are used
1758 to define paths. Depending on how much filesystem traversal is
1759 required, refreshing may negatively impact performance.
1760
1761 Default is 20. Values less than or equal to 0 always refresh.
1762
1755 1763 ``staticurl``
1756 1764 Base URL to use for static files. If unset, static files (e.g. the
1757 1765 hgicon.png favicon) will be served by the CGI script itself. Use
1758 1766 this setting to serve them directly with the HTTP server.
1759 1767 Example: ``http://hgserver/static/``.
1760 1768
1761 1769 ``stripes``
1762 1770 How many lines a "zebra stripe" should span in multi-line output.
1763 1771 Default is 1; set to 0 to disable.
1764 1772
1765 1773 ``style``
1766 1774 Which template map style to use. The available options are the names of
1767 1775 subdirectories in the HTML templates path. Default is ``paper``.
1768 1776 Example: ``monoblue``
1769 1777
1770 1778 ``templates``
1771 1779 Where to find the HTML templates. The default path to the HTML templates
1772 1780 can be obtained from ``hg debuginstall``.
1773 1781
1774 1782 ``websub``
1775 1783 ----------
1776 1784
1777 1785 Web substitution filter definition. You can use this section to
1778 1786 define a set of regular expression substitution patterns which
1779 1787 let you automatically modify the hgweb server output.
1780 1788
1781 1789 The default hgweb templates only apply these substitution patterns
1782 1790 on the revision description fields. You can apply them anywhere
1783 1791 you want when you create your own templates by adding calls to the
1784 1792 "websub" filter (usually after calling the "escape" filter).
1785 1793
1786 1794 This can be used, for example, to convert issue references to links
1787 1795 to your issue tracker, or to convert "markdown-like" syntax into
1788 1796 HTML (see the examples below).
1789 1797
1790 1798 Each entry in this section names a substitution filter.
1791 1799 The value of each entry defines the substitution expression itself.
1792 1800 The websub expressions follow the old interhg extension syntax,
1793 1801 which in turn imitates the Unix sed replacement syntax::
1794 1802
1795 1803 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
1796 1804
1797 1805 You can use any separator other than "/". The final "i" is optional
1798 1806 and indicates that the search must be case insensitive.
1799 1807
1800 1808 Examples::
1801 1809
1802 1810 [websub]
1803 1811 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
1804 1812 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
1805 1813 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
1806 1814
1807 1815 ``worker``
1808 1816 ----------
1809 1817
1810 1818 Parallel master/worker configuration. We currently perform working
1811 1819 directory updates in parallel on Unix-like systems, which greatly
1812 1820 helps performance.
1813 1821
1814 1822 ``numcpus``
1815 1823 Number of CPUs to use for parallel operations. Default is 4 or the
1816 1824 number of CPUs on the system, whichever is larger. A zero or
1817 1825 negative value is treated as ``use the default``.
@@ -1,472 +1,478
1 1 # hgweb/hgwebdir_mod.py - Web interface for a directory of repositories.
2 2 #
3 3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
4 4 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
5 5 #
6 6 # This software may be used and distributed according to the terms of the
7 7 # GNU General Public License version 2 or any later version.
8 8
9 9 import os, re, time
10 10 from mercurial.i18n import _
11 11 from mercurial import ui, hg, scmutil, util, templater
12 12 from mercurial import error, encoding
13 13 from common import ErrorResponse, get_mtime, staticfile, paritygen, ismember, \
14 14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
15 15 from hgweb_mod import hgweb, makebreadcrumb
16 16 from request import wsgirequest
17 17 import webutil
18 18
19 19 def cleannames(items):
20 20 return [(util.pconvert(name).strip('/'), path) for name, path in items]
21 21
22 22 def findrepos(paths):
23 23 repos = []
24 24 for prefix, root in cleannames(paths):
25 25 roothead, roottail = os.path.split(root)
26 26 # "foo = /bar/*" or "foo = /bar/**" lets every repo /bar/N in or below
27 27 # /bar/ be served as as foo/N .
28 28 # '*' will not search inside dirs with .hg (except .hg/patches),
29 29 # '**' will search inside dirs with .hg (and thus also find subrepos).
30 30 try:
31 31 recurse = {'*': False, '**': True}[roottail]
32 32 except KeyError:
33 33 repos.append((prefix, root))
34 34 continue
35 35 roothead = os.path.normpath(os.path.abspath(roothead))
36 36 paths = scmutil.walkrepos(roothead, followsym=True, recurse=recurse)
37 37 repos.extend(urlrepos(prefix, roothead, paths))
38 38 return repos
39 39
40 40 def urlrepos(prefix, roothead, paths):
41 41 """yield url paths and filesystem paths from a list of repo paths
42 42
43 43 >>> conv = lambda seq: [(v, util.pconvert(p)) for v,p in seq]
44 44 >>> conv(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
45 45 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
46 46 >>> conv(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
47 47 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
48 48 """
49 49 for path in paths:
50 50 path = os.path.normpath(path)
51 51 yield (prefix + '/' +
52 52 util.pconvert(path[len(roothead):]).lstrip('/')).strip('/'), path
53 53
54 54 def geturlcgivars(baseurl, port):
55 55 """
56 56 Extract CGI variables from baseurl
57 57
58 58 >>> geturlcgivars("http://host.org/base", "80")
59 59 ('host.org', '80', '/base')
60 60 >>> geturlcgivars("http://host.org:8000/base", "80")
61 61 ('host.org', '8000', '/base')
62 62 >>> geturlcgivars('/base', 8000)
63 63 ('', '8000', '/base')
64 64 >>> geturlcgivars("base", '8000')
65 65 ('', '8000', '/base')
66 66 >>> geturlcgivars("http://host", '8000')
67 67 ('host', '8000', '/')
68 68 >>> geturlcgivars("http://host/", '8000')
69 69 ('host', '8000', '/')
70 70 """
71 71 u = util.url(baseurl)
72 72 name = u.host or ''
73 73 if u.port:
74 74 port = u.port
75 75 path = u.path or ""
76 76 if not path.startswith('/'):
77 77 path = '/' + path
78 78
79 79 return name, str(port), path
80 80
81 81 class hgwebdir(object):
82 refreshinterval = 20
83
84 82 def __init__(self, conf, baseui=None):
85 83 self.conf = conf
86 84 self.baseui = baseui
85 self.ui = None
87 86 self.lastrefresh = 0
88 87 self.motd = None
89 88 self.refresh()
90 89
91 90 def refresh(self):
92 if self.lastrefresh + self.refreshinterval > time.time():
91 refreshinterval = 20
92 if self.ui:
93 refreshinterval = self.ui.configint('web', 'refreshinterval',
94 refreshinterval)
95
96 # refreshinterval <= 0 means to always refresh.
97 if (refreshinterval > 0 and
98 self.lastrefresh + refreshinterval > time.time()):
93 99 return
94 100
95 101 if self.baseui:
96 102 u = self.baseui.copy()
97 103 else:
98 104 u = ui.ui()
99 105 u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir')
100 106 u.setconfig('ui', 'nontty', 'true', 'hgwebdir')
101 107 # displaying bundling progress bar while serving feels wrong and may
102 108 # break some wsgi implementations.
103 109 u.setconfig('progress', 'disable', 'true', 'hgweb')
104 110
105 111 if not isinstance(self.conf, (dict, list, tuple)):
106 112 map = {'paths': 'hgweb-paths'}
107 113 if not os.path.exists(self.conf):
108 114 raise util.Abort(_('config file %s not found!') % self.conf)
109 115 u.readconfig(self.conf, remap=map, trust=True)
110 116 paths = []
111 117 for name, ignored in u.configitems('hgweb-paths'):
112 118 for path in u.configlist('hgweb-paths', name):
113 119 paths.append((name, path))
114 120 elif isinstance(self.conf, (list, tuple)):
115 121 paths = self.conf
116 122 elif isinstance(self.conf, dict):
117 123 paths = self.conf.items()
118 124
119 125 repos = findrepos(paths)
120 126 for prefix, root in u.configitems('collections'):
121 127 prefix = util.pconvert(prefix)
122 128 for path in scmutil.walkrepos(root, followsym=True):
123 129 repo = os.path.normpath(path)
124 130 name = util.pconvert(repo)
125 131 if name.startswith(prefix):
126 132 name = name[len(prefix):]
127 133 repos.append((name.lstrip('/'), repo))
128 134
129 135 self.repos = repos
130 136 self.ui = u
131 137 encoding.encoding = self.ui.config('web', 'encoding',
132 138 encoding.encoding)
133 139 self.style = self.ui.config('web', 'style', 'paper')
134 140 self.templatepath = self.ui.config('web', 'templates', None)
135 141 self.stripecount = self.ui.config('web', 'stripes', 1)
136 142 if self.stripecount:
137 143 self.stripecount = int(self.stripecount)
138 144 self._baseurl = self.ui.config('web', 'baseurl')
139 145 prefix = self.ui.config('web', 'prefix', '')
140 146 if prefix.startswith('/'):
141 147 prefix = prefix[1:]
142 148 if prefix.endswith('/'):
143 149 prefix = prefix[:-1]
144 150 self.prefix = prefix
145 151 self.lastrefresh = time.time()
146 152
147 153 def run(self):
148 154 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
149 155 raise RuntimeError("This function is only intended to be "
150 156 "called while running as a CGI script.")
151 157 import mercurial.hgweb.wsgicgi as wsgicgi
152 158 wsgicgi.launch(self)
153 159
154 160 def __call__(self, env, respond):
155 161 req = wsgirequest(env, respond)
156 162 return self.run_wsgi(req)
157 163
158 164 def read_allowed(self, ui, req):
159 165 """Check allow_read and deny_read config options of a repo's ui object
160 166 to determine user permissions. By default, with neither option set (or
161 167 both empty), allow all users to read the repo. There are two ways a
162 168 user can be denied read access: (1) deny_read is not empty, and the
163 169 user is unauthenticated or deny_read contains user (or *), and (2)
164 170 allow_read is not empty and the user is not in allow_read. Return True
165 171 if user is allowed to read the repo, else return False."""
166 172
167 173 user = req.env.get('REMOTE_USER')
168 174
169 175 deny_read = ui.configlist('web', 'deny_read', untrusted=True)
170 176 if deny_read and (not user or ismember(ui, user, deny_read)):
171 177 return False
172 178
173 179 allow_read = ui.configlist('web', 'allow_read', untrusted=True)
174 180 # by default, allow reading if no allow_read option has been set
175 181 if (not allow_read) or ismember(ui, user, allow_read):
176 182 return True
177 183
178 184 return False
179 185
180 186 def run_wsgi(self, req):
181 187 try:
182 188 self.refresh()
183 189
184 190 virtual = req.env.get("PATH_INFO", "").strip('/')
185 191 tmpl = self.templater(req)
186 192 ctype = tmpl('mimetype', encoding=encoding.encoding)
187 193 ctype = templater.stringify(ctype)
188 194
189 195 # a static file
190 196 if virtual.startswith('static/') or 'static' in req.form:
191 197 if virtual.startswith('static/'):
192 198 fname = virtual[7:]
193 199 else:
194 200 fname = req.form['static'][0]
195 201 static = self.ui.config("web", "static", None,
196 202 untrusted=False)
197 203 if not static:
198 204 tp = self.templatepath or templater.templatepaths()
199 205 if isinstance(tp, str):
200 206 tp = [tp]
201 207 static = [os.path.join(p, 'static') for p in tp]
202 208 staticfile(static, fname, req)
203 209 return []
204 210
205 211 # top-level index
206 212 elif not virtual:
207 213 req.respond(HTTP_OK, ctype)
208 214 return self.makeindex(req, tmpl)
209 215
210 216 # nested indexes and hgwebs
211 217
212 218 repos = dict(self.repos)
213 219 virtualrepo = virtual
214 220 while virtualrepo:
215 221 real = repos.get(virtualrepo)
216 222 if real:
217 223 req.env['REPO_NAME'] = virtualrepo
218 224 try:
219 225 # ensure caller gets private copy of ui
220 226 repo = hg.repository(self.ui.copy(), real)
221 227 return hgweb(repo).run_wsgi(req)
222 228 except IOError as inst:
223 229 msg = inst.strerror
224 230 raise ErrorResponse(HTTP_SERVER_ERROR, msg)
225 231 except error.RepoError as inst:
226 232 raise ErrorResponse(HTTP_SERVER_ERROR, str(inst))
227 233
228 234 up = virtualrepo.rfind('/')
229 235 if up < 0:
230 236 break
231 237 virtualrepo = virtualrepo[:up]
232 238
233 239 # browse subdirectories
234 240 subdir = virtual + '/'
235 241 if [r for r in repos if r.startswith(subdir)]:
236 242 req.respond(HTTP_OK, ctype)
237 243 return self.makeindex(req, tmpl, subdir)
238 244
239 245 # prefixes not found
240 246 req.respond(HTTP_NOT_FOUND, ctype)
241 247 return tmpl("notfound", repo=virtual)
242 248
243 249 except ErrorResponse as err:
244 250 req.respond(err, ctype)
245 251 return tmpl('error', error=err.message or '')
246 252 finally:
247 253 tmpl = None
248 254
249 255 def makeindex(self, req, tmpl, subdir=""):
250 256
251 257 def archivelist(ui, nodeid, url):
252 258 allowed = ui.configlist("web", "allow_archive", untrusted=True)
253 259 archives = []
254 260 for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
255 261 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
256 262 untrusted=True):
257 263 archives.append({"type" : i[0], "extension": i[1],
258 264 "node": nodeid, "url": url})
259 265 return archives
260 266
261 267 def rawentries(subdir="", **map):
262 268
263 269 descend = self.ui.configbool('web', 'descend', True)
264 270 collapse = self.ui.configbool('web', 'collapse', False)
265 271 seenrepos = set()
266 272 seendirs = set()
267 273 for name, path in self.repos:
268 274
269 275 if not name.startswith(subdir):
270 276 continue
271 277 name = name[len(subdir):]
272 278 directory = False
273 279
274 280 if '/' in name:
275 281 if not descend:
276 282 continue
277 283
278 284 nameparts = name.split('/')
279 285 rootname = nameparts[0]
280 286
281 287 if not collapse:
282 288 pass
283 289 elif rootname in seendirs:
284 290 continue
285 291 elif rootname in seenrepos:
286 292 pass
287 293 else:
288 294 directory = True
289 295 name = rootname
290 296
291 297 # redefine the path to refer to the directory
292 298 discarded = '/'.join(nameparts[1:])
293 299
294 300 # remove name parts plus accompanying slash
295 301 path = path[:-len(discarded) - 1]
296 302
297 303 try:
298 304 r = hg.repository(self.ui, path)
299 305 directory = False
300 306 except (IOError, error.RepoError):
301 307 pass
302 308
303 309 parts = [name]
304 310 if 'PATH_INFO' in req.env:
305 311 parts.insert(0, req.env['PATH_INFO'].rstrip('/'))
306 312 if req.env['SCRIPT_NAME']:
307 313 parts.insert(0, req.env['SCRIPT_NAME'])
308 314 url = re.sub(r'/+', '/', '/'.join(parts) + '/')
309 315
310 316 # show either a directory entry or a repository
311 317 if directory:
312 318 # get the directory's time information
313 319 try:
314 320 d = (get_mtime(path), util.makedate()[1])
315 321 except OSError:
316 322 continue
317 323
318 324 # add '/' to the name to make it obvious that
319 325 # the entry is a directory, not a regular repository
320 326 row = {'contact': "",
321 327 'contact_sort': "",
322 328 'name': name + '/',
323 329 'name_sort': name,
324 330 'url': url,
325 331 'description': "",
326 332 'description_sort': "",
327 333 'lastchange': d,
328 334 'lastchange_sort': d[1]-d[0],
329 335 'archives': [],
330 336 'isdirectory': True}
331 337
332 338 seendirs.add(name)
333 339 yield row
334 340 continue
335 341
336 342 u = self.ui.copy()
337 343 try:
338 344 u.readconfig(os.path.join(path, '.hg', 'hgrc'))
339 345 except Exception as e:
340 346 u.warn(_('error reading %s/.hg/hgrc: %s\n') % (path, e))
341 347 continue
342 348 def get(section, name, default=None):
343 349 return u.config(section, name, default, untrusted=True)
344 350
345 351 if u.configbool("web", "hidden", untrusted=True):
346 352 continue
347 353
348 354 if not self.read_allowed(u, req):
349 355 continue
350 356
351 357 # update time with local timezone
352 358 try:
353 359 r = hg.repository(self.ui, path)
354 360 except IOError:
355 361 u.warn(_('error accessing repository at %s\n') % path)
356 362 continue
357 363 except error.RepoError:
358 364 u.warn(_('error accessing repository at %s\n') % path)
359 365 continue
360 366 try:
361 367 d = (get_mtime(r.spath), util.makedate()[1])
362 368 except OSError:
363 369 continue
364 370
365 371 contact = get_contact(get)
366 372 description = get("web", "description", "")
367 373 seenrepos.add(name)
368 374 name = get("web", "name", name)
369 375 row = {'contact': contact or "unknown",
370 376 'contact_sort': contact.upper() or "unknown",
371 377 'name': name,
372 378 'name_sort': name,
373 379 'url': url,
374 380 'description': description or "unknown",
375 381 'description_sort': description.upper() or "unknown",
376 382 'lastchange': d,
377 383 'lastchange_sort': d[1]-d[0],
378 384 'archives': archivelist(u, "tip", url),
379 385 'isdirectory': None,
380 386 }
381 387
382 388 yield row
383 389
384 390 sortdefault = None, False
385 391 def entries(sortcolumn="", descending=False, subdir="", **map):
386 392 rows = rawentries(subdir=subdir, **map)
387 393
388 394 if sortcolumn and sortdefault != (sortcolumn, descending):
389 395 sortkey = '%s_sort' % sortcolumn
390 396 rows = sorted(rows, key=lambda x: x[sortkey],
391 397 reverse=descending)
392 398 for row, parity in zip(rows, paritygen(self.stripecount)):
393 399 row['parity'] = parity
394 400 yield row
395 401
396 402 self.refresh()
397 403 sortable = ["name", "description", "contact", "lastchange"]
398 404 sortcolumn, descending = sortdefault
399 405 if 'sort' in req.form:
400 406 sortcolumn = req.form['sort'][0]
401 407 descending = sortcolumn.startswith('-')
402 408 if descending:
403 409 sortcolumn = sortcolumn[1:]
404 410 if sortcolumn not in sortable:
405 411 sortcolumn = ""
406 412
407 413 sort = [("sort_%s" % column,
408 414 "%s%s" % ((not descending and column == sortcolumn)
409 415 and "-" or "", column))
410 416 for column in sortable]
411 417
412 418 self.refresh()
413 419 self.updatereqenv(req.env)
414 420
415 421 return tmpl("index", entries=entries, subdir=subdir,
416 422 pathdef=makebreadcrumb('/' + subdir, self.prefix),
417 423 sortcolumn=sortcolumn, descending=descending,
418 424 **dict(sort))
419 425
420 426 def templater(self, req):
421 427
422 428 def motd(**map):
423 429 if self.motd is not None:
424 430 yield self.motd
425 431 else:
426 432 yield config('web', 'motd', '')
427 433
428 434 def config(section, name, default=None, untrusted=True):
429 435 return self.ui.config(section, name, default, untrusted)
430 436
431 437 self.updatereqenv(req.env)
432 438
433 439 url = req.env.get('SCRIPT_NAME', '')
434 440 if not url.endswith('/'):
435 441 url += '/'
436 442
437 443 vars = {}
438 444 styles = (
439 445 req.form.get('style', [None])[0],
440 446 config('web', 'style'),
441 447 'paper'
442 448 )
443 449 style, mapfile = templater.stylemap(styles, self.templatepath)
444 450 if style == styles[0]:
445 451 vars['style'] = style
446 452
447 453 start = url[-1] == '?' and '&' or '?'
448 454 sessionvars = webutil.sessionvars(vars, start)
449 455 logourl = config('web', 'logourl', 'http://mercurial.selenic.com/')
450 456 logoimg = config('web', 'logoimg', 'hglogo.png')
451 457 staticurl = config('web', 'staticurl') or url + 'static/'
452 458 if not staticurl.endswith('/'):
453 459 staticurl += '/'
454 460
455 461 tmpl = templater.templater(mapfile,
456 462 defaults={"encoding": encoding.encoding,
457 463 "motd": motd,
458 464 "url": url,
459 465 "logourl": logourl,
460 466 "logoimg": logoimg,
461 467 "staticurl": staticurl,
462 468 "sessionvars": sessionvars,
463 469 "style": style,
464 470 })
465 471 return tmpl
466 472
467 473 def updatereqenv(self, env):
468 474 if self._baseurl is not None:
469 475 name, port, path = geturlcgivars(self._baseurl, env['SERVER_PORT'])
470 476 env['SERVER_NAME'] = name
471 477 env['SERVER_PORT'] = port
472 478 env['SCRIPT_NAME'] = path
@@ -1,1286 +1,1347
1 1 #require serve
2 2
3 3 hide outer repo and work in dir without '.hg'
4 4 $ hg init
5 5 $ mkdir dir
6 6 $ cd dir
7 7
8 8 Tests some basic hgwebdir functionality. Tests setting up paths and
9 9 collection, different forms of 404s and the subdirectory support.
10 10
11 11 $ mkdir webdir
12 12 $ cd webdir
13 13 $ hg init a
14 14 $ echo a > a/a
15 15 $ hg --cwd a ci -Ama -d'1 0'
16 16 adding a
17 17
18 18 create a mercurial queue repository
19 19
20 20 $ hg --cwd a qinit --config extensions.hgext.mq= -c
21 21 $ hg init b
22 22 $ echo b > b/b
23 23 $ hg --cwd b ci -Amb -d'2 0'
24 24 adding b
25 25
26 26 create a nested repository
27 27
28 28 $ cd b
29 29 $ hg init d
30 30 $ echo d > d/d
31 31 $ hg --cwd d ci -Amd -d'3 0'
32 32 adding d
33 33 $ cd ..
34 34 $ hg init c
35 35 $ echo c > c/c
36 36 $ hg --cwd c ci -Amc -d'3 0'
37 37 adding c
38 38
39 39 create a subdirectory containing repositories and subrepositories
40 40
41 41 $ mkdir notrepo
42 42 $ cd notrepo
43 43 $ hg init e
44 44 $ echo e > e/e
45 45 $ hg --cwd e ci -Ame -d'4 0'
46 46 adding e
47 47 $ hg init e/e2
48 48 $ echo e2 > e/e2/e2
49 49 $ hg --cwd e/e2 ci -Ame2 -d '4 0'
50 50 adding e2
51 51 $ hg init f
52 52 $ echo f > f/f
53 53 $ hg --cwd f ci -Amf -d'4 0'
54 54 adding f
55 55 $ hg init f/f2
56 56 $ echo f2 > f/f2/f2
57 57 $ hg --cwd f/f2 ci -Amf2 -d '4 0'
58 58 adding f2
59 59 $ echo 'f2 = f2' > f/.hgsub
60 60 $ hg -R f ci -Am 'add subrepo' -d'4 0'
61 61 adding .hgsub
62 62 $ cat >> f/.hg/hgrc << EOF
63 63 > [web]
64 64 > name = fancy name for repo f
65 65 > EOF
66 66 $ cd ..
67 67
68 68 create repository without .hg/store
69 69
70 70 $ hg init nostore
71 71 $ rm -R nostore/.hg/store
72 72 $ root=`pwd`
73 73 $ cd ..
74 74
75 75 serve
76 76 $ cat > paths.conf <<EOF
77 77 > [paths]
78 78 > a=$root/a
79 79 > b=$root/b
80 80 > EOF
81 81 $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \
82 82 > -A access-paths.log -E error-paths-1.log
83 83 $ cat hg.pid >> $DAEMON_PIDS
84 84
85 85 should give a 404 - file does not exist
86 86
87 87 $ get-with-headers.py localhost:$HGPORT 'a/file/tip/bork?style=raw'
88 88 404 Not Found
89 89
90 90
91 91 error: bork@8580ff50825a: not found in manifest
92 92 [1]
93 93
94 94 should succeed
95 95
96 96 $ get-with-headers.py localhost:$HGPORT '?style=raw'
97 97 200 Script output follows
98 98
99 99
100 100 /a/
101 101 /b/
102 102
103 103 $ get-with-headers.py localhost:$HGPORT 'a/file/tip/a?style=raw'
104 104 200 Script output follows
105 105
106 106 a
107 107 $ get-with-headers.py localhost:$HGPORT 'b/file/tip/b?style=raw'
108 108 200 Script output follows
109 109
110 110 b
111 111
112 112 should give a 404 - repo is not published
113 113
114 114 $ get-with-headers.py localhost:$HGPORT 'c/file/tip/c?style=raw'
115 115 404 Not Found
116 116
117 117
118 118 error: repository c/file/tip/c not found
119 119 [1]
120 120
121 121 atom-log without basedir
122 122
123 123 $ get-with-headers.py localhost:$HGPORT 'a/atom-log' | grep '<link'
124 124 <link rel="self" href="http://*:$HGPORT/a/atom-log"/> (glob)
125 125 <link rel="alternate" href="http://*:$HGPORT/a/"/> (glob)
126 126 <link href="http://*:$HGPORT/a/rev/8580ff50825a"/> (glob)
127 127
128 128 rss-log without basedir
129 129
130 130 $ get-with-headers.py localhost:$HGPORT 'a/rss-log' | grep '<guid'
131 131 <guid isPermaLink="true">http://*:$HGPORT/a/rev/8580ff50825a</guid> (glob)
132 132 $ cat > paths.conf <<EOF
133 133 > [paths]
134 134 > t/a/=$root/a
135 135 > b=$root/b
136 136 > coll=$root/*
137 137 > rcoll=$root/**
138 138 > star=*
139 139 > starstar=**
140 140 > astar=webdir/a/*
141 141 > EOF
142 142 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
143 143 > -A access-paths.log -E error-paths-2.log
144 144 $ cat hg.pid >> $DAEMON_PIDS
145 145
146 146 should succeed, slashy names
147 147
148 148 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
149 149 200 Script output follows
150 150
151 151
152 152 /t/a/
153 153 /b/
154 154 /coll/a/
155 155 /coll/a/.hg/patches/
156 156 /coll/b/
157 157 /coll/c/
158 158 /coll/notrepo/e/
159 159 /coll/notrepo/f/
160 160 /rcoll/a/
161 161 /rcoll/a/.hg/patches/
162 162 /rcoll/b/
163 163 /rcoll/b/d/
164 164 /rcoll/c/
165 165 /rcoll/notrepo/e/
166 166 /rcoll/notrepo/e/e2/
167 167 /rcoll/notrepo/f/
168 168 /rcoll/notrepo/f/f2/
169 169 /star/webdir/a/
170 170 /star/webdir/a/.hg/patches/
171 171 /star/webdir/b/
172 172 /star/webdir/c/
173 173 /star/webdir/notrepo/e/
174 174 /star/webdir/notrepo/f/
175 175 /starstar/webdir/a/
176 176 /starstar/webdir/a/.hg/patches/
177 177 /starstar/webdir/b/
178 178 /starstar/webdir/b/d/
179 179 /starstar/webdir/c/
180 180 /starstar/webdir/notrepo/e/
181 181 /starstar/webdir/notrepo/e/e2/
182 182 /starstar/webdir/notrepo/f/
183 183 /starstar/webdir/notrepo/f/f2/
184 184 /astar/
185 185 /astar/.hg/patches/
186 186
187 187 $ get-with-headers.py localhost:$HGPORT1 '?style=paper'
188 188 200 Script output follows
189 189
190 190 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
191 191 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
192 192 <head>
193 193 <link rel="icon" href="/static/hgicon.png" type="image/png" />
194 194 <meta name="robots" content="index, nofollow" />
195 195 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
196 196 <script type="text/javascript" src="/static/mercurial.js"></script>
197 197
198 198 <title>Mercurial repositories index</title>
199 199 </head>
200 200 <body>
201 201
202 202 <div class="container">
203 203 <div class="menu">
204 204 <a href="http://mercurial.selenic.com/">
205 205 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
206 206 </div>
207 207 <div class="main">
208 208 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
209 209
210 210 <table class="bigtable">
211 211 <thead>
212 212 <tr>
213 213 <th><a href="?sort=name">Name</a></th>
214 214 <th><a href="?sort=description">Description</a></th>
215 215 <th><a href="?sort=contact">Contact</a></th>
216 216 <th><a href="?sort=lastchange">Last modified</a></th>
217 217 <th>&nbsp;</th>
218 218 <th>&nbsp;</th>
219 219 </tr>
220 220 </thead>
221 221 <tbody class="stripes2">
222 222
223 223 <tr>
224 224 <td><a href="/t/a/?style=paper">t/a</a></td>
225 225 <td>unknown</td>
226 226 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
227 227 <td class="age">*</td> (glob)
228 228 <td class="indexlinks"></td>
229 229 <td>
230 230 <a href="/t/a/atom-log" title="subscribe to repository atom feed">
231 231 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
232 232 </a>
233 233 </td>
234 234 </tr>
235 235
236 236 <tr>
237 237 <td><a href="/b/?style=paper">b</a></td>
238 238 <td>unknown</td>
239 239 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
240 240 <td class="age">*</td> (glob)
241 241 <td class="indexlinks"></td>
242 242 <td>
243 243 <a href="/b/atom-log" title="subscribe to repository atom feed">
244 244 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
245 245 </a>
246 246 </td>
247 247 </tr>
248 248
249 249 <tr>
250 250 <td><a href="/coll/a/?style=paper">coll/a</a></td>
251 251 <td>unknown</td>
252 252 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
253 253 <td class="age">*</td> (glob)
254 254 <td class="indexlinks"></td>
255 255 <td>
256 256 <a href="/coll/a/atom-log" title="subscribe to repository atom feed">
257 257 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
258 258 </a>
259 259 </td>
260 260 </tr>
261 261
262 262 <tr>
263 263 <td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td>
264 264 <td>unknown</td>
265 265 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
266 266 <td class="age">*</td> (glob)
267 267 <td class="indexlinks"></td>
268 268 <td>
269 269 <a href="/coll/a/.hg/patches/atom-log" title="subscribe to repository atom feed">
270 270 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
271 271 </a>
272 272 </td>
273 273 </tr>
274 274
275 275 <tr>
276 276 <td><a href="/coll/b/?style=paper">coll/b</a></td>
277 277 <td>unknown</td>
278 278 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
279 279 <td class="age">*</td> (glob)
280 280 <td class="indexlinks"></td>
281 281 <td>
282 282 <a href="/coll/b/atom-log" title="subscribe to repository atom feed">
283 283 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
284 284 </a>
285 285 </td>
286 286 </tr>
287 287
288 288 <tr>
289 289 <td><a href="/coll/c/?style=paper">coll/c</a></td>
290 290 <td>unknown</td>
291 291 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
292 292 <td class="age">*</td> (glob)
293 293 <td class="indexlinks"></td>
294 294 <td>
295 295 <a href="/coll/c/atom-log" title="subscribe to repository atom feed">
296 296 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
297 297 </a>
298 298 </td>
299 299 </tr>
300 300
301 301 <tr>
302 302 <td><a href="/coll/notrepo/e/?style=paper">coll/notrepo/e</a></td>
303 303 <td>unknown</td>
304 304 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
305 305 <td class="age">*</td> (glob)
306 306 <td class="indexlinks"></td>
307 307 <td>
308 308 <a href="/coll/notrepo/e/atom-log" title="subscribe to repository atom feed">
309 309 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
310 310 </a>
311 311 </td>
312 312 </tr>
313 313
314 314 <tr>
315 315 <td><a href="/coll/notrepo/f/?style=paper">fancy name for repo f</a></td>
316 316 <td>unknown</td>
317 317 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
318 318 <td class="age">*</td> (glob)
319 319 <td class="indexlinks"></td>
320 320 <td>
321 321 <a href="/coll/notrepo/f/atom-log" title="subscribe to repository atom feed">
322 322 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
323 323 </a>
324 324 </td>
325 325 </tr>
326 326
327 327 <tr>
328 328 <td><a href="/rcoll/a/?style=paper">rcoll/a</a></td>
329 329 <td>unknown</td>
330 330 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
331 331 <td class="age">*</td> (glob)
332 332 <td class="indexlinks"></td>
333 333 <td>
334 334 <a href="/rcoll/a/atom-log" title="subscribe to repository atom feed">
335 335 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
336 336 </a>
337 337 </td>
338 338 </tr>
339 339
340 340 <tr>
341 341 <td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td>
342 342 <td>unknown</td>
343 343 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
344 344 <td class="age">*</td> (glob)
345 345 <td class="indexlinks"></td>
346 346 <td>
347 347 <a href="/rcoll/a/.hg/patches/atom-log" title="subscribe to repository atom feed">
348 348 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
349 349 </a>
350 350 </td>
351 351 </tr>
352 352
353 353 <tr>
354 354 <td><a href="/rcoll/b/?style=paper">rcoll/b</a></td>
355 355 <td>unknown</td>
356 356 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
357 357 <td class="age">*</td> (glob)
358 358 <td class="indexlinks"></td>
359 359 <td>
360 360 <a href="/rcoll/b/atom-log" title="subscribe to repository atom feed">
361 361 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
362 362 </a>
363 363 </td>
364 364 </tr>
365 365
366 366 <tr>
367 367 <td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td>
368 368 <td>unknown</td>
369 369 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
370 370 <td class="age">*</td> (glob)
371 371 <td class="indexlinks"></td>
372 372 <td>
373 373 <a href="/rcoll/b/d/atom-log" title="subscribe to repository atom feed">
374 374 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
375 375 </a>
376 376 </td>
377 377 </tr>
378 378
379 379 <tr>
380 380 <td><a href="/rcoll/c/?style=paper">rcoll/c</a></td>
381 381 <td>unknown</td>
382 382 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
383 383 <td class="age">*</td> (glob)
384 384 <td class="indexlinks"></td>
385 385 <td>
386 386 <a href="/rcoll/c/atom-log" title="subscribe to repository atom feed">
387 387 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
388 388 </a>
389 389 </td>
390 390 </tr>
391 391
392 392 <tr>
393 393 <td><a href="/rcoll/notrepo/e/?style=paper">rcoll/notrepo/e</a></td>
394 394 <td>unknown</td>
395 395 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
396 396 <td class="age">*</td> (glob)
397 397 <td class="indexlinks"></td>
398 398 <td>
399 399 <a href="/rcoll/notrepo/e/atom-log" title="subscribe to repository atom feed">
400 400 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
401 401 </a>
402 402 </td>
403 403 </tr>
404 404
405 405 <tr>
406 406 <td><a href="/rcoll/notrepo/e/e2/?style=paper">rcoll/notrepo/e/e2</a></td>
407 407 <td>unknown</td>
408 408 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
409 409 <td class="age">*</td> (glob)
410 410 <td class="indexlinks"></td>
411 411 <td>
412 412 <a href="/rcoll/notrepo/e/e2/atom-log" title="subscribe to repository atom feed">
413 413 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
414 414 </a>
415 415 </td>
416 416 </tr>
417 417
418 418 <tr>
419 419 <td><a href="/rcoll/notrepo/f/?style=paper">fancy name for repo f</a></td>
420 420 <td>unknown</td>
421 421 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
422 422 <td class="age">*</td> (glob)
423 423 <td class="indexlinks"></td>
424 424 <td>
425 425 <a href="/rcoll/notrepo/f/atom-log" title="subscribe to repository atom feed">
426 426 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
427 427 </a>
428 428 </td>
429 429 </tr>
430 430
431 431 <tr>
432 432 <td><a href="/rcoll/notrepo/f/f2/?style=paper">rcoll/notrepo/f/f2</a></td>
433 433 <td>unknown</td>
434 434 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
435 435 <td class="age">*</td> (glob)
436 436 <td class="indexlinks"></td>
437 437 <td>
438 438 <a href="/rcoll/notrepo/f/f2/atom-log" title="subscribe to repository atom feed">
439 439 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
440 440 </a>
441 441 </td>
442 442 </tr>
443 443
444 444 <tr>
445 445 <td><a href="/star/webdir/a/?style=paper">star/webdir/a</a></td>
446 446 <td>unknown</td>
447 447 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
448 448 <td class="age">*</td> (glob)
449 449 <td class="indexlinks"></td>
450 450 <td>
451 451 <a href="/star/webdir/a/atom-log" title="subscribe to repository atom feed">
452 452 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
453 453 </a>
454 454 </td>
455 455 </tr>
456 456
457 457 <tr>
458 458 <td><a href="/star/webdir/a/.hg/patches/?style=paper">star/webdir/a/.hg/patches</a></td>
459 459 <td>unknown</td>
460 460 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
461 461 <td class="age">*</td> (glob)
462 462 <td class="indexlinks"></td>
463 463 <td>
464 464 <a href="/star/webdir/a/.hg/patches/atom-log" title="subscribe to repository atom feed">
465 465 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
466 466 </a>
467 467 </td>
468 468 </tr>
469 469
470 470 <tr>
471 471 <td><a href="/star/webdir/b/?style=paper">star/webdir/b</a></td>
472 472 <td>unknown</td>
473 473 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
474 474 <td class="age">*</td> (glob)
475 475 <td class="indexlinks"></td>
476 476 <td>
477 477 <a href="/star/webdir/b/atom-log" title="subscribe to repository atom feed">
478 478 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
479 479 </a>
480 480 </td>
481 481 </tr>
482 482
483 483 <tr>
484 484 <td><a href="/star/webdir/c/?style=paper">star/webdir/c</a></td>
485 485 <td>unknown</td>
486 486 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
487 487 <td class="age">*</td> (glob)
488 488 <td class="indexlinks"></td>
489 489 <td>
490 490 <a href="/star/webdir/c/atom-log" title="subscribe to repository atom feed">
491 491 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
492 492 </a>
493 493 </td>
494 494 </tr>
495 495
496 496 <tr>
497 497 <td><a href="/star/webdir/notrepo/e/?style=paper">star/webdir/notrepo/e</a></td>
498 498 <td>unknown</td>
499 499 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
500 500 <td class="age">*</td> (glob)
501 501 <td class="indexlinks"></td>
502 502 <td>
503 503 <a href="/star/webdir/notrepo/e/atom-log" title="subscribe to repository atom feed">
504 504 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
505 505 </a>
506 506 </td>
507 507 </tr>
508 508
509 509 <tr>
510 510 <td><a href="/star/webdir/notrepo/f/?style=paper">fancy name for repo f</a></td>
511 511 <td>unknown</td>
512 512 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
513 513 <td class="age">*</td> (glob)
514 514 <td class="indexlinks"></td>
515 515 <td>
516 516 <a href="/star/webdir/notrepo/f/atom-log" title="subscribe to repository atom feed">
517 517 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
518 518 </a>
519 519 </td>
520 520 </tr>
521 521
522 522 <tr>
523 523 <td><a href="/starstar/webdir/a/?style=paper">starstar/webdir/a</a></td>
524 524 <td>unknown</td>
525 525 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
526 526 <td class="age">*</td> (glob)
527 527 <td class="indexlinks"></td>
528 528 <td>
529 529 <a href="/starstar/webdir/a/atom-log" title="subscribe to repository atom feed">
530 530 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
531 531 </a>
532 532 </td>
533 533 </tr>
534 534
535 535 <tr>
536 536 <td><a href="/starstar/webdir/a/.hg/patches/?style=paper">starstar/webdir/a/.hg/patches</a></td>
537 537 <td>unknown</td>
538 538 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
539 539 <td class="age">*</td> (glob)
540 540 <td class="indexlinks"></td>
541 541 <td>
542 542 <a href="/starstar/webdir/a/.hg/patches/atom-log" title="subscribe to repository atom feed">
543 543 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
544 544 </a>
545 545 </td>
546 546 </tr>
547 547
548 548 <tr>
549 549 <td><a href="/starstar/webdir/b/?style=paper">starstar/webdir/b</a></td>
550 550 <td>unknown</td>
551 551 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
552 552 <td class="age">*</td> (glob)
553 553 <td class="indexlinks"></td>
554 554 <td>
555 555 <a href="/starstar/webdir/b/atom-log" title="subscribe to repository atom feed">
556 556 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
557 557 </a>
558 558 </td>
559 559 </tr>
560 560
561 561 <tr>
562 562 <td><a href="/starstar/webdir/b/d/?style=paper">starstar/webdir/b/d</a></td>
563 563 <td>unknown</td>
564 564 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
565 565 <td class="age">*</td> (glob)
566 566 <td class="indexlinks"></td>
567 567 <td>
568 568 <a href="/starstar/webdir/b/d/atom-log" title="subscribe to repository atom feed">
569 569 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
570 570 </a>
571 571 </td>
572 572 </tr>
573 573
574 574 <tr>
575 575 <td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td>
576 576 <td>unknown</td>
577 577 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
578 578 <td class="age">*</td> (glob)
579 579 <td class="indexlinks"></td>
580 580 <td>
581 581 <a href="/starstar/webdir/c/atom-log" title="subscribe to repository atom feed">
582 582 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
583 583 </a>
584 584 </td>
585 585 </tr>
586 586
587 587 <tr>
588 588 <td><a href="/starstar/webdir/notrepo/e/?style=paper">starstar/webdir/notrepo/e</a></td>
589 589 <td>unknown</td>
590 590 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
591 591 <td class="age">*</td> (glob)
592 592 <td class="indexlinks"></td>
593 593 <td>
594 594 <a href="/starstar/webdir/notrepo/e/atom-log" title="subscribe to repository atom feed">
595 595 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
596 596 </a>
597 597 </td>
598 598 </tr>
599 599
600 600 <tr>
601 601 <td><a href="/starstar/webdir/notrepo/e/e2/?style=paper">starstar/webdir/notrepo/e/e2</a></td>
602 602 <td>unknown</td>
603 603 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
604 604 <td class="age">*</td> (glob)
605 605 <td class="indexlinks"></td>
606 606 <td>
607 607 <a href="/starstar/webdir/notrepo/e/e2/atom-log" title="subscribe to repository atom feed">
608 608 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
609 609 </a>
610 610 </td>
611 611 </tr>
612 612
613 613 <tr>
614 614 <td><a href="/starstar/webdir/notrepo/f/?style=paper">fancy name for repo f</a></td>
615 615 <td>unknown</td>
616 616 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
617 617 <td class="age">*</td> (glob)
618 618 <td class="indexlinks"></td>
619 619 <td>
620 620 <a href="/starstar/webdir/notrepo/f/atom-log" title="subscribe to repository atom feed">
621 621 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
622 622 </a>
623 623 </td>
624 624 </tr>
625 625
626 626 <tr>
627 627 <td><a href="/starstar/webdir/notrepo/f/f2/?style=paper">starstar/webdir/notrepo/f/f2</a></td>
628 628 <td>unknown</td>
629 629 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
630 630 <td class="age">*</td> (glob)
631 631 <td class="indexlinks"></td>
632 632 <td>
633 633 <a href="/starstar/webdir/notrepo/f/f2/atom-log" title="subscribe to repository atom feed">
634 634 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
635 635 </a>
636 636 </td>
637 637 </tr>
638 638
639 639 <tr>
640 640 <td><a href="/astar/?style=paper">astar</a></td>
641 641 <td>unknown</td>
642 642 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
643 643 <td class="age">*</td> (glob)
644 644 <td class="indexlinks"></td>
645 645 <td>
646 646 <a href="/astar/atom-log" title="subscribe to repository atom feed">
647 647 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
648 648 </a>
649 649 </td>
650 650 </tr>
651 651
652 652 <tr>
653 653 <td><a href="/astar/.hg/patches/?style=paper">astar/.hg/patches</a></td>
654 654 <td>unknown</td>
655 655 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
656 656 <td class="age">*</td> (glob)
657 657 <td class="indexlinks"></td>
658 658 <td>
659 659 <a href="/astar/.hg/patches/atom-log" title="subscribe to repository atom feed">
660 660 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
661 661 </a>
662 662 </td>
663 663 </tr>
664 664
665 665 </tbody>
666 666 </table>
667 667 </div>
668 668 </div>
669 669 <script type="text/javascript">process_dates()</script>
670 670
671 671
672 672 </body>
673 673 </html>
674 674
675 675 $ get-with-headers.py localhost:$HGPORT1 't?style=raw'
676 676 200 Script output follows
677 677
678 678
679 679 /t/a/
680 680
681 681 $ get-with-headers.py localhost:$HGPORT1 't/?style=raw'
682 682 200 Script output follows
683 683
684 684
685 685 /t/a/
686 686
687 687 $ get-with-headers.py localhost:$HGPORT1 't/?style=paper'
688 688 200 Script output follows
689 689
690 690 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
691 691 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
692 692 <head>
693 693 <link rel="icon" href="/static/hgicon.png" type="image/png" />
694 694 <meta name="robots" content="index, nofollow" />
695 695 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
696 696 <script type="text/javascript" src="/static/mercurial.js"></script>
697 697
698 698 <title>Mercurial repositories index</title>
699 699 </head>
700 700 <body>
701 701
702 702 <div class="container">
703 703 <div class="menu">
704 704 <a href="http://mercurial.selenic.com/">
705 705 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
706 706 </div>
707 707 <div class="main">
708 708 <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/t">t</a> </h2>
709 709
710 710 <table class="bigtable">
711 711 <thead>
712 712 <tr>
713 713 <th><a href="?sort=name">Name</a></th>
714 714 <th><a href="?sort=description">Description</a></th>
715 715 <th><a href="?sort=contact">Contact</a></th>
716 716 <th><a href="?sort=lastchange">Last modified</a></th>
717 717 <th>&nbsp;</th>
718 718 <th>&nbsp;</th>
719 719 </tr>
720 720 </thead>
721 721 <tbody class="stripes2">
722 722
723 723 <tr>
724 724 <td><a href="/t/a/?style=paper">a</a></td>
725 725 <td>unknown</td>
726 726 <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
727 727 <td class="age">*</td> (glob)
728 728 <td class="indexlinks"></td>
729 729 <td>
730 730 <a href="/t/a/atom-log" title="subscribe to repository atom feed">
731 731 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed">
732 732 </a>
733 733 </td>
734 734 </tr>
735 735
736 736 </tbody>
737 737 </table>
738 738 </div>
739 739 </div>
740 740 <script type="text/javascript">process_dates()</script>
741 741
742 742
743 743 </body>
744 744 </html>
745 745
746 746 $ get-with-headers.py localhost:$HGPORT1 't/a?style=atom'
747 747 200 Script output follows
748 748
749 749 <?xml version="1.0" encoding="ascii"?>
750 750 <feed xmlns="http://www.w3.org/2005/Atom">
751 751 <!-- Changelog -->
752 752 <id>http://*:$HGPORT1/t/a/</id> (glob)
753 753 <link rel="self" href="http://*:$HGPORT1/t/a/atom-log"/> (glob)
754 754 <link rel="alternate" href="http://*:$HGPORT1/t/a/"/> (glob)
755 755 <title>t/a Changelog</title>
756 756 <updated>1970-01-01T00:00:01+00:00</updated>
757 757
758 758 <entry>
759 759 <title>[default] a</title>
760 760 <id>http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob)
761 761 <link href="http://*:$HGPORT1/t/a/rev/8580ff50825a"/> (glob)
762 762 <author>
763 763 <name>test</name>
764 764 <email>&#116;&#101;&#115;&#116;</email>
765 765 </author>
766 766 <updated>1970-01-01T00:00:01+00:00</updated>
767 767 <published>1970-01-01T00:00:01+00:00</published>
768 768 <content type="xhtml">
769 769 <table xmlns="http://www.w3.org/1999/xhtml">
770 770 <tr>
771 771 <th style="text-align:left;">changeset</th>
772 772 <td>8580ff50825a</td>
773 773 </tr>
774 774 <tr>
775 775 <th style="text-align:left;">branch</th>
776 776 <td>default</td>
777 777 </tr>
778 778 <tr>
779 779 <th style="text-align:left;">bookmark</th>
780 780 <td></td>
781 781 </tr>
782 782 <tr>
783 783 <th style="text-align:left;">tag</th>
784 784 <td>tip</td>
785 785 </tr>
786 786 <tr>
787 787 <th style="text-align:left;">user</th>
788 788 <td>&#116;&#101;&#115;&#116;</td>
789 789 </tr>
790 790 <tr>
791 791 <th style="text-align:left;vertical-align:top;">description</th>
792 792 <td>a</td>
793 793 </tr>
794 794 <tr>
795 795 <th style="text-align:left;vertical-align:top;">files</th>
796 796 <td>a<br /></td>
797 797 </tr>
798 798 </table>
799 799 </content>
800 800 </entry>
801 801
802 802 </feed>
803 803 $ get-with-headers.py localhost:$HGPORT1 't/a/?style=atom'
804 804 200 Script output follows
805 805
806 806 <?xml version="1.0" encoding="ascii"?>
807 807 <feed xmlns="http://www.w3.org/2005/Atom">
808 808 <!-- Changelog -->
809 809 <id>http://*:$HGPORT1/t/a/</id> (glob)
810 810 <link rel="self" href="http://*:$HGPORT1/t/a/atom-log"/> (glob)
811 811 <link rel="alternate" href="http://*:$HGPORT1/t/a/"/> (glob)
812 812 <title>t/a Changelog</title>
813 813 <updated>1970-01-01T00:00:01+00:00</updated>
814 814
815 815 <entry>
816 816 <title>[default] a</title>
817 817 <id>http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob)
818 818 <link href="http://*:$HGPORT1/t/a/rev/8580ff50825a"/> (glob)
819 819 <author>
820 820 <name>test</name>
821 821 <email>&#116;&#101;&#115;&#116;</email>
822 822 </author>
823 823 <updated>1970-01-01T00:00:01+00:00</updated>
824 824 <published>1970-01-01T00:00:01+00:00</published>
825 825 <content type="xhtml">
826 826 <table xmlns="http://www.w3.org/1999/xhtml">
827 827 <tr>
828 828 <th style="text-align:left;">changeset</th>
829 829 <td>8580ff50825a</td>
830 830 </tr>
831 831 <tr>
832 832 <th style="text-align:left;">branch</th>
833 833 <td>default</td>
834 834 </tr>
835 835 <tr>
836 836 <th style="text-align:left;">bookmark</th>
837 837 <td></td>
838 838 </tr>
839 839 <tr>
840 840 <th style="text-align:left;">tag</th>
841 841 <td>tip</td>
842 842 </tr>
843 843 <tr>
844 844 <th style="text-align:left;">user</th>
845 845 <td>&#116;&#101;&#115;&#116;</td>
846 846 </tr>
847 847 <tr>
848 848 <th style="text-align:left;vertical-align:top;">description</th>
849 849 <td>a</td>
850 850 </tr>
851 851 <tr>
852 852 <th style="text-align:left;vertical-align:top;">files</th>
853 853 <td>a<br /></td>
854 854 </tr>
855 855 </table>
856 856 </content>
857 857 </entry>
858 858
859 859 </feed>
860 860 $ get-with-headers.py localhost:$HGPORT1 't/a/file/tip/a?style=raw'
861 861 200 Script output follows
862 862
863 863 a
864 864
865 865 Test [paths] '*' extension
866 866
867 867 $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw'
868 868 200 Script output follows
869 869
870 870
871 871 /coll/a/
872 872 /coll/a/.hg/patches/
873 873 /coll/b/
874 874 /coll/c/
875 875 /coll/notrepo/e/
876 876 /coll/notrepo/f/
877 877
878 878 $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
879 879 200 Script output follows
880 880
881 881 a
882 882
883 883 Test [paths] '**' extension
884 884
885 885 $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw'
886 886 200 Script output follows
887 887
888 888
889 889 /rcoll/a/
890 890 /rcoll/a/.hg/patches/
891 891 /rcoll/b/
892 892 /rcoll/b/d/
893 893 /rcoll/c/
894 894 /rcoll/notrepo/e/
895 895 /rcoll/notrepo/e/e2/
896 896 /rcoll/notrepo/f/
897 897 /rcoll/notrepo/f/f2/
898 898
899 899 $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
900 900 200 Script output follows
901 901
902 902 d
903 903
904 904 Test collapse = True
905 905
906 906 $ killdaemons.py
907 907 $ cat >> paths.conf <<EOF
908 908 > [web]
909 909 > collapse=true
910 910 > descend = true
911 911 > EOF
912 912 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
913 913 > -A access-paths.log -E error-paths-3.log
914 914 $ cat hg.pid >> $DAEMON_PIDS
915 915 $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw'
916 916 200 Script output follows
917 917
918 918
919 919 /coll/a/
920 920 /coll/a/.hg/patches/
921 921 /coll/b/
922 922 /coll/c/
923 923 /coll/notrepo/
924 924
925 925 $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
926 926 200 Script output follows
927 927
928 928 a
929 929 $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw'
930 930 200 Script output follows
931 931
932 932
933 933 /rcoll/a/
934 934 /rcoll/a/.hg/patches/
935 935 /rcoll/b/
936 936 /rcoll/b/d/
937 937 /rcoll/c/
938 938 /rcoll/notrepo/
939 939
940 940 $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
941 941 200 Script output follows
942 942
943 943 d
944 944
945 945 Test intermediate directories
946 946
947 947 Hide the subrepo parent
948 948
949 949 $ cp $root/notrepo/f/.hg/hgrc $root/notrepo/f/.hg/hgrc.bak
950 950 $ cat >> $root/notrepo/f/.hg/hgrc << EOF
951 951 > [web]
952 952 > hidden = True
953 953 > EOF
954 954
955 955 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
956 956 200 Script output follows
957 957
958 958
959 959 /rcoll/notrepo/e/
960 960 /rcoll/notrepo/e/e2/
961 961
962 962
963 963 Subrepo parent not hidden
964 964 $ mv $root/notrepo/f/.hg/hgrc.bak $root/notrepo/f/.hg/hgrc
965 965
966 966 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
967 967 200 Script output follows
968 968
969 969
970 970 /rcoll/notrepo/e/
971 971 /rcoll/notrepo/e/e2/
972 972 /rcoll/notrepo/f/
973 973 /rcoll/notrepo/f/f2/
974 974
975 975
976 976 Test repositories inside intermediate directories
977 977
978 978 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw'
979 979 200 Script output follows
980 980
981 981 e
982 982
983 983 Test subrepositories inside intermediate directories
984 984
985 985 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
986 986 200 Script output follows
987 987
988 988 f2
989 989
990 990 Test descend = False
991 991
992 992 $ killdaemons.py
993 993 $ cat >> paths.conf <<EOF
994 994 > descend=false
995 995 > EOF
996 996 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
997 997 > -A access-paths.log -E error-paths-4.log
998 998 $ cat hg.pid >> $DAEMON_PIDS
999 999 $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw'
1000 1000 200 Script output follows
1001 1001
1002 1002
1003 1003 /coll/a/
1004 1004 /coll/b/
1005 1005 /coll/c/
1006 1006
1007 1007 $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
1008 1008 200 Script output follows
1009 1009
1010 1010 a
1011 1011 $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw'
1012 1012 200 Script output follows
1013 1013
1014 1014
1015 1015 /rcoll/a/
1016 1016 /rcoll/b/
1017 1017 /rcoll/c/
1018 1018
1019 1019 $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
1020 1020 200 Script output follows
1021 1021
1022 1022 d
1023 1023
1024 1024 Test intermediate directories
1025 1025
1026 1026 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
1027 1027 200 Script output follows
1028 1028
1029 1029
1030 1030 /rcoll/notrepo/e/
1031 1031 /rcoll/notrepo/f/
1032 1032
1033 1033
1034 1034 Test repositories inside intermediate directories
1035 1035
1036 1036 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw'
1037 1037 200 Script output follows
1038 1038
1039 1039 e
1040 1040
1041 1041 Test subrepositories inside intermediate directories
1042 1042
1043 1043 $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
1044 1044 200 Script output follows
1045 1045
1046 1046 f2
1047 1047
1048 1048 Test [paths] '*' in a repo root
1049 1049
1050 1050 $ hg id http://localhost:$HGPORT1/astar
1051 1051 8580ff50825a
1052 1052
1053 1053 $ killdaemons.py
1054 1054 $ cat > paths.conf <<EOF
1055 1055 > [paths]
1056 1056 > t/a = $root/a
1057 1057 > t/b = $root/b
1058 1058 > c = $root/c
1059 1059 > EOF
1060 1060 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
1061 1061 > -A access-paths.log -E error-paths-5.log
1062 1062 $ cat hg.pid >> $DAEMON_PIDS
1063 1063 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1064 1064 200 Script output follows
1065 1065
1066 1066
1067 1067 /t/a/
1068 1068 /t/b/
1069 1069 /c/
1070 1070
1071 1071 $ get-with-headers.py localhost:$HGPORT1 't/?style=raw'
1072 1072 200 Script output follows
1073 1073
1074 1074
1075 1075 /t/a/
1076 1076 /t/b/
1077 1077
1078 1078
1079 1079 Test collapse = True
1080 1080
1081 1081 $ killdaemons.py
1082 1082 $ cat >> paths.conf <<EOF
1083 1083 > [web]
1084 1084 > collapse=true
1085 1085 > EOF
1086 1086 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
1087 1087 > -A access-paths.log -E error-paths-6.log
1088 1088 $ cat hg.pid >> $DAEMON_PIDS
1089 1089 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1090 1090 200 Script output follows
1091 1091
1092 1092
1093 1093 /t/
1094 1094 /c/
1095 1095
1096 1096 $ get-with-headers.py localhost:$HGPORT1 't/?style=raw'
1097 1097 200 Script output follows
1098 1098
1099 1099
1100 1100 /t/a/
1101 1101 /t/b/
1102 1102
1103 1103
1104 1104 test descend = False
1105 1105
1106 1106 $ killdaemons.py
1107 1107 $ cat >> paths.conf <<EOF
1108 1108 > descend=false
1109 1109 > EOF
1110 1110 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
1111 1111 > -A access-paths.log -E error-paths-7.log
1112 1112 $ cat hg.pid >> $DAEMON_PIDS
1113 1113 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1114 1114 200 Script output follows
1115 1115
1116 1116
1117 1117 /c/
1118 1118
1119 1119 $ get-with-headers.py localhost:$HGPORT1 't/?style=raw'
1120 1120 200 Script output follows
1121 1121
1122 1122
1123 1123 /t/a/
1124 1124 /t/b/
1125 1125
1126 1126 $ killdaemons.py
1127 1127 $ cat > paths.conf <<EOF
1128 1128 > [paths]
1129 1129 > nostore = $root/nostore
1130 1130 > inexistent = $root/inexistent
1131 1131 > EOF
1132 1132 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
1133 1133 > -A access-paths.log -E error-paths-8.log
1134 1134 $ cat hg.pid >> $DAEMON_PIDS
1135 1135
1136 1136 test inexistent and inaccessible repo should be ignored silently
1137 1137
1138 1138 $ get-with-headers.py localhost:$HGPORT1 ''
1139 1139 200 Script output follows
1140 1140
1141 1141 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1142 1142 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1143 1143 <head>
1144 1144 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1145 1145 <meta name="robots" content="index, nofollow" />
1146 1146 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1147 1147 <script type="text/javascript" src="/static/mercurial.js"></script>
1148 1148
1149 1149 <title>Mercurial repositories index</title>
1150 1150 </head>
1151 1151 <body>
1152 1152
1153 1153 <div class="container">
1154 1154 <div class="menu">
1155 1155 <a href="http://mercurial.selenic.com/">
1156 1156 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
1157 1157 </div>
1158 1158 <div class="main">
1159 1159 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1160 1160
1161 1161 <table class="bigtable">
1162 1162 <thead>
1163 1163 <tr>
1164 1164 <th><a href="?sort=name">Name</a></th>
1165 1165 <th><a href="?sort=description">Description</a></th>
1166 1166 <th><a href="?sort=contact">Contact</a></th>
1167 1167 <th><a href="?sort=lastchange">Last modified</a></th>
1168 1168 <th>&nbsp;</th>
1169 1169 <th>&nbsp;</th>
1170 1170 </tr>
1171 1171 </thead>
1172 1172 <tbody class="stripes2">
1173 1173
1174 1174 </tbody>
1175 1175 </table>
1176 1176 </div>
1177 1177 </div>
1178 1178 <script type="text/javascript">process_dates()</script>
1179 1179
1180 1180
1181 1181 </body>
1182 1182 </html>
1183 1183
1184 1184 $ cat > collections.conf <<EOF
1185 1185 > [collections]
1186 1186 > $root=$root
1187 1187 > EOF
1188 1188 $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \
1189 1189 > --pid-file=hg.pid --webdir-conf collections.conf \
1190 1190 > -A access-collections.log -E error-collections.log
1191 1191 $ cat hg.pid >> $DAEMON_PIDS
1192 1192
1193 1193 collections: should succeed
1194 1194
1195 1195 $ get-with-headers.py localhost:$HGPORT2 '?style=raw'
1196 1196 200 Script output follows
1197 1197
1198 1198
1199 1199 /a/
1200 1200 /a/.hg/patches/
1201 1201 /b/
1202 1202 /c/
1203 1203 /notrepo/e/
1204 1204 /notrepo/f/
1205 1205
1206 1206 $ get-with-headers.py localhost:$HGPORT2 'a/file/tip/a?style=raw'
1207 1207 200 Script output follows
1208 1208
1209 1209 a
1210 1210 $ get-with-headers.py localhost:$HGPORT2 'b/file/tip/b?style=raw'
1211 1211 200 Script output follows
1212 1212
1213 1213 b
1214 1214 $ get-with-headers.py localhost:$HGPORT2 'c/file/tip/c?style=raw'
1215 1215 200 Script output follows
1216 1216
1217 1217 c
1218 1218
1219 1219 atom-log with basedir /
1220 1220
1221 1221 $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep '<link'
1222 1222 <link rel="self" href="http://hg.example.com:8080/a/atom-log"/>
1223 1223 <link rel="alternate" href="http://hg.example.com:8080/a/"/>
1224 1224 <link href="http://hg.example.com:8080/a/rev/8580ff50825a"/>
1225 1225
1226 1226 rss-log with basedir /
1227 1227
1228 1228 $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep '<guid'
1229 1229 <guid isPermaLink="true">http://hg.example.com:8080/a/rev/8580ff50825a</guid>
1230 1230 $ killdaemons.py
1231 1231 $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \
1232 1232 > --pid-file=hg.pid --webdir-conf collections.conf \
1233 1233 > -A access-collections-2.log -E error-collections-2.log
1234 1234 $ cat hg.pid >> $DAEMON_PIDS
1235 1235
1236 1236 atom-log with basedir /foo/
1237 1237
1238 1238 $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep '<link'
1239 1239 <link rel="self" href="http://hg.example.com:8080/foo/a/atom-log"/>
1240 1240 <link rel="alternate" href="http://hg.example.com:8080/foo/a/"/>
1241 1241 <link href="http://hg.example.com:8080/foo/a/rev/8580ff50825a"/>
1242 1242
1243 1243 rss-log with basedir /foo/
1244 1244
1245 1245 $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep '<guid'
1246 1246 <guid isPermaLink="true">http://hg.example.com:8080/foo/a/rev/8580ff50825a</guid>
1247 1247
1248 Path refreshing works as expected
1249
1250 $ killdaemons.py
1251 $ mkdir $root/refreshtest
1252 $ hg init $root/refreshtest/a
1253 $ cat > paths.conf << EOF
1254 > [paths]
1255 > / = $root/refreshtest/*
1256 > EOF
1257 $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf
1258 $ cat hg.pid >> $DAEMON_PIDS
1259
1260 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1261 200 Script output follows
1262
1263
1264 /a/
1265
1266
1267 By default refreshing occurs every 20s and a new repo won't be listed
1268 immediately.
1269
1270 $ hg init $root/refreshtest/b
1271 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1272 200 Script output follows
1273
1274
1275 /a/
1276
1277
1278 Restart the server with no refresh interval. New repo should appear
1279 immediately.
1280
1281 $ killdaemons.py
1282 $ cat > paths.conf << EOF
1283 > [web]
1284 > refreshinterval = -1
1285 > [paths]
1286 > / = $root/refreshtest/*
1287 > EOF
1288 $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf
1289 $ cat hg.pid >> $DAEMON_PIDS
1290
1291 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1292 200 Script output follows
1293
1294
1295 /a/
1296 /b/
1297
1298
1299 $ hg init $root/refreshtest/c
1300 $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
1301 200 Script output follows
1302
1303
1304 /a/
1305 /b/
1306 /c/
1307
1308
1248 1309 paths errors 1
1249 1310
1250 1311 $ cat error-paths-1.log
1251 1312
1252 1313 paths errors 2
1253 1314
1254 1315 $ cat error-paths-2.log
1255 1316
1256 1317 paths errors 3
1257 1318
1258 1319 $ cat error-paths-3.log
1259 1320
1260 1321 paths errors 4
1261 1322
1262 1323 $ cat error-paths-4.log
1263 1324
1264 1325 paths errors 5
1265 1326
1266 1327 $ cat error-paths-5.log
1267 1328
1268 1329 paths errors 6
1269 1330
1270 1331 $ cat error-paths-6.log
1271 1332
1272 1333 paths errors 7
1273 1334
1274 1335 $ cat error-paths-7.log
1275 1336
1276 1337 paths errors 8
1277 1338
1278 1339 $ cat error-paths-8.log
1279 1340
1280 1341 collections errors
1281 1342
1282 1343 $ cat error-collections.log
1283 1344
1284 1345 collections errors 2
1285 1346
1286 1347 $ cat error-collections-2.log
General Comments 0
You need to be logged in to leave comments. Login now