##// END OF EJS Templates
hgweb: fix diff hunks filtering by line range in webutil.diffs()...
Denis Laxalde -
r31704:cbe0bea8 default
parent child Browse files
Show More
@@ -473,7 +473,7 b' def diffs(web, tmpl, ctx, basectx, files'
473 if linerange is not None and hunkrange is not None:
473 if linerange is not None and hunkrange is not None:
474 s1, l1, s2, l2 = hunkrange
474 s1, l1, s2, l2 = hunkrange
475 lb, ub = linerange
475 lb, ub = linerange
476 if not (lb <= s2 < ub or lb < s2 + l2 <= ub):
476 if not (lb < s2 + l2 and ub > s2):
477 continue
477 continue
478 lines.extend(hunklines)
478 lines.extend(hunklines)
479 if lines:
479 if lines:
@@ -1165,6 +1165,8 b" filelog with 'linerange' and 'patch'"
1165 b
1165 b
1166 c
1166 c
1167 $ cat <<EOF > c
1167 $ cat <<EOF > c
1168 > 0
1169 > 0
1168 > b
1170 > b
1169 > c+
1171 > c+
1170 >
1172 >
@@ -1177,6 +1179,8 b" filelog with 'linerange' and 'patch'"
1177 > EOF
1179 > EOF
1178 $ hg ci -m 'make c bigger and touch its beginning' c
1180 $ hg ci -m 'make c bigger and touch its beginning' c
1179 $ cat <<EOF > c
1181 $ cat <<EOF > c
1182 > 0
1183 > 0
1180 > b
1184 > b
1181 > c+
1185 > c+
1182 >
1186 >
@@ -1189,6 +1193,8 b" filelog with 'linerange' and 'patch'"
1189 > EOF
1193 > EOF
1190 $ hg ci -m 'just touch end of c' c
1194 $ hg ci -m 'just touch end of c' c
1191 $ cat <<EOF > c
1195 $ cat <<EOF > c
1196 > 0
1197 > 0
1192 > b
1198 > b
1193 > c++
1199 > c++
1194 >
1200 >
@@ -1201,6 +1207,8 b" filelog with 'linerange' and 'patch'"
1201 > EOF
1207 > EOF
1202 $ hg ci -m 'touch beginning of c' c
1208 $ hg ci -m 'touch beginning of c' c
1203 $ cat <<EOF > c
1209 $ cat <<EOF > c
1210 > 0
1211 > 0
1204 > b-
1212 > b-
1205 > c++
1213 > c++
1206 >
1214 >
@@ -1212,7 +1220,7 b" filelog with 'linerange' and 'patch'"
1212 > f+
1220 > f+
1213 > EOF
1221 > EOF
1214 $ hg ci -m 'touching beginning and end of c' c
1222 $ hg ci -m 'touching beginning and end of c' c
1215 $ hg log -r 'followlines(c, 1:2, startrev=tip) and follow(c)' -p
1223 $ hg log -r 'followlines(c, 3:4, startrev=tip) and follow(c)' -p
1216 changeset: 0:6563da9dcf87
1224 changeset: 0:6563da9dcf87
1217 user: test
1225 user: test
1218 date: Thu Jan 01 00:00:00 1970 +0000
1226 date: Thu Jan 01 00:00:00 1970 +0000
@@ -1237,16 +1245,18 b" filelog with 'linerange' and 'patch'"
1237 b
1245 b
1238 +c
1246 +c
1239
1247
1240 changeset: 8:c40702dbfc57
1248 changeset: 8:5c6574614c37
1241 branch: a-branch
1249 branch: a-branch
1242 user: test
1250 user: test
1243 date: Thu Jan 01 00:00:00 1970 +0000
1251 date: Thu Jan 01 00:00:00 1970 +0000
1244 summary: make c bigger and touch its beginning
1252 summary: make c bigger and touch its beginning
1245
1253
1246 diff -r 46c1a66bd8fc -r c40702dbfc57 c
1254 diff -r 46c1a66bd8fc -r 5c6574614c37 c
1247 --- a/c Thu Jan 01 00:00:00 1970 +0000
1255 --- a/c Thu Jan 01 00:00:00 1970 +0000
1248 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1256 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1249 @@ -1,2 +1,9 @@
1257 @@ -1,2 +1,11 @@
1258 +0
1259 +0
1250 b
1260 b
1251 -c
1261 -c
1252 +c+
1262 +c+
@@ -1258,16 +1268,18 b" filelog with 'linerange' and 'patch'"
1258 +e
1268 +e
1259 +f
1269 +f
1260
1270
1261 changeset: 10:f94018eca295
1271 changeset: 10:e95928d60479
1262 branch: a-branch
1272 branch: a-branch
1263 user: test
1273 user: test
1264 date: Thu Jan 01 00:00:00 1970 +0000
1274 date: Thu Jan 01 00:00:00 1970 +0000
1265 summary: touch beginning of c
1275 summary: touch beginning of c
1266
1276
1267 diff -r 07faa31d6d1c -r f94018eca295 c
1277 diff -r e1d3e9c5a23f -r e95928d60479 c
1268 --- a/c Thu Jan 01 00:00:00 1970 +0000
1278 --- a/c Thu Jan 01 00:00:00 1970 +0000
1269 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1279 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1270 @@ -1,5 +1,5 @@
1280 @@ -1,7 +1,7 @@
1281 0
1282 0
1271 b
1283 b
1272 -c+
1284 -c+
1273 +c++
1285 +c++
@@ -1275,30 +1287,32 b" filelog with 'linerange' and 'patch'"
1275 a
1287 a
1276 a
1288 a
1277
1289
1278 changeset: 11:ea4193bdd9bf
1290 changeset: 11:fb9bc322513a
1279 branch: a-branch
1291 branch: a-branch
1280 tag: tip
1292 tag: tip
1281 user: test
1293 user: test
1282 date: Thu Jan 01 00:00:00 1970 +0000
1294 date: Thu Jan 01 00:00:00 1970 +0000
1283 summary: touching beginning and end of c
1295 summary: touching beginning and end of c
1284
1296
1285 diff -r f94018eca295 -r ea4193bdd9bf c
1297 diff -r e95928d60479 -r fb9bc322513a c
1286 --- a/c Thu Jan 01 00:00:00 1970 +0000
1298 --- a/c Thu Jan 01 00:00:00 1970 +0000
1287 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1299 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1288 @@ -1,4 +1,4 @@
1300 @@ -1,6 +1,6 @@
1301 0
1302 0
1289 -b
1303 -b
1290 +b-
1304 +b-
1291 c++
1305 c++
1292
1306
1293 a
1307 a
1294 @@ -6,4 +6,4 @@
1308 @@ -8,4 +8,4 @@
1295
1309
1296 d
1310 d
1297 e+
1311 e+
1298 -f
1312 -f
1299 +f+
1313 +f+
1300
1314
1301 $ (get-with-headers.py localhost:$HGPORT 'log/tip/c?linerange=1:2&patch=')
1315 $ (get-with-headers.py localhost:$HGPORT 'log/tip/c?linerange=3:4&patch=')
1302 200 Script output follows
1316 200 Script output follows
1303
1317
1304 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1318 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -1355,9 +1369,9 b" filelog with 'linerange' and 'patch'"
1355 <div class="main">
1369 <div class="main">
1356 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1370 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1357 <h3>
1371 <h3>
1358 log c @ 11:<a href="/rev/ea4193bdd9bf">ea4193bdd9bf</a>
1372 log c @ 11:<a href="/rev/fb9bc322513a">fb9bc322513a</a>
1359 <span class="branchname">a-branch</span> <span class="tag">tip</span>
1373 <span class="branchname">a-branch</span> <span class="tag">tip</span>
1360 (following lines 1:2 <a href="/log/tip/c">back to filelog</a>)
1374 (following lines 3:4 <a href="/log/tip/c">back to filelog</a>)
1361 </h3>
1375 </h3>
1362
1376
1363 <form class="search" action="/log">
1377 <form class="search" action="/log">
@@ -1368,8 +1382,8 b" filelog with 'linerange' and 'patch'"
1368 </form>
1382 </form>
1369
1383
1370 <div class="navigate">
1384 <div class="navigate">
1371 <a href="/log/tip/c?linerange=1%3A2&patch=&revcount=30">less</a>
1385 <a href="/log/tip/c?linerange=3%3A4&patch=&revcount=30">less</a>
1372 <a href="/log/tip/c?linerange=1%3A2&patch=&revcount=120">more</a>
1386 <a href="/log/tip/c?linerange=3%3A4&patch=&revcount=120">more</a>
1373 | </div>
1387 | </div>
1374
1388
1375 <table class="bigtable">
1389 <table class="bigtable">
@@ -1385,59 +1399,65 b" filelog with 'linerange' and 'patch'"
1385 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1399 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1386 <td class="author">test</td>
1400 <td class="author">test</td>
1387 <td class="description">
1401 <td class="description">
1388 <a href="/rev/ea4193bdd9bf">touching beginning and end of c</a>
1402 <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
1389 <span class="branchhead">a-branch</span> <span class="tag">tip</span>
1403 <span class="branchhead">a-branch</span> <span class="tag">tip</span>
1390 </td>
1404 </td>
1391 </tr>
1405 </tr>
1392 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1406 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1393 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1407 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1394 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1408 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1395 <span id="l1.3" class="atline">@@ -1,4 +1,4 @@</span><a href="#l1.3"></a>
1409 <span id="l1.3" class="atline">@@ -1,6 +1,6 @@</span><a href="#l1.3"></a>
1396 <span id="l1.4" class="minusline">-b</span><a href="#l1.4"></a>
1410 <span id="l1.4"> 0</span><a href="#l1.4"></a>
1397 <span id="l1.5" class="plusline">+b-</span><a href="#l1.5"></a>
1411 <span id="l1.5"> 0</span><a href="#l1.5"></a>
1398 <span id="l1.6"> c++</span><a href="#l1.6"></a>
1412 <span id="l1.6" class="minusline">-b</span><a href="#l1.6"></a>
1399 <span id="l1.7"> </span><a href="#l1.7"></a>
1413 <span id="l1.7" class="plusline">+b-</span><a href="#l1.7"></a>
1400 <span id="l1.8"> a</span><a href="#l1.8"></a></pre></div></td></tr>
1414 <span id="l1.8"> c++</span><a href="#l1.8"></a>
1415 <span id="l1.9"> </span><a href="#l1.9"></a>
1416 <span id="l1.10"> a</span><a href="#l1.10"></a></pre></div></td></tr>
1401 <tr>
1417 <tr>
1402 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1418 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1403 <td class="author">test</td>
1419 <td class="author">test</td>
1404 <td class="description">
1420 <td class="description">
1405 <a href="/rev/f94018eca295">touch beginning of c</a>
1421 <a href="/rev/e95928d60479">touch beginning of c</a>
1406 <span class="branchname">a-branch</span>
1422 <span class="branchname">a-branch</span>
1407 </td>
1423 </td>
1408 </tr>
1424 </tr>
1409 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1425 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1410 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1426 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1411 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1427 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1412 <span id="l1.3" class="atline">@@ -1,5 +1,5 @@</span><a href="#l1.3"></a>
1428 <span id="l1.3" class="atline">@@ -1,7 +1,7 @@</span><a href="#l1.3"></a>
1413 <span id="l1.4"> b</span><a href="#l1.4"></a>
1429 <span id="l1.4"> 0</span><a href="#l1.4"></a>
1414 <span id="l1.5" class="minusline">-c+</span><a href="#l1.5"></a>
1430 <span id="l1.5"> 0</span><a href="#l1.5"></a>
1415 <span id="l1.6" class="plusline">+c++</span><a href="#l1.6"></a>
1431 <span id="l1.6"> b</span><a href="#l1.6"></a>
1416 <span id="l1.7"> </span><a href="#l1.7"></a>
1432 <span id="l1.7" class="minusline">-c+</span><a href="#l1.7"></a>
1417 <span id="l1.8"> a</span><a href="#l1.8"></a>
1433 <span id="l1.8" class="plusline">+c++</span><a href="#l1.8"></a>
1418 <span id="l1.9"> a</span><a href="#l1.9"></a></pre></div></td></tr>
1434 <span id="l1.9"> </span><a href="#l1.9"></a>
1435 <span id="l1.10"> a</span><a href="#l1.10"></a>
1436 <span id="l1.11"> a</span><a href="#l1.11"></a></pre></div></td></tr>
1419 <tr>
1437 <tr>
1420 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1438 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1421 <td class="author">test</td>
1439 <td class="author">test</td>
1422 <td class="description">
1440 <td class="description">
1423 <a href="/rev/c40702dbfc57">make c bigger and touch its beginning</a>
1441 <a href="/rev/5c6574614c37">make c bigger and touch its beginning</a>
1424 <span class="branchname">a-branch</span>
1442 <span class="branchname">a-branch</span>
1425 </td>
1443 </td>
1426 </tr>
1444 </tr>
1427 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1445 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
1428 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1446 <span id="l1.1" class="minusline">--- a/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
1429 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1447 <span id="l1.2" class="plusline">+++ b/c Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
1430 <span id="l1.3" class="atline">@@ -1,2 +1,9 @@</span><a href="#l1.3"></a>
1448 <span id="l1.3" class="atline">@@ -1,2 +1,11 @@</span><a href="#l1.3"></a>
1431 <span id="l1.4"> b</span><a href="#l1.4"></a>
1449 <span id="l1.4" class="plusline">+0</span><a href="#l1.4"></a>
1432 <span id="l1.5" class="minusline">-c</span><a href="#l1.5"></a>
1450 <span id="l1.5" class="plusline">+0</span><a href="#l1.5"></a>
1433 <span id="l1.6" class="plusline">+c+</span><a href="#l1.6"></a>
1451 <span id="l1.6"> b</span><a href="#l1.6"></a>
1434 <span id="l1.7" class="plusline">+</span><a href="#l1.7"></a>
1452 <span id="l1.7" class="minusline">-c</span><a href="#l1.7"></a>
1435 <span id="l1.8" class="plusline">+a</span><a href="#l1.8"></a>
1453 <span id="l1.8" class="plusline">+c+</span><a href="#l1.8"></a>
1436 <span id="l1.9" class="plusline">+a</span><a href="#l1.9"></a>
1454 <span id="l1.9" class="plusline">+</span><a href="#l1.9"></a>
1437 <span id="l1.10" class="plusline">+</span><a href="#l1.10"></a>
1455 <span id="l1.10" class="plusline">+a</span><a href="#l1.10"></a>
1438 <span id="l1.11" class="plusline">+d</span><a href="#l1.11"></a>
1456 <span id="l1.11" class="plusline">+a</span><a href="#l1.11"></a>
1439 <span id="l1.12" class="plusline">+e</span><a href="#l1.12"></a>
1457 <span id="l1.12" class="plusline">+</span><a href="#l1.12"></a>
1440 <span id="l1.13" class="plusline">+f</span><a href="#l1.13"></a></pre></div></td></tr>
1458 <span id="l1.13" class="plusline">+d</span><a href="#l1.13"></a>
1459 <span id="l1.14" class="plusline">+e</span><a href="#l1.14"></a>
1460 <span id="l1.15" class="plusline">+f</span><a href="#l1.15"></a></pre></div></td></tr>
1441 <tr>
1461 <tr>
1442 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1462 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1443 <td class="author">test</td>
1463 <td class="author">test</td>
@@ -1468,8 +1488,8 b" filelog with 'linerange' and 'patch'"
1468 </table>
1488 </table>
1469
1489
1470 <div class="navigate">
1490 <div class="navigate">
1471 <a href="/log/tip/c?linerange=1%3A2&patch=&revcount=30">less</a>
1491 <a href="/log/tip/c?linerange=3%3A4&patch=&revcount=30">less</a>
1472 <a href="/log/tip/c?linerange=1%3A2&patch=&revcount=120">more</a>
1492 <a href="/log/tip/c?linerange=3%3A4&patch=&revcount=120">more</a>
1473 |
1493 |
1474 </div>
1494 </div>
1475
1495
General Comments 0
You need to be logged in to leave comments. Login now