Repositories and Relevant Files¶
Most code for hg.mozilla.org and related services can be found in the version-control-tools repo. In this repo, the following directories are relevant:
- Ansible role for the hg.mozilla.org SSH/master servers.
- Shared Ansible role for Mercurial SSH servers.
- Ansible role for the hg.mozilla.org HTTP/mirror servers.
- Sphinx documentation related to hg.mozilla.org (you are reading this now).
- Various Mercurial extensions. Many of which are used on hg.mozilla.org.
- Contains hodgepodge of Mercurial customizations specific to hg.mozilla.org.
- Mercurial hooks that run (primarily) on hg.mozilla.org.
- Mercurial code and tests specific to Mercurial servers.
- Mercurial templates. Contains both upstream templates and Mozilla customizations.
- Fork of the
gitwebMercurial web style with Mozilla customizations. If you want to hack the theming on hg.mozilla.org, this is what you modify.
- WSGI and Mercurial config files for repos on hg.mozilla.org.
- 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
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
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
that activates hg.mozilla.org mode. This will activate some other
extensions and configure the style settings to run out of the
Styles for Mercurial are checked into the
in version-control-tools. The default style for Mercurial is
However, hg.mozilla.org runs the
gitweb_mozilla theme. This theme is
based off of the
hgtemplates/gitweb_mozilla/map file is the main file mapping
template names to their values. Some templates are large and split into
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.