Mercurial > public > mercurial-scm > hg
diff tests/test-hgweb-filelog.t @ 32063:befefdd34cf8 stable
context: start walking from "introrev" in blockancestors()
Previously, calling blockancestors() with a fctx not touching file would
sometimes yield this filectx first, instead of the first "block ancestor",
because when compared to its parent it may have changes in specified line
range despite not touching the file at all.
Fixing this by starting the algorithm from the "base" filectx obtained using
fctx.introrev() (as done in annotate()).
In tests, add a changeset not touching file we want to follow lines of to
cover this case. Do this in test-annotate.t for followlines revset tests and
in test-hgweb-filelog.t for /log/<rev>/<file>?linerange=<from>:<to> tests.
author | Denis Laxalde <denis@laxalde.org> |
---|---|
date | Thu, 20 Apr 2017 21:40:28 +0200 |
parents | 3e47a40d7a7a |
children | cba4461aa0a0 |
line wrap: on
line diff
--- a/tests/test-hgweb-filelog.t Thu Apr 13 16:09:40 2017 -0400 +++ b/tests/test-hgweb-filelog.t Thu Apr 20 21:40:28 2017 +0200 @@ -1220,6 +1220,8 @@ > f+ > EOF $ hg ci -m 'touching beginning and end of c' c + $ echo c > cc + $ hg ci -Am 'tip does not touch c' cc $ hg log -r 'followlines(c, 3:4, startrev=tip) and follow(c)' -p changeset: 0:6563da9dcf87 user: test @@ -1289,7 +1291,6 @@ changeset: 11:fb9bc322513a branch: a-branch - tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: touching beginning and end of c @@ -1369,7 +1370,7 @@ <div class="main"> <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> <h3> - log c @ 11:<a href="/rev/fb9bc322513a">fb9bc322513a</a> + log c @ 12:<a href="/rev/6e4182052f7b">6e4182052f7b</a> <span class="branchname">a-branch</span> <span class="tag">tip</span> (following lines 3:4 <a href="/log/tip/c">back to filelog</a>) </h3> @@ -1400,7 +1401,7 @@ <td class="author">test</td> <td class="description"> <a href="/rev/fb9bc322513a">touching beginning and end of c</a> - <span class="branchhead">a-branch</span> <span class="tag">tip</span> + <span class="branchname">a-branch</span> </td> </tr> <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap"> @@ -1546,7 +1547,6 @@ changeset: 11:fb9bc322513a branch: a-branch - tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: touching beginning and end of c @@ -1675,7 +1675,7 @@ <td class="author">test</td> <td class="description"> <a href="/rev/fb9bc322513a">touching beginning and end of c</a> - <span class="branchhead">a-branch</span> <span class="tag">tip</span> + <span class="branchname">a-branch</span> </td> </tr>