Debian Codegraph @

doc/html/hg-log.html

raw
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 log</title>
8 <link rel="stylesheet" href="../style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="hg-log">
12 <span id="hg-log-1"></span>
13 <h1 class="title">hg log</h1>
14 <h2 class="subtitle" id="show-revision-history-of-entire-repository-or-files">show revision history of entire repository or 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 <li><a class="reference internal" href="#aliases" id="toc-entry-4">Aliases</a></li>
23 </ul>
24 </div>
25 <div class="section" id="synopsis">
26 <h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
27 <pre class="literal-block">
28 hg log [OPTION]... [FILE]
29 </pre>
30 </div>
31 <div class="section" id="description">
32 <h1><a class="toc-backref" href="#contents">Description</a></h1>
33 <p>Print the revision history of the specified files or the entire
34 project.</p>
35 <p>If no revision range is specified, the default is <tt class="docutils literal">tip:0</tt> unless
36 --follow is set.</p>
37 <p>File history is shown without following rename or copy history of
38 files. Use -f/--follow with a filename to follow history across
39 renames and copies. --follow without a filename will only show
40 ancestors of the starting revisions. The starting revisions can be
41 specified by -r/--rev, which default to the working directory parent.</p>
42 <p>By default this command prints revision number and changeset id,
43 tags, non-trivial parents, user, date and time, and a summary for
44 each commit. When the -v/--verbose switch is used, the list of
45 changed files and full commit message are shown.</p>
46 <p>With --graph the revisions are shown as an ASCII art DAG with the most
47 recent changeset at the top.
48 'o' is a changeset, '&#64;' is a working directory parent, '%' is a changeset
49 involved in an unresolved merge conflict, '_' closes a branch,
50 'x' is obsolete, '*' is unstable, and '+' represents a fork where the
51 changeset from the lines below is a parent of the 'o' merge on the same
52 line.
53 Paths in the DAG are represented with '|', '/' and so forth. ':' in place
54 of a '|' indicates one or more revisions in a path are omitted.</p>
55 <div class="verbose docutils container">
56 Use -L/--line-range FILE,M:N options to follow the history of lines
57 from M to N in FILE. With -p/--patch only diff hunks affecting
58 specified line range will be shown. This option requires --follow;
59 it can be specified multiple times. Currently, this option is not
60 compatible with --graph. This option is experimental.</div>
61 <div class="admonition note">
62 <p class="first admonition-title">Note</p>
63 <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
64 changesets, as it will only compare the merge changeset against
65 its first parent. Also, only files different from BOTH parents
66 will appear in files:.</p>
67 </div>
68 <div class="admonition note">
69 <p class="first admonition-title">Note</p>
70 <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
71 made on branches and will not show removals or mode changes. To
72 see all such changes, use the --removed switch.</p>
73 </div>
74 <div class="verbose docutils container">
75 <div class="admonition note">
76 <p class="first admonition-title">Note</p>
77 <p class="last">The history resulting from -L/--line-range options depends on diff
78 options; for instance if white-spaces are ignored, respective changes
79 with only white-spaces in specified line range will not be listed.</p>
80 </div>
81 </div>
82 <div class="verbose docutils container">
83 <p>Some examples:</p>
84 <ul>
85 <li><p class="first">changesets with full descriptions and file lists:</p>
86 <pre class="literal-block">
87 hg log -v
88 </pre>
89 </li>
90 <li><p class="first">changesets ancestral to the working directory:</p>
91 <pre class="literal-block">
92 hg log -f
93 </pre>
94 </li>
95 <li><p class="first">last 10 commits on the current branch:</p>
96 <pre class="literal-block">
97 hg log -l 10 -b .
98 </pre>
99 </li>
100 <li><p class="first">changesets showing all modifications of a file, including removals:</p>
101 <pre class="literal-block">
102 hg log --removed file.c
103 </pre>
104 </li>
105 <li><p class="first">all changesets that touch a directory, with diffs, excluding merges:</p>
106 <pre class="literal-block">
107 hg log -Mp lib/
108 </pre>
109 </li>
110 <li><p class="first">all revision numbers that match a keyword:</p>
111 <pre class="literal-block">
112 hg log -k bug --template &quot;{rev}\n&quot;
113 </pre>
114 </li>
115 <li><p class="first">the full hash identifier of the working directory parent:</p>
116 <pre class="literal-block">
117 hg log -r . --template &quot;{node}\n&quot;
118 </pre>
119 </li>
120 <li><p class="first">list available log templates:</p>
121 <pre class="literal-block">
122 hg log -T list
123 </pre>
124 </li>
125 <li><p class="first">check if a given changeset is included in a tagged release:</p>
126 <pre class="literal-block">
127 hg log -r &quot;a21ccf and ancestor(1.9)&quot;
128 </pre>
129 </li>
130 <li><p class="first">find all changesets by some user in a date range:</p>
131 <pre class="literal-block">
132 hg log -k alice -d &quot;may 2008 to jul 2008&quot;
133 </pre>
134 </li>
135 <li><p class="first">summary of all changesets after the last tag:</p>
136 <pre class="literal-block">
137 hg log -r &quot;last(tagged())::&quot; --template &quot;{desc|firstline}\n&quot;
138 </pre>
139 </li>
140 <li><p class="first">changesets touching lines 13 to 23 for file.c:</p>
141 <pre class="literal-block">
142 hg log -L file.c,13:23
143 </pre>
144 </li>
145 <li><p class="first">changesets touching lines 13 to 23 for file.c and lines 2 to 6 of
146 main.c with patch:</p>
147 <pre class="literal-block">
148 hg log -L file.c,13:23 -L main.c,2:6 -p
149 </pre>
150 </li>
151 </ul>
152 </div>
153 <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>
154 <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
155 revisions.</p>
156 <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
157 specifying custom templates. The default template used by the log
158 command can be customized via the <tt class="docutils literal"><span class="pre">command-templates.log</span></tt> configuration
159 setting.</p>
160 <p>Returns 0 on success.</p>
161 </div>
162 <div class="section" id="options">
163 <h1><a class="toc-backref" href="#contents">Options</a></h1>
164 <table class="docutils option-list" frame="void" rules="none">
165 <col class="option" />
166 <col class="description" />
167 <tbody valign="top">
168 <tr><td class="option-group">
169 <kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
170 <td>follow changeset history, or file history across copies and renames</td></tr>
171 <tr><td class="option-group">
172 <kbd><span class="option">--follow-first</span></kbd></td>
173 <td>only follow the first parent of merge changesets (DEPRECATED)</td></tr>
174 <tr><td class="option-group" colspan="2">
175 <kbd><span class="option">-d</span>, <span class="option">--date <var>&lt;DATE&gt;</var></span></kbd></td>
176 </tr>
177 <tr><td>&nbsp;</td><td>show revisions matching date spec</td></tr>
178 <tr><td class="option-group">
179 <kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
180 <td>show copied files</td></tr>
181 <tr><td class="option-group" colspan="2">
182 <kbd><span class="option">-k</span>, <span class="option">--keyword <var>&lt;TEXT[+]&gt;</var></span></kbd></td>
183 </tr>
184 <tr><td>&nbsp;</td><td>do case-insensitive search for a given text</td></tr>
185 <tr><td class="option-group" colspan="2">
186 <kbd><span class="option">-r</span>, <span class="option">--rev <var>&lt;REV[+]&gt;</var></span></kbd></td>
187 </tr>
188 <tr><td>&nbsp;</td><td>revisions to select or follow from</td></tr>
189 <tr><td class="option-group" colspan="2">
190 <kbd><span class="option">-L</span>, <span class="option">--line-range <var>&lt;FILE,RANGE[+]&gt;</var></span></kbd></td>
191 </tr>
192 <tr><td>&nbsp;</td><td>follow line range of specified file (EXPERIMENTAL)</td></tr>
193 <tr><td class="option-group">
194 <kbd><span class="option">--removed</span></kbd></td>
195 <td>include revisions where files were removed</td></tr>
196 <tr><td class="option-group" colspan="2">
197 <kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td>
198 </tr>
199 <tr><td>&nbsp;</td><td>show only merges (DEPRECATED) (use -r &quot;merge()&quot; instead)</td></tr>
200 <tr><td class="option-group" colspan="2">
201 <kbd><span class="option">-u</span>, <span class="option">--user <var>&lt;USER[+]&gt;</var></span></kbd></td>
202 </tr>
203 <tr><td>&nbsp;</td><td>revisions committed by user</td></tr>
204 <tr><td class="option-group" colspan="2">
205 <kbd><span class="option">--only-branch <var>&lt;BRANCH[+]&gt;</var></span></kbd></td>
206 </tr>
207 <tr><td>&nbsp;</td><td>show only changesets within the given named branch (DEPRECATED)</td></tr>
208 <tr><td class="option-group" colspan="2">
209 <kbd><span class="option">-b</span>, <span class="option">--branch <var>&lt;BRANCH[+]&gt;</var></span></kbd></td>
210 </tr>
211 <tr><td>&nbsp;</td><td>show changesets within the given named branch</td></tr>
212 <tr><td class="option-group" colspan="2">
213 <kbd><span class="option">-B</span>, <span class="option">--bookmark <var>&lt;BOOKMARK[+]&gt;</var></span></kbd></td>
214 </tr>
215 <tr><td>&nbsp;</td><td>show changesets within the given bookmark</td></tr>
216 <tr><td class="option-group" colspan="2">
217 <kbd><span class="option">-P</span>, <span class="option">--prune <var>&lt;REV[+]&gt;</var></span></kbd></td>
218 </tr>
219 <tr><td>&nbsp;</td><td>do not display revision or any of its ancestors</td></tr>
220 <tr><td class="option-group">
221 <kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
222 <td>show patch</td></tr>
223 <tr><td class="option-group">
224 <kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
225 <td>use git extended diff format</td></tr>
226 <tr><td class="option-group" colspan="2">
227 <kbd><span class="option">-l</span>, <span class="option">--limit <var>&lt;NUM&gt;</var></span></kbd></td>
228 </tr>
229 <tr><td>&nbsp;</td><td>limit number of changes displayed</td></tr>
230 <tr><td class="option-group" colspan="2">
231 <kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
232 </tr>
233 <tr><td>&nbsp;</td><td>do not show merges</td></tr>
234 <tr><td class="option-group">
235 <kbd><span class="option">--stat</span></kbd></td>
236 <td>output diffstat-style summary of changes</td></tr>
237 <tr><td class="option-group">
238 <kbd><span class="option">-G</span>, <span class="option">--graph</span></kbd></td>
239 <td>show the revision DAG</td></tr>
240 <tr><td class="option-group" colspan="2">
241 <kbd><span class="option">--style <var>&lt;STYLE&gt;</var></span></kbd></td>
242 </tr>
243 <tr><td>&nbsp;</td><td>display using template map file (DEPRECATED)</td></tr>
244 <tr><td class="option-group" colspan="2">
245 <kbd><span class="option">-T</span>, <span class="option">--template <var>&lt;TEMPLATE&gt;</var></span></kbd></td>
246 </tr>
247 <tr><td>&nbsp;</td><td>display with template</td></tr>
248 <tr><td class="option-group" colspan="2">
249 <kbd><span class="option">-I</span>, <span class="option">--include <var>&lt;PATTERN[+]&gt;</var></span></kbd></td>
250 </tr>
251 <tr><td>&nbsp;</td><td>include names matching the given patterns</td></tr>
252 <tr><td class="option-group" colspan="2">
253 <kbd><span class="option">-X</span>, <span class="option">--exclude <var>&lt;PATTERN[+]&gt;</var></span></kbd></td>
254 </tr>
255 <tr><td>&nbsp;</td><td>exclude names matching the given patterns</td></tr>
256 </tbody>
257 </table>
258 <p>[+] marked option can be specified multiple times</p>
259 </div>
260 <div class="section" id="aliases">
261 <h1><a class="toc-backref" href="#contents">Aliases</a></h1>
262 <pre class="literal-block">
263 history
264 </pre>
265 </div>
266 </div>
267 </body>
268 </html>