Fossil Wrapper

Check-in [d1110cdace]
Login

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

Overview
Comment:small compulsive tidy up.
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: d1110cdace61cae7605ef4d1b5447c15481aab78
User & Date: j 2013-07-28 13:39:07
Context
2013-07-28
14:17
move `dbglvl' to the `config' namespace. check-in: 5b283d6948 user: j tags: dresden
13:39
small compulsive tidy up. check-in: d1110cdace user: j tags: dresden
13:16
moved interceptor related stuff to different position. check-in: ee3ce6f243 user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
457
458
459
460
461
462
463

464
465
466
467
468
469
470
471
472
473
474
475
476
477
...
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
577
578
namespace eval config {
    set aliases {}
    set filters {};             # registered filters
    set commands {};            # registered interceptors

    proc init {filename} {
        set myname $::argv0
        #if {[file exists $filename] && [file mtime $filename] > [file mtime $myname]} {}
        if {[file exists $filename] } {
	    # an existing config file is used only if it is _newer_ than the
	    # running `fsl' file. otherwise the config file is (re)created
	    # since it's definition in `config::defaults' might have changed.
	    # this makes it probable that changes to this script become
	    # automatically active for other users (as long as they don't happen
	    # to manually modify there config files frequently ...)

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

proc alias?       {name} { dict exists $config::aliases  $name }

proc filter?      {name} { dict exists $config::filters  $name }

proc interceptor? {name} { dict exists $config::commands $name }


proc unwrapTimeline records {
#-----------------------------------------------------------------------
# unwrap `fossil timeline' output, putting each checkin on a single
# line. expected input: currently, a list of \n terminated lines.
# (maybe the \n should go away?). continuation lines belonging
# to the checkin message (including the trailing user/tags info)
# are identified by a leading indent of 10 blanks. all other
................................................................................
      }
   } 

   return $revnums
}

proc preparse argv {

   # purpose: preprocessing of provided argument string by looking
   # for `fsl' specific option/value arguments, which are eliminated
   # from the argv string after the corresponding actions are performed.
   # currently understands the following options:
   #
   #    --debug n : set global variable `dbglvl' to value n
   # -------------------------------------------------------------------
   global dbglvl
   set dbglvl 0
  
   # check for presence of a `--debug n' option, if present, it
   # defines the debug level which controls how much additional
   # output is generated. after extraction of the debug level the
   # option and its value are eliminated from the argument string
................................................................................
    puts "Currently defined expansions:"
    dict for {alias expansion} $config::aliases {
        puts [format "%10s -> %s" $alias $expansion]
    }
}

interceptor df|gdf {
   # ------------------------------------------------------------------------
   # drop-in replacement for `fsl (g)di' using hg/svn-style relative revision
   # numbers. call as
   #
   # fsl (g)df ... -r n(:m) ...
   #
   # where n, m are counting from 0 (initial checkin) and `...' denotes
   # further `diff' arguments.
   # This call is mapped to
   #
   # fsl (g)di ... -r sha1_n (--to sha1_m) ...
   #
   # where `sha1_n, sha1_m' are the sha1 hashes of the respective checkins.
   # ------------------------------------------------------------------------
   # map this interceptor command to `fossil (g)diff'. actually, we use `di'
   # instead of `diff' since only the former will trigger the `diff' filter:
   regsub {^(g?d)f} $params {\1i} params

   # extract the revison number information from `params'. contrary to
   # `fossil' it is acceptable to omit blanks between `-r' and `n:m':
   set rgx { \-r[[:blank:]]*}







|
|







 







<







 







>
|
|
|
|
|
|
|







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
299
300
301
302
303
304
305

306
307
308
309
310
311
312
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
...
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
577
578
namespace eval config {
    set aliases {}
    set filters {};             # registered filters
    set commands {};            # registered interceptors

    proc init {filename} {
        set myname $::argv0
        if {[file exists $filename] && [file mtime $filename] > [file mtime $myname]} {
        #if {[file exists $filename] } {}
	    # an existing config file is used only if it is _newer_ than the
	    # running `fsl' file. otherwise the config file is (re)created
	    # since it's definition in `config::defaults' might have changed.
	    # this makes it probable that changes to this script become
	    # automatically active for other users (as long as they don't happen
	    # to manually modify there config files frequently ...)

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

proc alias?       {name} { dict exists $config::aliases  $name }

proc filter?      {name} { dict exists $config::filters  $name }

proc interceptor? {name} { dict exists $config::commands $name }


proc unwrapTimeline records {
#-----------------------------------------------------------------------
# unwrap `fossil timeline' output, putting each checkin on a single
# line. expected input: currently, a list of \n terminated lines.
# (maybe the \n should go away?). continuation lines belonging
# to the checkin message (including the trailing user/tags info)
# are identified by a leading indent of 10 blanks. all other
................................................................................
      }
   } 

   return $revnums
}

proc preparse argv {
# -------------------------------------------------------------------
# purpose: preprocessing of provided argument string by looking
# for `fsl' specific option/value arguments, which are eliminated
# from the argv string after the corresponding actions are performed.
# currently understands the following options:
#
#    --debug n : set global variable `dbglvl' to value n
# -------------------------------------------------------------------
   global dbglvl
   set dbglvl 0
  
   # check for presence of a `--debug n' option, if present, it
   # defines the debug level which controls how much additional
   # output is generated. after extraction of the debug level the
   # option and its value are eliminated from the argument string
................................................................................
    puts "Currently defined expansions:"
    dict for {alias expansion} $config::aliases {
        puts [format "%10s -> %s" $alias $expansion]
    }
}

interceptor df|gdf {
# ------------------------------------------------------------------------
# drop-in replacement for `fsl (g)di' using hg/svn-style relative revision
# numbers. call as
#
# fsl (g)df ... -r n(:m) ...
#
# where n, m are counting from 0 (initial checkin) and `...' denotes
# further `diff' arguments.
# This call is mapped to
#
# fsl (g)di ... -r sha1_n (--to sha1_m) ...
#
# where `sha1_n, sha1_m' are the sha1 hashes of the respective checkins.
# ------------------------------------------------------------------------
   # map this interceptor command to `fossil (g)diff'. actually, we use `di'
   # instead of `diff' since only the former will trigger the `diff' filter:
   regsub {^(g?d)f} $params {\1i} params

   # extract the revison number information from `params'. contrary to
   # `fossil' it is acceptable to omit blanks between `-r' and `n:m':
   set rgx { \-r[[:blank:]]*}