Fossil Wrapper

Check-in [a5391d6012]
Login

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

Overview
Comment:start of another attempt at improved timeline output.
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: a5391d6012fb2f4fea231e7419634cbd10fe7a2d
User & Date: j 2013-07-24 11:24:56
Context
2013-07-24
11:28
adjusted indent of `fancy_timeline' so that de-indentation works when `.fslrc' is first created. check-in: e36ec516ef user: j tags: dresden
11:24
start of another attempt at improved timeline output. check-in: a5391d6012 user: j tags: dresden
2013-03-24
01:16
minor fixes. check-in: e8e0d695ab user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

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
...
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
...
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
       #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 [regsub {(\n)(=== .* ===)} $line [format {%s%s} \\1 [coloured yellow \\2]]]
       }
       # Expressions to match:
       set artifact_rx {\[([a-f\d]{4})([a-f\d]{6}\]*)\]}
       set date_rx     {(\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 \\1]]
       set line [regsub $current_rx $line [display reversed &]]
       set line [regsub $frkmrg_rx  $line [display underscored &]]
       set line [regsub {(user: )([a-z][-_.a-z0-9]*)} $line [coloured yellow \\1][coloured green \\2]]
       set line [regsub {((tags|branch): )([a-z][-_,.a-z0-9 ]*)} $line [coloured yellow \\1][coloured green \\3]]
       regsub {(artifact: )} $line [coloured yellow \\1]
   }
................................................................................
   set maxrev [dict size $revnums]

   foreach record $records {
      # temporarily get rid of the record/line terminating newline:
      set record "[string trimright $record]"

      if {[regexp $rgxdate $record]} {
         # a "date" line is passed through (plus additional linefeed):
         lappend out \n$record
      } elseif {[regexp $rgxrev $record]} {
         # this line contains the checkin message:
         regexp $rgxtime $record time
         regexp $rgxrev $record rev
         regexp $rgxuser $record usertag
         set numrev [expr { $maxrev - [dict get $revnums $rev] }]
         lappend out "\n$time $numrev:$rev $usertag\n"

         regsub $rgxuser $record "" record
         regsub $time    $record "" record
         regsub $rgxrev  $record "" record

         ###### patch ######
         lappend out $record\n
         continue    ;###### for now we skip the line wrapping....
         ###### patch ######

         set message [string trim $record]
         set words [split $message]
         set line $indent[lindex $words 0]
         set len [string length $line]
................................................................................
            }
         }
         if {$isAppended == 0} {lappend out $line\n}
      } else {
         # should be a file status line as delivered by `-showfiles' (since
         # it is neither matching `rgxdate' nor `rgxrev') and is passed 
         # through as is.
         lappend out $record\n
      }
   }
   return $out
}

proc computeRevnums {params} {
#-----------------------------------------------------------------------
# generate a dictionary of SHA1 keys vs. "reverse" revision numbers 
# (last checkin = 1)
#-----------------------------------------------------------------------







<
<
<


|



<
|







 







|
|






|






|







 







|


|







112
113
114
115
116
117
118



119
120
121
122
123
124

125
126
127
128
129
130
131
132
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
       #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
       #



       # Expressions to match:
       set artifact_rx {\[([a-f\d]{4})([a-f\d]{6}\]*)\]}
       set date_rx     {(\d{4}-\d\d-\d\d \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 \\1]]
       set line [regsub $current_rx $line [display reversed &]]
       set line [regsub $frkmrg_rx  $line [display underscored &]]
       set line [regsub {(user: )([a-z][-_.a-z0-9]*)} $line [coloured yellow \\1][coloured green \\2]]
       set line [regsub {((tags|branch): )([a-z][-_,.a-z0-9 ]*)} $line [coloured yellow \\1][coloured green \\3]]
       regsub {(artifact: )} $line [coloured yellow \\1]
   }
................................................................................
   set maxrev [dict size $revnums]

   foreach record $records {
      # temporarily get rid of the record/line terminating newline:
      set record "[string trimright $record]"

      if {[regexp $rgxdate $record]} {
         # the `date' information is extracted and then prepended to the suitable checkins
         set date [regsub {(=== )(.*)( ===)} $record {\2}]
      } elseif {[regexp $rgxrev $record]} {
         # this line contains the checkin message:
         regexp $rgxtime $record time
         regexp $rgxrev $record rev
         regexp $rgxuser $record usertag
         set numrev [expr { $maxrev - [dict get $revnums $rev] }]
         lappend out "\n$date $time ==> $numrev:$rev $usertag"

         regsub $rgxuser $record "" record
         regsub $time    $record "" record
         regsub $rgxrev  $record "" record

         ###### patch ######
         lappend out $record
         continue    ;###### for now we skip the line wrapping....
         ###### patch ######

         set message [string trim $record]
         set words [split $message]
         set line $indent[lindex $words 0]
         set len [string length $line]
................................................................................
            }
         }
         if {$isAppended == 0} {lappend out $line\n}
      } else {
         # should be a file status line as delivered by `-showfiles' (since
         # it is neither matching `rgxdate' nor `rgxrev') and is passed 
         # through as is.
         lappend out \n$record
      }
   }
   return [lappend out \n]
}

proc computeRevnums {params} {
#-----------------------------------------------------------------------
# generate a dictionary of SHA1 keys vs. "reverse" revision numbers 
# (last checkin = 1)
#-----------------------------------------------------------------------