Repositories and Relevant Files

Most code for and related services can be found in the version-control-tools repo. In this repo, the following directories are relevant:

Ansible role for the SSH/master servers.
Shared Ansible role for Mercurial SSH servers.
Ansible role for the HTTP/mirror servers.
Sphinx documentation related to (you are reading this now).
Various Mercurial extensions. Many of which are used on
Contains hodgepodge of Mercurial customizations specific to
Mercurial hooks that run (primarily) on
Mercurial code and tests specific to Mercurial servers.
Mercurial templates. Contains both upstream templates and Mozilla customizations.
Fork of the gitweb Mercurial web style with Mozilla customizations. If you want to hack the theming on, this is what you modify.
WSGI and Mercurial config files for repos on
Python package containing utility code for things like defining names and URLs of common repos, parsing commit messages, etc.
Python package containing shared Mercurial code (code using Mercurial APIs and therefore covered by the GPL).
Code for managing replication of data from Mercurial master server to read-only mirrors.

Terraform code for managing associated AWS infrastructure can be found in the devservices-aws repo under the hgmo directory.

Hacking the Theming

The version-control-tools repository contains all the files necessary to run a local hgweb server that behaves close enough to the actual server to facilitate hacking on the theming (the visual layout of the site).

To run a local server, run the following:

$ hg --config extensions.hgmo=/path/to/vct/hgext/hgmo serve --hgmo

Among other things, the hgmo extension adds a flag to hg serve that activates mode. This will activate some other extensions and configure the style settings to run out of the version-control-tools repository.

Styles for Mercurial are checked into the hgtemplates/ directory in version-control-tools. The default style for Mercurial is paper. However, runs the gitweb_mozilla theme. This theme is based off of the gitweb theme.

The hgtemplates/gitweb_mozilla/map file is the main file mapping template names to their values. Some templates are large and split into their own .tmpl file.


To figure out what templates are used for various URLs, read hg help hgweb.


If you modify a template file, changes should be visible on next page load: no server restart is necessary. However, some pages are cached, so you may need to force reload the page in your browser via shift-reload or similar.