##// END OF EJS Templates
context: possibly yield initial fctx in blockdescendants()...
Denis Laxalde -
r31992:3e47a40d default
parent child Browse files
Show More
@@ -1212,6 +1212,16 b' def blockdescendants(fctx, fromline, tol'
1212 1212 """Yield descendants of `fctx` with respect to the block of lines within
1213 1213 `fromline`-`toline` range.
1214 1214 """
1215 # First possibly yield 'fctx' if it has changes in range with respect to
1216 # its parents.
1217 try:
1218 c, linerange1 = next(blockancestors(fctx, fromline, toline))
1219 except StopIteration:
1220 pass
1221 else:
1222 if c == fctx:
1223 yield c, linerange1
1224
1215 1225 diffopts = patch.diffopts(fctx._repo.ui)
1216 1226 fl = fctx.filelog()
1217 1227 seen = {fctx.filerev(): (fctx, (fromline, toline))}
@@ -500,6 +500,7 b' when they should.'
500 500 16: baz:0
501 501 19: baz:3
502 502 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
503 19: baz:3
503 504 20: baz:4
504 505 $ printf "0\n0\n" | cat - baz > baz1
505 506 $ mv baz1 baz
@@ -509,6 +510,7 b' when they should.'
509 510 19: baz:3
510 511 20: baz:4
511 512 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)'
513 19: baz:3
512 514 20: baz:4
513 515 $ echo 6 >> baz
514 516 $ hg ci -m 'added line 8'
@@ -517,6 +519,7 b' when they should.'
517 519 19: baz:3
518 520 20: baz:4
519 521 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
522 19: baz:3
520 523 20: baz:4
521 524 $ sed 's/3/3+/' baz > baz.new
522 525 $ mv baz.new baz
@@ -526,7 +529,8 b' when they should.'
526 529 19: baz:3
527 530 20: baz:4
528 531 23: baz:3->3+
529 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
532 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)'
533 19: baz:3
530 534 20: baz:4
531 535 23: baz:3->3+
532 536 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)'
@@ -617,9 +621,11 b' we follow all branches in descending dir'
617 621 |\
618 622 | o 19: baz:3
619 623 |/
620 o 18: baz:2
621 |\
622 ~ ~
624 o 18: baz:2
625 :
626 o 16: baz:0
627 |
628 ~
623 629
624 630 check error cases
625 631 $ hg up 23 --quiet
@@ -1502,6 +1502,29 b" filelog with 'linerange' and 'patch'"
1502 1502 </html>
1503 1503
1504 1504 $ hg log -r 'followlines(c, 3:4, startrev=8, descend=True) and follow(c)' -p
1505 changeset: 8:5c6574614c37
1506 branch: a-branch
1507 user: test
1508 date: Thu Jan 01 00:00:00 1970 +0000
1509 summary: make c bigger and touch its beginning
1510
1511 diff -r 46c1a66bd8fc -r 5c6574614c37 c
1512 --- a/c Thu Jan 01 00:00:00 1970 +0000
1513 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1514 @@ -1,2 +1,11 @@
1515 +0
1516 +0
1517 b
1518 -c
1519 +c+
1520 +
1521 +a
1522 +a
1523 +
1524 +d
1525 +e
1526 +f
1527
1505 1528 changeset: 10:e95928d60479
1506 1529 branch: a-branch
1507 1530 user: test
@@ -1633,6 +1656,15 b" filelog with 'linerange' and 'patch'"
1633 1656 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1634 1657 <td class="author">test</td>
1635 1658 <td class="description">
1659 <a href="/rev/5c6574614c37">make c bigger and touch its beginning</a>
1660 <span class="branchname">a-branch</span>
1661 </td>
1662 </tr>
1663
1664 <tr>
1665 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1666 <td class="author">test</td>
1667 <td class="description">
1636 1668 <a href="/rev/e95928d60479">touch beginning of c</a>
1637 1669 <span class="branchname">a-branch</span>
1638 1670 </td>
General Comments 0
You need to be logged in to leave comments. Login now