Template:Hg

From MozillaWiki
Jump to: navigation, search

{{{1}}}

Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{hg}} creates a link to a revision on Mercurial, with the options to choose repository and add custom text before the link, in the output.

Parameters

There are 3 parameters, all unnamed, of which 1 is required and 2 are optional.

Syntax

The template's syntax is

  • {{hg|revision id|optional Mercurial repository|custom text}}

Required parameter

1

Revision id

To use this template, you need to enter the alphanumeric Mercurial revision id for the revision you wish to link to. The parameter is unnamed, so no parameter name needs to be specified.

Usage
  • {{hg|revision id}}

Optional parameters

2

Mercurial repository

By default, the template will link to the repository mozilla-central. If you want to link to a revision in another Mercurial repository, use this parameter. The parameter is unnamed, so no parameter name needs to be specified.

If specified, the repository will also function as a text string prefixing the revision id in the output. For example, {{hg|revisionid|repository-name}} will output "repository-name revisionidlink", where the link will point to the repository repository-name.

Note
  • This parameter must be placed after the 1st parameter, and before the 3rd parameter (if included).
Usage
  • {{hg|1|Mercurial repository}}

3

Custom text

You can specify a custom text to use for prefixing the revision id in the output (see the example above). To use this parameter, you need to specify the two previous parameters first. The parameter is unnamed, so no parameter name needs to be specified.

Note
  • This parameter must be placed after the 1st and 2nd parameters.
Usage
  • {{hg|1|2|custom text}}

Examples

Correct use

Case What you type What you see
Mercurial revision id 93c3fee6ec69}} 93c3fee6ec69
Mercurial repository ba0c4f045733|comm-central}} comm-central ba0c4f045733
Custom text 93c3fee6ec69|releases/mozilla-release|In the Mozilla release repository, revision}} In the Mozilla release repository, revision 93c3fee6ec69

See also

  • {{c-c}}: links to a revision in the comm-central tree in Mercurial.
  • {{rev}}: links to a revision in a custom repository in Mercurial.
  • {{source}}: links to source code in the mozilla-central Mercurial tree, via the Mozilla France service in Mozilla Cross-Reference (MXR).
  • {{SVN}}: links to a revision in Mozilla's source code browsing website for SVN.