##// END OF EJS Templates
context: start walking from "introrev" in blockancestors()...
Denis Laxalde -
r32063:befefdd3 stable
parent child Browse files
Show More
@@ -1192,6 +1192,9 b' def blockancestors(fctx, fromline, tolin'
1192 1192 `fromline`-`toline` range.
1193 1193 """
1194 1194 diffopts = patch.diffopts(fctx._repo.ui)
1195 introrev = fctx.introrev()
1196 if fctx.rev() != introrev:
1197 fctx = fctx.filectx(fctx.filenode(), changeid=introrev)
1195 1198 visit = {(fctx.linkrev(), fctx.filenode()): (fctx, (fromline, toline))}
1196 1199 while visit:
1197 1200 c, linerange2 = visit.pop(max(visit))
@@ -488,6 +488,8 b' Test followlines() revset; we usually ch'
488 488 followlines(pat, range, descend=True) to make sure both give the same result
489 489 when they should.
490 490
491 $ echo a >> foo
492 $ hg ci -m 'foo: add a'
491 493 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)'
492 494 16: baz:0
493 495 19: baz:3
@@ -528,17 +530,17 b' when they should.'
528 530 16: baz:0
529 531 19: baz:3
530 532 20: baz:4
531 23: baz:3->3+
533 24: baz:3->3+
532 534 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)'
533 535 19: baz:3
534 536 20: baz:4
535 23: baz:3->3+
537 24: baz:3->3+
536 538 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2, descend=false)'
537 21: added two lines with 0
539 22: added two lines with 0
538 540
539 541 file patterns are okay
540 542 $ hg log -T '{rev}: {desc}\n' -r 'followlines("path:baz", 1:2)'
541 21: added two lines with 0
543 22: added two lines with 0
542 544
543 545 renames are followed
544 546 $ hg mv baz qux
@@ -549,15 +551,15 b' renames are followed'
549 551 16: baz:0
550 552 19: baz:3
551 553 20: baz:4
552 23: baz:3->3+
553 24: qux:4->4+
554 24: baz:3->3+
555 25: qux:4->4+
554 556
555 557 but are missed when following children
556 558 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=22, descend=True)'
557 23: baz:3->3+
559 24: baz:3->3+
558 560
559 561 merge
560 $ hg up 23 --quiet
562 $ hg up 24 --quiet
561 563 $ echo 7 >> baz
562 564 $ hg ci -m 'one more line, out of line range'
563 565 created new head
@@ -568,9 +570,9 b' merge'
568 570 16: baz:0
569 571 19: baz:3
570 572 20: baz:4
571 23: baz:3->3+
572 26: baz:3+->3-
573 $ hg merge 24
573 24: baz:3->3+
574 27: baz:3+->3-
575 $ hg merge 25
574 576 merging baz and qux to qux
575 577 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
576 578 (branch merge, don't forget to commit)
@@ -579,12 +581,12 b' merge'
579 581 16: baz:0
580 582 19: baz:3
581 583 20: baz:4
582 23: baz:3->3+
583 24: qux:4->4+
584 26: baz:3+->3-
585 27: merge
586 $ hg up 24 --quiet
587 $ hg merge 26
584 24: baz:3->3+
585 25: qux:4->4+
586 27: baz:3+->3-
587 28: merge
588 $ hg up 25 --quiet
589 $ hg merge 27
588 590 merging qux and baz to qux
589 591 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
590 592 (branch merge, don't forget to commit)
@@ -594,28 +596,28 b' merge'
594 596 16: baz:0
595 597 19: baz:3
596 598 20: baz:4
597 23: baz:3->3+
598 24: qux:4->4+
599 26: baz:3+->3-
600 28: merge from other side
601 $ hg up 23 --quiet
599 24: baz:3->3+
600 25: qux:4->4+
601 27: baz:3+->3-
602 29: merge from other side
603 $ hg up 24 --quiet
602 604
603 605 we are missing the branch with rename when following children
604 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=25, descend=True)'
605 26: baz:3+->3-
606 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=26, descend=True)'
607 27: baz:3+->3-
606 608
607 609 we follow all branches in descending direction
608 $ hg up 22 --quiet
610 $ hg up 23 --quiet
609 611 $ sed 's/3/+3/' baz > baz.new
610 612 $ mv baz.new baz
611 613 $ hg ci -m 'baz:3->+3'
612 614 created new head
613 615 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 2:5, startrev=16, descend=True)' --graph
614 @ 29: baz:3->+3
616 @ 30: baz:3->+3
615 617 :
616 : o 26: baz:3+->3-
618 : o 27: baz:3+->3-
617 619 : :
618 : o 23: baz:3->3+
620 : o 24: baz:3->3+
619 621 :/
620 622 o 20: baz:4
621 623 |\
@@ -628,7 +630,7 b' we follow all branches in descending dir'
628 630 ~
629 631
630 632 check error cases
631 $ hg up 23 --quiet
633 $ hg up 24 --quiet
632 634 $ hg log -r 'followlines()'
633 635 hg: parse error: followlines takes at least 1 positional arguments
634 636 [255]
@@ -1220,6 +1220,8 b" filelog with 'linerange' and 'patch'"
1220 1220 > f+
1221 1221 > EOF
1222 1222 $ hg ci -m 'touching beginning and end of c' c
1223 $ echo c > cc
1224 $ hg ci -Am 'tip does not touch c' cc
1223 1225 $ hg log -r 'followlines(c, 3:4, startrev=tip) and follow(c)' -p
1224 1226 changeset: 0:6563da9dcf87
1225 1227 user: test
@@ -1289,7 +1291,6 b" filelog with 'linerange' and 'patch'"
1289 1291
1290 1292 changeset: 11:fb9bc322513a
1291 1293 branch: a-branch
1292 tag: tip
1293 1294 user: test
1294 1295 date: Thu Jan 01 00:00:00 1970 +0000
1295 1296 summary: touching beginning and end of c
@@ -1369,7 +1370,7 b" filelog with 'linerange' and 'patch'"
1369 1370 <div class="main">
1370 1371 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1371 1372 <h3>
1372 log c @ 11:<a href="/rev/fb9bc322513a">fb9bc322513a</a>
1373 log c @ 12:<a href="/rev/6e4182052f7b">6e4182052f7b</a>
1373 1374 <span class="branchname">a-branch</span> <span class="tag">tip</span>
1374 1375 (following lines 3:4 <a href="/log/tip/c">back to filelog</a>)
1375 1376 </h3>
@@ -1400,7 +1401,7 b" filelog with 'linerange' and 'patch'"
1400 1401 <td class="author">test</td>
1401 1402 <td class="description">
1402 1403 <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
1403 <span class="branchhead">a-branch</span> <span class="tag">tip</span>
1404 <span class="branchname">a-branch</span>
1404 1405 </td>
1405 1406 </tr>
1406 1407 <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
@@ -1546,7 +1547,6 b" filelog with 'linerange' and 'patch'"
1546 1547
1547 1548 changeset: 11:fb9bc322513a
1548 1549 branch: a-branch
1549 tag: tip
1550 1550 user: test
1551 1551 date: Thu Jan 01 00:00:00 1970 +0000
1552 1552 summary: touching beginning and end of c
@@ -1675,7 +1675,7 b" filelog with 'linerange' and 'patch'"
1675 1675 <td class="author">test</td>
1676 1676 <td class="description">
1677 1677 <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
1678 <span class="branchhead">a-branch</span> <span class="tag">tip</span>
1678 <span class="branchname">a-branch</span>
1679 1679 </td>
1680 1680 </tr>
1681 1681
General Comments 0
You need to be logged in to leave comments. Login now