1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>keyword</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="keyword">
<span id="ext-keyword"></span>
<h1 class="title">keyword</h1>
<div class="contents htmlonly topic" id="contents">
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p>
<ul class="simple">
<li><a class="reference internal" href="#description" id="toc-entry-1">Description</a></li>
<li><a class="reference internal" href="#commands" id="toc-entry-2">Commands</a><ul>
<li><a class="reference internal" href="#uncategorized-commands" id="toc-entry-3">Uncategorized commands</a></li>
</ul>
</li>
</ul>
</div>
<p>expand keywords in tracked files</p>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>This extension expands RCS/CVS-like or self-customized $Keywords$ in
tracked text files selected by your configuration.</p>
<p>Keywords are only expanded in local repositories and not stored in the
change history. The mechanism can be regarded as a convenience for the
current user or for archive distribution.</p>
<p>Keywords expand to the changeset data pertaining to the latest change
relative to the working directory parent of each file.</p>
<p>Configuration is done in the [keyword], [keywordset] and [keywordmaps]
sections of hgrc files.</p>
<p>Example:</p>
<pre class="literal-block">
[keyword]
# expand keywords in every python file except those matching "x*"
**.py =
x* = ignore
[keywordset]
# prefer svn- over cvs-like default keywordmaps
svn = True
</pre>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The more specific you are in your filename patterns the less you
lose speed in huge repositories.</p>
</div>
<p>For [keywordmaps] template mapping and expansion demonstration and
control run <a class="reference external" href="hg-kwdemo.html"><tt class="docutils literal">hg kwdemo</tt></a>. See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for a list of
available templates and filters.</p>
<p>Three additional date template filters are provided:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">utcdate</tt>:</th><td class="field-body">"2006/09/18 15:13:13"</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">svnutcdate</tt>:</th><td class="field-body">"2006-09-18 15:13:13Z"</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">svnisodate</tt>:</th><td class="field-body">"2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"</td>
</tr>
</tbody>
</table>
<p>The default template mappings (view with <a class="reference external" href="hg-kwdemo.html"><tt class="docutils literal">hg kwdemo <span class="pre">-d</span></tt></a>) can be
replaced with customized keywords and templates. Again, run
<a class="reference external" href="hg-kwdemo.html"><tt class="docutils literal">hg kwdemo</tt></a> to control the results of your configuration changes.</p>
<p>Before changing/disabling active keywords, you must run <a class="reference external" href="hg-kwshrink.html"><tt class="docutils literal">hg kwshrink</tt></a>
to avoid storing expanded keywords in the change history.</p>
<p>To force expansion after enabling it, or a configuration change, run
<a class="reference external" href="hg-kwexpand.html"><tt class="docutils literal">hg kwexpand</tt></a>.</p>
<p>Expansions spanning more than one line and incremental expansions,
like CVS' $Log$, are not supported. A keyword template map "Log =
{desc}" expands to the first line of the changeset description.</p>
</div>
<div class="section" id="commands">
<h1><a class="toc-backref" href="#contents">Commands</a></h1>
<div class="section" id="uncategorized-commands">
<h2><a class="toc-backref" href="#contents">Uncategorized commands</a></h2>
<div class="section" id="kwdemo">
<h3>kwdemo</h3>
<p>print [keywordmaps] configuration and an expansion example:</p>
<pre class="literal-block">
hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
</pre>
<p>Show current, custom, or default keyword template maps and their
expansions.</p>
<p>Extend the current configuration by specifying maps as arguments
and using -f/--rcfile to source an external hgrc file.</p>
<p>Use -d/--default to disable current configuration.</p>
<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for information on templates and filters.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--default</span></kbd></td>
<td>show default keyword template maps</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-f</span>, <span class="option">--rcfile <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>read maps from rcfile</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwexpand">
<h3>kwexpand</h3>
<p>expand keywords in the working directory:</p>
<pre class="literal-block">
hg kwexpand [OPTION]... [FILE]...
</pre>
<p>Run after (re)enabling keyword expansion.</p>
<p>kwexpand refuses to run if given files contain local changes.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>include names matching the given patterns</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
<div class="section" id="kwfiles">
<h3>kwfiles</h3>
<p>show files configured for keyword expansion:</p>
<pre class="literal-block">
hg kwfiles [OPTION]... [FILE]...
</pre>
<p>List which files in the working directory are matched by the
[keyword] configuration patterns.</p>
<p>Useful to prevent inadvertent keyword expansion and to speed up
execution by including only files that are actual candidates for
expansion.</p>
<p>See <a class="reference external" href="ext-keyword.html"><tt class="docutils literal">hg help keyword</tt></a> on how to construct patterns both for
inclusion and exclusion of files.</p>
<p>With -A/--all and -v/--verbose the codes used to show the status
of files are:</p>
<pre class="literal-block">
K = keyword expansion candidate
k = keyword expansion candidate (not tracked)
I = ignored
i = ignored (not tracked)
</pre>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td>
<td>show keyword status flags of all files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--ignore</span></kbd></td>
<td>show files excluded from expansion</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td>
<td>only show unknown (not tracked) files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>include names matching the given patterns</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
<div class="section" id="kwshrink">
<h3>kwshrink</h3>
<p>revert expanded keywords in the working directory:</p>
<pre class="literal-block">
hg kwshrink [OPTION]... [FILE]...
</pre>
<p>Must be run before changing/disabling active keywords.</p>
<p>kwshrink refuses to run if given files contain local changes.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>include names matching the given patterns</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
</div>
</div>
</div>
</body>
</html>
|