| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" /> |
| 7 |
<title>hg cat</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="hg-cat"> |
| 12 |
<span id="hg-cat-1"></span> |
| 13 |
<h1 class="title">hg cat</h1> |
| 14 |
<h2 class="subtitle" id="output-the-current-or-given-revision-of-files">output the current or given revision of files</h2> |
| 15 |
|
| 16 |
<div class="contents htmlonly topic" id="contents"> |
| 17 |
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p> |
| 18 |
<ul class="simple"> |
| 19 |
<li><a class="reference internal" href="#synopsis" id="toc-entry-1">Synopsis</a></li> |
| 20 |
<li><a class="reference internal" href="#description" id="toc-entry-2">Description</a></li> |
| 21 |
<li><a class="reference internal" href="#options" id="toc-entry-3">Options</a></li> |
| 22 |
</ul> |
| 23 |
</div> |
| 24 |
<div class="section" id="synopsis"> |
| 25 |
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1> |
| 26 |
<pre class="literal-block"> |
| 27 |
hg cat [OPTION]... FILE... |
| 28 |
</pre> |
| 29 |
</div> |
| 30 |
<div class="section" id="description"> |
| 31 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 32 |
<p>Print the specified files as they were at the given revision. If |
| 33 |
no revision is given, the parent of the working directory is used.</p> |
| 34 |
<p>Output may be to a file, in which case the name of the file is |
| 35 |
given using a template string. See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a>. In addition |
| 36 |
to the common template keywords, the following formatting rules are |
| 37 |
supported:</p> |
| 38 |
<table class="docutils field-list" frame="void" rules="none"> |
| 39 |
<col class="field-name" /> |
| 40 |
<col class="field-body" /> |
| 41 |
<tbody valign="top"> |
| 42 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%%</tt>:</th><td class="field-body">literal "%" character</td> |
| 43 |
</tr> |
| 44 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%s</tt>:</th><td class="field-body">basename of file being printed</td> |
| 45 |
</tr> |
| 46 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%d</tt>:</th><td class="field-body">dirname of file being printed, or '.' if in repository root</td> |
| 47 |
</tr> |
| 48 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%p</tt>:</th><td class="field-body">root-relative path name of file being printed</td> |
| 49 |
</tr> |
| 50 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%H</tt>:</th><td class="field-body">changeset hash (40 hexadecimal digits)</td> |
| 51 |
</tr> |
| 52 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%R</tt>:</th><td class="field-body">changeset revision number</td> |
| 53 |
</tr> |
| 54 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%h</tt>:</th><td class="field-body">short-form changeset hash (12 hexadecimal digits)</td> |
| 55 |
</tr> |
| 56 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%r</tt>:</th><td class="field-body">zero-padded changeset revision number</td> |
| 57 |
</tr> |
| 58 |
<tr class="field"><th class="field-name"><tt class="docutils literal">%b</tt>:</th><td class="field-body">basename of the exporting repository</td> |
| 59 |
</tr> |
| 60 |
<tr class="field"><th class="field-name"><tt class="docutils literal">\</tt>:</th><td class="field-body">literal "" character</td> |
| 61 |
</tr> |
| 62 |
</tbody> |
| 63 |
</table> |
| 64 |
<div class="verbose docutils container"> |
| 65 |
<p>Template:</p> |
| 66 |
<p>The following keywords are supported in addition to the common template |
| 67 |
keywords and functions. See also <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a>.</p> |
| 68 |
<table class="docutils field-list" frame="void" rules="none"> |
| 69 |
<col class="field-name" /> |
| 70 |
<col class="field-body" /> |
| 71 |
<tbody valign="top"> |
| 72 |
<tr class="field"><th class="field-name">data:</th><td class="field-body">String. File content.</td> |
| 73 |
</tr> |
| 74 |
<tr class="field"><th class="field-name">path:</th><td class="field-body">String. Repository-absolute path of the file.</td> |
| 75 |
</tr> |
| 76 |
</tbody> |
| 77 |
</table> |
| 78 |
</div> |
| 79 |
<p>Returns 0 on success.</p> |
| 80 |
</div> |
| 81 |
<div class="section" id="options"> |
| 82 |
<h1><a class="toc-backref" href="#contents">Options</a></h1> |
| 83 |
<table class="docutils option-list" frame="void" rules="none"> |
| 84 |
<col class="option" /> |
| 85 |
<col class="description" /> |
| 86 |
<tbody valign="top"> |
| 87 |
<tr><td class="option-group" colspan="2"> |
| 88 |
<kbd><span class="option">-o</span>, <span class="option">--output <var><FORMAT></var></span></kbd></td> |
| 89 |
</tr> |
| 90 |
<tr><td> </td><td>print output to file with formatted name</td></tr> |
| 91 |
<tr><td class="option-group" colspan="2"> |
| 92 |
<kbd><span class="option">-r</span>, <span class="option">--rev <var><REV></var></span></kbd></td> |
| 93 |
</tr> |
| 94 |
<tr><td> </td><td>print the given revision</td></tr> |
| 95 |
<tr><td class="option-group"> |
| 96 |
<kbd><span class="option">--decode</span></kbd></td> |
| 97 |
<td>apply any matching decode filter</td></tr> |
| 98 |
<tr><td class="option-group" colspan="2"> |
| 99 |
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td> |
| 100 |
</tr> |
| 101 |
<tr><td> </td><td>include names matching the given patterns</td></tr> |
| 102 |
<tr><td class="option-group" colspan="2"> |
| 103 |
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td> |
| 104 |
</tr> |
| 105 |
<tr><td> </td><td>exclude names matching the given patterns</td></tr> |
| 106 |
<tr><td class="option-group" colspan="2"> |
| 107 |
<kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td> |
| 108 |
</tr> |
| 109 |
<tr><td> </td><td>display with template</td></tr> |
| 110 |
</tbody> |
| 111 |
</table> |
| 112 |
<p>[+] marked option can be specified multiple times</p> |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
</body> |
| 116 |
</html> |