Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | removed old `fixGrep' (the newer one is superior) and account for possibility that a single file artifact belongs to multiple checkins when reporting the incremental checkin numbers. |
---|---|
Timelines: | family | ancestors | descendants | both | grep |
Files: | files | file ages | folders |
SHA1: |
b04bf5a394e86f6fa2786a00823e4cca |
User & Date: | j 2019-07-11 15:29:55 |
Context
2019-07-11
| ||
17:13 | beautify the output somewhat. use alternating colors to separate between adjacent hashes/checkins in the output. check-in: 4e76e7d42b user: j tags: grep | |
15:29 | removed old `fixGrep' (the newer one is superior) and account for possibility that a single file artifact belongs to multiple checkins when reporting the incremental checkin numbers. check-in: b04bf5a394 user: j tags: grep | |
2019-07-08
| ||
16:05 | another `fixGrep' which is possibly superior since overall easier and faster. check-in: ee7ec69ea7 user: j tags: grep | |
Changes
Changes to fsl.
︙ | ︙ | |||
561 562 563 564 565 566 567 | dict set revnums $rev [expr {$numrev - $revcnt}] } } return $revnums } proc fixGrep {lines params grepflags} { | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > | > > > > > | > > > > | > > > | | < | | 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | dict set revnums $rev [expr {$numrev - $revcnt}] } } return $revnums } proc fixGrep {lines params grepflags} { set fname [last $params] set finfo [lrange [split [exec fossil finfo -W 0 $fname] \n] 1 end] set rgxdate {^\d{4}-\d\d-\d\d} set rgxhash {\[([a-f\d]{10})\]} foreach line $finfo { regexp "$rgxdate $rgxhash" $line _ cihash regexp ", artifact: $rgxhash, branch: .*\\)" $line _ fhash # an artifact 'fhash' can be part of multiple checkins. so we # have to collect all of them via `dict lappend' dict lappend cihashes $fhash \[$cihash\] } set revnums [computeRevnums {}] set f1 [last $grepflags] set f2 [first $grepflags] if {$f1 + $f2 > 0} { set buf $lines set lines {} if {$f1} { lappend lines [first $buf] } if {$f2} { lappend lines [last $buf] } } set greppat [lindex $params end-1] foreach line $lines { # need to separate file hash and line number to match `greppat' # against the real line content (so that anchoring of the # pattern works and spurious coloring of hash or line number # is prevented). set field [split $line :] set fhash [string trimright [first $field]] set lino [lindex $field 1] set line [join [lrange $field 2 end]] set cihash [dict get $cihashes $fhash] set revnum {} foreach hash $cihash { append revnum [dict get $revnums $hash] " " } set revnum [join $revnum ,] regsub -all "($greppat)" $line [coloured redbold \\1] line # for now, we just preprend the chronological revision numbers # and add a bit of colour lappend out [coloured magenta $revnum]:$fhash:$lino:$line } return $out } proc adjustWidth params { set widopt {} regexp -- {(timeline|finfo|search|descendants).*(-W)} $params widopt |
︙ | ︙ |