Fossil Wrapper

Check-in [ae9928cc77]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tentative filtering of `finfo' output through `fancy_timeline'.
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: ae9928cc771ea6cd4d742be9f235b350728797e9
User & Date: j 2013-01-16 14:04:48
Context
2013-01-16
14:17
bug fix and one more alias. check-in: fbb73aca09 user: j tags: dresden
14:04
tentative filtering of `finfo' output through `fancy_timeline'. check-in: ae9928cc77 user: j tags: dresden
2013-01-15
13:05
modified `timeline' processing in order to sanitize output in case `-showfiles' is specified. otherwise some tidy up. check-in: c9f625fef0 user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

97
98
99
100
101
102
103
104













105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
...
537
538
539
540
541
542
543












544
545
546
547
548
549
550
        if {[regexp "^=== .* ===" $line]} {
            coloured blue $line
        } else {
            regsub -all {\[[A-Fa-f0-9]+\]} $line [coloured yellow &]
        }
    }

   filter fancy_timeline {leaves timeline} {













       if {[regexp "\n=== .* ===" $line]} {
           return [coloured yellow $line]
       }
       # Expressions to match:
       set artifact_rx {\[([a-f\d]{4})([^\]]*)\]}
       set date_rx     {\n\d\d:\d\d:\d\d}
       set current_rx  {\*CURRENT\*}
       set frkmrg_rx   {\*(FORK|MERGE|BRANCH)\*}
       # Colour the output (repeated substitutions on $line):
       set line [regsub -all $artifact_rx $line\
                     [format {[%s%s]} [coloured red {\1}] {\2}]]
       set line [regsub $date_rx    $line [coloured blue &]]
       set line [regsub $current_rx $line [display reversed &]]
       set line [regsub $frkmrg_rx  $line [display underscored &]]
       set line [regsub {(user: )([a-z][-_.a-z]*)} $line [coloured yellow \\1][coloured green \\2]]
       regsub {(tags: )([a-z][-_,.a-z ]*)} $line [coloured yellow \\1][coloured green \\2]

   }


    # Filter only on aliases of `diff' but not the original command so that 
    # the latter's output can be redirected to create patch files.
    filter diff {d di} {
        switch -regexp $line {
................................................................................
    }

    if {[interactive? $command] == false} {
       if {$command == "timeline" && [llength $lines] > 1} { 
          set revnums [computeRevnums]
          set lines [unwrapTimeline $lines]
          set lines [reformTimeline $lines $revnums]












       }
       foreach line $lines {
          if {$debug == true} {
             puts -nonewline "IN: $line"
             puts -nonewline "OU: "
          }
          filter_with $chain "$line"







|
>
>
>
>
>
>
>
>
>
>
>
>
>




|
|









|
>







 







>
>
>
>
>
>
>
>
>
>
>
>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
        if {[regexp "^=== .* ===" $line]} {
            coloured blue $line
        } else {
            regsub -all {\[[A-Fa-f0-9]+\]} $line [coloured yellow &]
        }
    }

   filter fancy_timeline {leaves timeline finfo} {
       #currently, addition of `finfo' has to be considered
       #tentative only since coloring (if it occurs) interferes
       #with `finfo -p' (although nowadays `cat' should be the
       #canonical command for this purpose). 
       #
       #the modified patterns, however, should not be a problem
       #modifications are:
       #
       # -- more specific `artifact_rx' to avoid unintentional hits
       # -- augmented `date_rx' to account for `finfo' output 
       # -- use (tags|branch)   to account for `finfo' output
       # -- add (artifact:)     to account for `finfo' output
       #
       if {[regexp "\n=== .* ===" $line]} {
           return [coloured yellow $line]
       }
       # Expressions to match:
       set artifact_rx {\[([a-f\d]{4})([a-f\d]{6}\]*)\]}
       set date_rx     {(\n\d\d:\d\d:\d\d)|^\d{4}-\d\d-\d\d}
       set current_rx  {\*CURRENT\*}
       set frkmrg_rx   {\*(FORK|MERGE|BRANCH)\*}
       # Colour the output (repeated substitutions on $line):
       set line [regsub -all $artifact_rx $line\
                     [format {[%s%s]} [coloured red {\1}] {\2}]]
       set line [regsub $date_rx    $line [coloured blue &]]
       set line [regsub $current_rx $line [display reversed &]]
       set line [regsub $frkmrg_rx  $line [display underscored &]]
       set line [regsub {(user: )([a-z][-_.a-z]*)} $line [coloured yellow \\1][coloured green \\2]]
       set line [regsub {((tags|branch): )([a-z][-_,.a-z ]*)} $line [coloured yellow \\1][coloured green \\3]]
       regsub {(artifact: )} $line [coloured yellow \\1]
   }


    # Filter only on aliases of `diff' but not the original command so that 
    # the latter's output can be redirected to create patch files.
    filter diff {d di} {
        switch -regexp $line {
................................................................................
    }

    if {[interactive? $command] == false} {
       if {$command == "timeline" && [llength $lines] > 1} { 
          set revnums [computeRevnums]
          set lines [unwrapTimeline $lines]
          set lines [reformTimeline $lines $revnums]
       } elseif {$command == "finfo" && [llength $lines] > 1} { 
          # let's see whether `-p' is there:
          foreach word $params {
             switch -regexp $word {
                {-p} {set catmode true}
             }
          }
          # if yes, don't unwrap (but it's still filtered 
          # through `fancy_timeline'. think ...)
          if {!$catmode} {
             set lines [unwrapTimeline $lines]
          }
       }
       foreach line $lines {
          if {$debug == true} {
             puts -nonewline "IN: $line"
             puts -nonewline "OU: "
          }
          filter_with $chain "$line"