Fossil Wrapper

Check-in [d183a47466]
Login

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

Overview
Comment:restore usual meaning of "line" in `timeline' processing (avoid embedded newlines).
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: d183a474660e8424037d61086b65add6e4187559
User & Date: j 2013-01-06 18:42:57
Context
2013-01-10
18:07
tentative addition of chronological revision numbers to timeline output. check-in: abc0e49ac5 user: j tags: dresden
2013-01-06
18:42
restore usual meaning of "line" in `timeline' processing (avoid embedded newlines). check-in: d183a47466 user: j tags: dresden
17:26
added new proc `reformTimeline' for reformatting the `timeline' output. check-in: de9dfa49ae user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
...
412
413
414
415
416
417
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
proc reformTimeline records {
# --------------------------------------------------------
# expected input: list of timeline entries as provided by
# `unwrapTimeline', i.e. either "date lines" or "commit"
# lines containing the whole commit including the commit
# message.
#
# output: reformatted `timeline' where user/tags information
# is put directly after the time and SHA1 hash on the same
# line and the commit message is put on the following line(s)
# using an indent string `indent' and a line length `maxlen'.
# --------------------------------------------------------

   #these parameters should be user settable:
   set maxlen 78
   set indent {........ }
   set indent {         }

................................................................................

      regsub $rgxuser $record "" record
      regsub $time    $record "" record
      regsub $rgxrvsn $record "" record

      set message [string trim $record]
      set words [split $message]
      set msg $indent[lindex $words 0]
      set len [string length $msg]

      set words [lreplace $words 0 0]
      foreach word $words {
         #if {[string length $word] == 0} {continue}

         set len [expr {$len + 1 + [string length $word]}]
         if {$len <= $maxlen} {
            set msg "$msg $word"


         } else {



            set msg $msg\n$indent$word
            set lindent [string length $indent]
            set len [expr {$lindent + [string length $word]}] 
         }
      }
      # the commit message yields a single list element
      # (i.e. is treated by the subsequent filters as a single line):

      lappend out $msg\n\n
   }
   return $out
}

# --( Fossil )----------------------------------------------------------

proc fossil {args} {







|
|
|
|







 







|
|



|
>
|

<
>
>

>
>
>
|
|
<


<
<
>
|







373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
...
412
413
414
415
416
417
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
proc reformTimeline records {
# --------------------------------------------------------
# expected input: list of timeline entries as provided by
# `unwrapTimeline', i.e. either "date lines" or "commit"
# lines containing the whole commit including the commit
# message.
#
# output: a list of newline terminated lines where the user/tags
# information is appended to the line containing the time and SHA1 
# hash and the commit message is put on the following line(s) using an 
# indent string `indent' and a line length `maxlen'.
# --------------------------------------------------------

   #these parameters should be user settable:
   set maxlen 78
   set indent {........ }
   set indent {         }

................................................................................

      regsub $rgxuser $record "" record
      regsub $time    $record "" record
      regsub $rgxrvsn $record "" record

      set message [string trim $record]
      set words [split $message]
      set line $indent[lindex $words 0]
      set len [string length $line]

      set words [lreplace $words 0 0]
      foreach word $words {
         set wrdlen [string length $word]
         #if { $wrdlen == 0} {continue}
         set len [expr {$len + 1 + $wrdlen}]
         if {$len <= $maxlen} {

            set line "$line $word"
            set isAppended 0
         } else {
            lappend out $line\n
            set isAppended 1

            set line $indent$word
            set len [string length $line]

         }
      }


      if {$isAppended == 0} {lappend out $line\n}
      lappend out \n
   }
   return $out
}

# --( Fossil )----------------------------------------------------------

proc fossil {args} {