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
|
<?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 bisect</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="hg-bisect">
<span id="hg-bisect-1"></span>
<h1 class="title">hg bisect</h1>
<h2 class="subtitle" id="subdivision-search-of-changesets">subdivision search of changesets</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>
</ul>
</div>
<div class="section" id="synopsis">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<pre class="literal-block">
hg bisect [-gbsr] [-U] [-c CMD] [REV]
</pre>
</div>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>This command helps to find changesets which introduce problems. To
use, mark the earliest changeset you know exhibits the problem as
bad, then mark the latest changeset which is free from the problem
as good. Bisect will update your working directory to a revision
for testing (unless the -U/--noupdate option is specified). Once
you have performed tests, mark the working directory as good or
bad, and bisect will either update to another candidate changeset
or announce that it has found the bad revision.</p>
<p>As a shortcut, you can also use the revision argument to mark a
revision as good or bad without checking it out first.</p>
<p>If you supply a command, it will be used for automatic bisection.
The environment variable HG_NODE will contain the ID of the
changeset being tested. The exit status of the command will be
used to mark revisions as good or bad: status 0 means good, 125
means to skip the revision, 127 (command not found) will abort the
bisection, and any other non-zero exit status means the revision
is bad.</p>
<div class="verbose docutils container">
<p>Some examples:</p>
<ul>
<li><p class="first">start a bisection with known bad revision 34, and good revision 12:</p>
<pre class="literal-block">
hg bisect --bad 34
hg bisect --good 12
</pre>
</li>
<li><p class="first">advance the current bisection by marking current revision as good or
bad:</p>
<pre class="literal-block">
hg bisect --good
hg bisect --bad
</pre>
</li>
<li><p class="first">mark the current revision, or a known revision, to be skipped (e.g. if
that revision is not usable because of another issue):</p>
<pre class="literal-block">
hg bisect --skip
hg bisect --skip 23
</pre>
</li>
<li><p class="first">skip all revisions that do not touch directories <tt class="docutils literal">foo</tt> or <tt class="docutils literal">bar</tt>:</p>
<pre class="literal-block">
hg bisect --skip "!( file('path:foo') & file('path:bar') )"
</pre>
</li>
<li><p class="first">forget the current bisection:</p>
<pre class="literal-block">
hg bisect --reset
</pre>
</li>
<li><p class="first">use 'make && make tests' to automatically find the first broken
revision:</p>
<pre class="literal-block">
hg bisect --reset
hg bisect --bad 34
hg bisect --good 12
hg bisect --command "make && make tests"
</pre>
</li>
<li><p class="first">see all changesets whose states are already known in the current
bisection:</p>
<pre class="literal-block">
hg log -r "bisect(pruned)"
</pre>
</li>
<li><p class="first">see the changeset currently being bisected (especially useful
if running with -U/--noupdate):</p>
<pre class="literal-block">
hg log -r "bisect(current)"
</pre>
</li>
<li><p class="first">see all changesets that took part in the current bisection:</p>
<pre class="literal-block">
hg log -r "bisect(range)"
</pre>
</li>
<li><p class="first">you can even get a nice graph:</p>
<pre class="literal-block">
hg log --graph -r "bisect(range)"
</pre>
</li>
</ul>
<p>See <a class="reference external" href="hg.1.html#revisions.bisect"><tt class="docutils literal">hg help revisions.bisect</tt></a> for more about the <cite>bisect()</cite> predicate.</p>
</div>
<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">-r</span>, <span class="option">--reset</span></kbd></td>
<td>reset bisect state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--good</span></kbd></td>
<td>mark changeset good</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bad</span></kbd></td>
<td>mark changeset bad</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--skip</span></kbd></td>
<td>skip testing changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--extend</span></kbd></td>
<td>extend the bisect range</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--command <var><CMD></var></span></kbd></td>
</tr>
<tr><td> </td><td>use command to check changeset state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not update to target</td></tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
|