Template:Rev/doc: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Corr.)
(Corr.)
 
(5 intermediate revisions by the same user not shown)
Line 9: Line 9:
===Syntax===
===Syntax===
The template's syntax is
The template's syntax is
* {{tlc|rev|''revision id''|''optional Mercurial repository''}}
* {{tlc|rev|''Mercurial repository'' |''revision id'' }}


===Required parameter===
===Required parameters===
====1====
====1====
;<big>Revision id</big>
;<big>Mercurial repository</big>
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.
The Mercurial repository, in which the revision you want to link to is registered (e.g. <tt>mozilla-central</tt>). The parameter is unnamed, so no parameter name needs to be specified.
 
;<big>Notes</big>
* This parameter must be placed before the 2nd parameter.


;Usage
;<big>Usage</big>
* {{tlc|rev|'''revision id'''}}
* {{tlc|rev|<big>'''1'''</big>|2}}


====2====
====2====
;<big>Mercurial repository</big>
;<big>Revision id</big>
The Mercurial repository, in which the revision you want to link to is registered (e.g. <tt>mozilla-central</tt>). The parameter is unnamed, so no parameter name needs to be specified.
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.


;Note
;<big>Notes</big>
* This parameter must be placed after the 1st parameter.
* This parameter must be placed before the 1st parameter.
* The input for this parameter also functions as the link text.
* The input for this parameter also functions as the link text.


;Usage
;<big>Usage</big>
* {{tlc|rev|1|'''Mercurial repository'''}}
* {{tlc|rev|1|<big>'''2'''</big>}}


==Examples==
==Examples==
Line 36: Line 39:
! Case !! What you type !! What you see
! Case !! What you type !! What you see
|-
|-
| Mercurial repository || {{tlc|rev|ba0c4f045733|comm-central}} || {{rev|ba0c4f045733|comm-central}}
| Mercurial repository || {{tlc|rev|comm-central|ba0c4f045733}} || {{rev|comm-central|ba0c4f045733}}
|}
|}


Line 44: Line 47:
! Case !! What you type !! What you see !! Notes
! Case !! What you type !! What you see !! Notes
|-
|-
| No/empty 2nd parameter || {{tlc|rev|93c3fee6ec69}} || {{rev|93c3fee6ec69}} || Broken link
| No/empty 1st parameter || {{tlc|rev|93c3fee6ec69}} || {{rev|93c3fee6ec69}} || Broken link
|-
| No/empty 2nd parameter || {{tlc|rev|comm-central}} || {{rev|comm-central}} || Broken link
|}
|}


==See also==
==See also==
* {{tl|c-c}}: links to a revision in the <tt>comm-central</tt> tree in Mercurial.
* {{tl|hg}}: links to a revision in the <tt>mozilla-central</tt> tree in Mercurial.
* {{tl|hg}}: links to a revision in the <tt>mozilla-central</tt> tree in Mercurial.
* {{tl|source}}: links to source code in the <tt>mozilla-central</tt> Mercurial tree, via the Mozilla France service in [http://mxr.mozilla.org Mozilla Cross-Reference] (MXR).
* {{tl|source}}: links to source code in the <tt>mozilla-central</tt> Mercurial tree, via the Mozilla France service in [http://mxr.mozilla.org Mozilla Cross-Reference] (MXR).
Line 54: Line 60:
<includeonly>
<includeonly>
<!-- Add categories below -->
<!-- Add categories below -->
[[Category:Mozilla source code templates|hg]]
[[Category:Mozilla source code templates]]
[[Category:Mozilla link templates|hg]]
[[Category:Mozilla link templates]]
</includeonly>
</includeonly>

Latest revision as of 10:12, 15 January 2015

Edit-copy green.svg
This is a documentation subpage for Template:Rev.
It contains usage information, categories and other content that is not part of the original template page.

Usage

{{rev}} creates a link to a revision on Mercurial. It works similar to {{hg}}, but have no default repository to fall back upon.

Parameters

There are 2 parameters, both unnamed and both required.

Syntax

The template's syntax is

  • {{rev|Mercurial repository |revision id }}

Required parameters

1

Mercurial repository

The Mercurial repository, in which the revision you want to link to is registered (e.g. mozilla-central). The parameter is unnamed, so no parameter name needs to be specified.

Notes
  • This parameter must be placed before the 2nd parameter.
Usage
  • {{rev|1|2}}

2

Revision id

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.

Notes
  • This parameter must be placed before the 1st parameter.
  • The input for this parameter also functions as the link text.
Usage
  • {{rev|1|2}}

Examples

Correct use

Case What you type What you see
Mercurial repository {{rev|comm-central|ba0c4f045733}} ba0c4f045733

Incorrect use

Case What you type What you see Notes
No/empty 1st parameter {{rev|93c3fee6ec69}} {{{2}}} Broken link
No/empty 2nd parameter {{rev|comm-central}} {{{2}}} Broken link

See also

  • {{c-c}}: links to a revision in the comm-central tree in Mercurial.
  • {{hg}}: links to a revision in the mozilla-central tree 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.