Show More
@@ -1212,6 +1212,16 b' def blockdescendants(fctx, fromline, tol' | |||||
1212 | """Yield descendants of `fctx` with respect to the block of lines within |
|
1212 | """Yield descendants of `fctx` with respect to the block of lines within | |
1213 | `fromline`-`toline` range. |
|
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 | diffopts = patch.diffopts(fctx._repo.ui) |
|
1225 | diffopts = patch.diffopts(fctx._repo.ui) | |
1216 | fl = fctx.filelog() |
|
1226 | fl = fctx.filelog() | |
1217 | seen = {fctx.filerev(): (fctx, (fromline, toline))} |
|
1227 | seen = {fctx.filerev(): (fctx, (fromline, toline))} |
@@ -500,6 +500,7 b' when they should.' | |||||
500 | 16: baz:0 |
|
500 | 16: baz:0 | |
501 | 19: baz:3 |
|
501 | 19: baz:3 | |
502 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
|
502 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' | |
|
503 | 19: baz:3 | |||
503 | 20: baz:4 |
|
504 | 20: baz:4 | |
504 | $ printf "0\n0\n" | cat - baz > baz1 |
|
505 | $ printf "0\n0\n" | cat - baz > baz1 | |
505 | $ mv baz1 baz |
|
506 | $ mv baz1 baz | |
@@ -509,6 +510,7 b' when they should.' | |||||
509 | 19: baz:3 |
|
510 | 19: baz:3 | |
510 | 20: baz:4 |
|
511 | 20: baz:4 | |
511 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)' |
|
512 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)' | |
|
513 | 19: baz:3 | |||
512 | 20: baz:4 |
|
514 | 20: baz:4 | |
513 | $ echo 6 >> baz |
|
515 | $ echo 6 >> baz | |
514 | $ hg ci -m 'added line 8' |
|
516 | $ hg ci -m 'added line 8' | |
@@ -517,6 +519,7 b' when they should.' | |||||
517 | 19: baz:3 |
|
519 | 19: baz:3 | |
518 | 20: baz:4 |
|
520 | 20: baz:4 | |
519 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
|
521 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' | |
|
522 | 19: baz:3 | |||
520 | 20: baz:4 |
|
523 | 20: baz:4 | |
521 | $ sed 's/3/3+/' baz > baz.new |
|
524 | $ sed 's/3/3+/' baz > baz.new | |
522 | $ mv baz.new baz |
|
525 | $ mv baz.new baz | |
@@ -526,7 +529,8 b' when they should.' | |||||
526 | 19: baz:3 |
|
529 | 19: baz:3 | |
527 | 20: baz:4 |
|
530 | 20: baz:4 | |
528 | 23: baz:3->3+ |
|
531 | 23: baz:3->3+ | |
529 |
$ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=1 |
|
532 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)' | |
|
533 | 19: baz:3 | |||
530 | 20: baz:4 |
|
534 | 20: baz:4 | |
531 | 23: baz:3->3+ |
|
535 | 23: baz:3->3+ | |
532 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)' |
|
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 | | o 19: baz:3 |
|
622 | | o 19: baz:3 | |
619 | |/ |
|
623 | |/ | |
620 |
o |
|
624 | o 18: baz:2 | |
621 | |\ |
|
625 | : | |
622 | ~ ~ |
|
626 | o 16: baz:0 | |
|
627 | | | |||
|
628 | ~ | |||
623 |
|
629 | |||
624 | check error cases |
|
630 | check error cases | |
625 | $ hg up 23 --quiet |
|
631 | $ hg up 23 --quiet |
@@ -1502,6 +1502,29 b" filelog with 'linerange' and 'patch'" | |||||
1502 | </html> |
|
1502 | </html> | |
1503 |
|
1503 | |||
1504 | $ hg log -r 'followlines(c, 3:4, startrev=8, descend=True) and follow(c)' -p |
|
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 | changeset: 10:e95928d60479 |
|
1528 | changeset: 10:e95928d60479 | |
1506 | branch: a-branch |
|
1529 | branch: a-branch | |
1507 | user: test |
|
1530 | user: test | |
@@ -1633,6 +1656,15 b" filelog with 'linerange' and 'patch'" | |||||
1633 | <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td> |
|
1656 | <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td> | |
1634 | <td class="author">test</td> |
|
1657 | <td class="author">test</td> | |
1635 | <td class="description"> |
|
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 | <a href="/rev/e95928d60479">touch beginning of c</a> |
|
1668 | <a href="/rev/e95928d60479">touch beginning of c</a> | |
1637 | <span class="branchname">a-branch</span> |
|
1669 | <span class="branchname">a-branch</span> | |
1638 | </td> |
|
1670 | </td> |
General Comments 0
You need to be logged in to leave comments.
Login now