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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
<?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>hg log</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="hg-log">
<span id="hg-log-1"></span>
<h1 class="title">hg log</h1>
<h2 class="subtitle" id="show-revision-history-of-entire-repository-or-files">show revision history of entire repository or files</h2>
<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="#synopsis" id="toc-entry-1">Synopsis</a></li>
<li><a class="reference internal" href="#description" id="toc-entry-2">Description</a></li>
<li><a class="reference internal" href="#options" id="toc-entry-3">Options</a></li>
<li><a class="reference internal" href="#aliases" id="toc-entry-4">Aliases</a></li>
</ul>
</div>
<div class="section" id="synopsis">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<pre class="literal-block">
hg log [OPTION]... [FILE]
</pre>
</div>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>Print the revision history of the specified files or the entire
project.</p>
<p>If no revision range is specified, the default is <tt class="docutils literal">tip:0</tt> unless
--follow is set.</p>
<p>File history is shown without following rename or copy history of
files. Use -f/--follow with a filename to follow history across
renames and copies. --follow without a filename will only show
ancestors of the starting revisions. The starting revisions can be
specified by -r/--rev, which default to the working directory parent.</p>
<p>By default this command prints revision number and changeset id,
tags, non-trivial parents, user, date and time, and a summary for
each commit. When the -v/--verbose switch is used, the list of
changed files and full commit message are shown.</p>
<p>With --graph the revisions are shown as an ASCII art DAG with the most
recent changeset at the top.
'o' is a changeset, '@' is a working directory parent, '%' is a changeset
involved in an unresolved merge conflict, '_' closes a branch,
'x' is obsolete, '*' is unstable, and '+' represents a fork where the
changeset from the lines below is a parent of the 'o' merge on the same
line.
Paths in the DAG are represented with '|', '/' and so forth. ':' in place
of a '|' indicates one or more revisions in a path are omitted.</p>
<div class="verbose docutils container">
Use -L/--line-range FILE,M:N options to follow the history of lines
from M to N in FILE. With -p/--patch only diff hunks affecting
specified line range will be shown. This option requires --follow;
it can be specified multiple times. Currently, this option is not
compatible with --graph. This option is experimental.</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference external" href="hg-log.html"><tt class="docutils literal">hg log <span class="pre">--patch</span></tt></a> may generate unexpected diff output for merge
changesets, as it will only compare the merge changeset against
its first parent. Also, only files different from BOTH parents
will appear in files:.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For performance reasons, <a class="reference external" href="hg-log.html"><tt class="docutils literal">hg log FILE</tt></a> may omit duplicate changes
made on branches and will not show removals or mode changes. To
see all such changes, use the --removed switch.</p>
</div>
<div class="verbose docutils container">
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The history resulting from -L/--line-range options depends on diff
options; for instance if white-spaces are ignored, respective changes
with only white-spaces in specified line range will not be listed.</p>
</div>
</div>
<div class="verbose docutils container">
<p>Some examples:</p>
<ul>
<li><p class="first">changesets with full descriptions and file lists:</p>
<pre class="literal-block">
hg log -v
</pre>
</li>
<li><p class="first">changesets ancestral to the working directory:</p>
<pre class="literal-block">
hg log -f
</pre>
</li>
<li><p class="first">last 10 commits on the current branch:</p>
<pre class="literal-block">
hg log -l 10 -b .
</pre>
</li>
<li><p class="first">changesets showing all modifications of a file, including removals:</p>
<pre class="literal-block">
hg log --removed file.c
</pre>
</li>
<li><p class="first">all changesets that touch a directory, with diffs, excluding merges:</p>
<pre class="literal-block">
hg log -Mp lib/
</pre>
</li>
<li><p class="first">all revision numbers that match a keyword:</p>
<pre class="literal-block">
hg log -k bug --template "{rev}\n"
</pre>
</li>
<li><p class="first">the full hash identifier of the working directory parent:</p>
<pre class="literal-block">
hg log -r . --template "{node}\n"
</pre>
</li>
<li><p class="first">list available log templates:</p>
<pre class="literal-block">
hg log -T list
</pre>
</li>
<li><p class="first">check if a given changeset is included in a tagged release:</p>
<pre class="literal-block">
hg log -r "a21ccf and ancestor(1.9)"
</pre>
</li>
<li><p class="first">find all changesets by some user in a date range:</p>
<pre class="literal-block">
hg log -k alice -d "may 2008 to jul 2008"
</pre>
</li>
<li><p class="first">summary of all changesets after the last tag:</p>
<pre class="literal-block">
hg log -r "last(tagged())::" --template "{desc|firstline}\n"
</pre>
</li>
<li><p class="first">changesets touching lines 13 to 23 for file.c:</p>
<pre class="literal-block">
hg log -L file.c,13:23
</pre>
</li>
<li><p class="first">changesets touching lines 13 to 23 for file.c and lines 2 to 6 of
main.c with patch:</p>
<pre class="literal-block">
hg log -L file.c,13:23 -L main.c,2:6 -p
</pre>
</li>
</ul>
</div>
<p>See <a class="reference external" href="topic-dates.html"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>See <a class="reference external" href="topic-revisions.html"><tt class="docutils literal">hg help revisions</tt></a> for more about specifying and ordering
revisions.</p>
<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for more about pre-packaged styles and
specifying custom templates. The default template used by the log
command can be customized via the <tt class="docutils literal"><span class="pre">command-templates.log</span></tt> configuration
setting.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="options">
<h1><a class="toc-backref" href="#contents">Options</a></h1>
<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">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow-first</span></kbd></td>
<td>only follow the first parent of merge changesets (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
</tr>
<tr><td> </td><td>show revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show copied files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-k</span>, <span class="option">--keyword <var><TEXT[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>do case-insensitive search for a given text</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>revisions to select or follow from</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-L</span>, <span class="option">--line-range <var><FILE,RANGE[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>follow line range of specified file (EXPERIMENTAL)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--removed</span></kbd></td>
<td>include revisions where files were removed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td>
</tr>
<tr><td> </td><td>show only merges (DEPRECATED) (use -r "merge()" instead)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--user <var><USER[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>revisions committed by user</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--only-branch <var><BRANCH[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>show only changesets within the given named branch (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>show changesets within the given named branch</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--bookmark <var><BOOKMARK[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>show changesets within the given bookmark</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-P</span>, <span class="option">--prune <var><REV[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>do not display revision or any of its ancestors</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--limit <var><NUM></var></span></kbd></td>
</tr>
<tr><td> </td><td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td>
<td>show the revision DAG</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--style <var><STYLE></var></span></kbd></td>
</tr>
<tr><td> </td><td>display using template map file (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-T</span>, <span class="option">--template <var><TEMPLATE></var></span></kbd></td>
</tr>
<tr><td> </td><td>display with template</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="aliases">
<h1><a class="toc-backref" href="#contents">Aliases</a></h1>
<pre class="literal-block">
history
</pre>
</div>
</div>
</body>
</html>
|