Online Book Reader

Home Category

Mercurial_ The Definitive Guide - Bryan O'Sullivan [50]

By Root 1023 0
the following form.

[paths]

repo1 = /my/path/to/some/repo

repo2 = /some/path/to/another

In this case, the virtual path (the component that will appear in a URL) is on the left-hand side of each definition, while the path to the repository is on the right. Notice that there does not need to be any relationship between the virtual path you choose and the location of a repository in your filesystem.

If you wish, you can use both the collections and paths mechanisms simultaneously in a single configuration file.

* * *

Beware duplicate virtual paths


If several repositories have the same virtual path, hgwebdir.cgi will not report an error. Instead, it will behave unpredictably.

* * *

Downloading Source Archives

Mercurial’s web interface lets users download an archive of any revision. This archive will contain a snapshot of the working directory as of that revision, but it will not contain a copy of the repository data.

By default, this feature is not enabled. To enable it, you’ll need to add an allow_archive item to the web section of your ~/.hgrc; see below for details.

Web Configuration Options

Mercurial’s web interfaces (the hg serve command, and the hgweb.cgi and hgwebdir.cgi scripts) have a number of configuration options that you can set. These belong in a section named web.

allow_archive: Determines which (if any) archive download mechanisms Mercurial supports. If you enable this feature, users of the web interface will be able to download an archive of whatever revision of a repository they are viewing. To enable the archive feature, this item must take the form of a sequence of words drawn from the following list: bz2: A tar archive, compressed using bzip2 compression. This has the best compression ratio, but uses the most CPU time on the server.

gz: A tar archive, compressed using gzip compression.

zip: A zip archive, compressed using LZW compression. This format has the worst compression ratio, but is widely used in the Windows world.

If you provide an empty list, or don’t have an allow_archive entry at all, this feature will be disabled. Here is an example of how to enable all three supported formats.[web]

allow_archive = bz2 gz zip

allowpull: Boolean. Determines whether the web interface allows remote users to hg pull and hg clone this repository over HTTP. If set to no or false, only the “human-oriented” portion of the web interface is available.

contact: String. A free-form (but preferably brief) string identifying the person or group in charge of the repository. This often contains the name and email address of a person or mailing list. It often makes sense to place this entry in a repository’s own .hg/hgrc file, but it can make sense to use in a global ~/.hgrc if every repository has a single maintainer.

maxchanges: Integer. The default maximum number of changesets to display in a single page of output.

maxfiles: Integer. The default maximum number of modified files to display in a single page of output.

stripes: Integer. If the web interface displays alternating “stripes” to make it easier to visually align rows when you are looking at a table, this number controls the number of rows in each stripe.

style: Controls the template Mercurial uses to display the web interface. Mercurial ships with several web templates: coal is monochromatic.

gitweb emulates the visual style of Git’s web interface.

monoblue uses solid blues and grays.

paper is the default.

spartan was the default for a long time.

You can also specify a custom template of your own; see Chapter 11 for details. Here, you can see how to enable the gitweb style.[web]

style = gitweb

templates: Path. The directory in which to search for template files. By default, Mercurial searches in the directory in which it was installed.

If you are using hgwebdir.cgi, you can place a few configuration items in a web section of the hgweb.config file instead of a ~/.hgrc file, for convenience. These items are motd and style.

Options specific to an individual repository

A few web

Return Main Page Previous Page Next Page

®Online Book Reader