Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | simplified and improved `df' interceptor. |
---|---|
Timelines: | family | ancestors | descendants | both | dresden |
Files: | files | file ages | folders |
SHA1: |
838bbe2a575e7e42c553234f1269b72a |
User & Date: | j 2013-07-27 16:22:32 |
Context
2013-07-27
| ||
16:46 | minor. check-in: abdb439351 user: j tags: dresden | |
16:22 | simplified and improved `df' interceptor. check-in: 838bbe2a57 user: j tags: dresden | |
15:06 | augmented `df' interceptor to map to `gdi' if called as `gdf'. `df' can now also be called without further args. check-in: ec867b5461 user: j tags: dresden | |
Changes
Changes to fsl.
︙ | ︙ | |||
357 358 359 360 361 362 363 | puts [format "%10s -> %s" $alias $expansion] } } interceptor df|gdf { # ---------------------------------------------------------------------- # a first stab at getting relative revision numbers working with `diff'. | | | | | < < | | < < | < | | < < < < | < < < | < < < | < < | < < > > | | | < < < | < | < < < < < < | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | puts [format "%10s -> %s" $alias $expansion] } } interceptor df|gdf { # ---------------------------------------------------------------------- # a first stab at getting relative revision numbers working with `diff'. # should be called as `fsl (g)df -r n' or `fsl (g)df -r n:m' where `n, m' are # counting from 0 (initial checkin). This call which is # be mapped to # # fsl (g)di -r sha1_n --to sha1_m # # where `sha1_n, sha1_m' are the sha1 hashes of the respective checkins. # further arguments to `diff' are passed through unmodified (hopefully). # ---------------------------------------------------------------------- set hash2num [computeRevnums {}] set dim [dict size $hash2num] # exchange keys and values in the above dictonary sha1. at the same time, # strip the square brackets around the hash value: dict for {key val} $hash2num { regexp {[[:alnum:]]+} $key sha1 dict set num2hash [expr {$dim - $val}] $sha1 } # 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 rgxrevnum {[[:digit:]]+(:[[:digit:]]+)?} set rgx { -r} set rgx { \-r[[:blank:]]*} set rgx $rgx$rgxrevnum # without `-r' argument we return `params' as is: if {![regexp $rgx $params revarg]} {return $params} # translate rev. numbers to sha1 hashes and construct the # required `diff' arguments: regexp $rgxrevnum $revarg numbers set revs [split $numbers :] set to {} set cnt 0 set fromto [list from to] foreach rev $revs { set optarg [lindex $fromto $cnt] # this evals in turn to define variables `from' and `to', respectively, # which contain the respective `diff' arguments: set $optarg " --$optarg [dict get $num2hash $rev]" incr cnt } #replace `-r n:m' by the constructed `diff' arguments: regsub $revarg $params $from$to params #puts "executing `fossil $params'" return $params } proc unwrapTimeline records { #----------------------------------------------------------------------- # unwrap `fossil timeline' output, putting each checkin on a single |
︙ | ︙ |