Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | More 8.5 features used: lassign instead of foreach. lrepeat+lreverse Math commands for some expressions. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ace521ad0a0129c20d18cca7ac4f00ec |
User & Date: | peter 2009-02-12 19:11:35.000 |
Context
2009-02-12
| ||
19:32 | Perforce support check-in: 5202d19e40 user: peter tags: trunk | |
19:11 | More 8.5 features used: lassign instead of foreach. lrepeat+lreverse Math commands for some expressions. check-in: ace521ad0a user: peter tags: trunk | |
18:31 | Require 8.5. Use argument expansion instead of eval. check-in: eaa675fac3 user: peter tags: trunk | |
Changes
Changes to src/clip.tcl.
︙ | ︙ | |||
82 83 84 85 86 87 88 | ArmCatch set win [twapi::get_foreground_window] if {$win eq ""} { #puts "No fg window" return } #puts "Locating windows" | | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | ArmCatch set win [twapi::get_foreground_window] if {$win eq ""} { #puts "No fg window" return } #puts "Locating windows" lassign [twapi::get_window_coordinates $win] x1 y1 x2 y2 set width [expr {$x2 - $x1}] set height [expr {$y2 - $y1}] set windows {} foreach x [list [expr {$x1 + $width / 4}] [expr {$x1 + 3*$width /4}]] { foreach y [list [expr {$y1 + $height / 4}] [expr {$y1 + 3*$height /4}]] { lappend windows [twapi::get_window_at_location $x $y] } } set windows [lsort -unique $windows] #puts $windows after 50 "set ::CatchFromWinWait 1" ; vwait ::CatchFromWinWait set capturedData {} foreach win $windows { clipboard clear clipboard append "" twapi::set_focus $win after 50 "set ::CatchFromWinWait 1" ; vwait ::CatchFromWinWait twapi::send_keys ^(ac) after 50 "set ::CatchFromWinWait 1" ; vwait ::CatchFromWinWait lassign [twapi::get_window_coordinates $win] x1 y1 x2 y2 if {[catch {clipboard get} text]} continue if {$text eq ""} continue lappend capturedData [list $x1 $text] } $::diff(wClip1) delete 1.0 end $::diff(wClip2) delete 1.0 end if {[llength $capturedData] == 0} return |
︙ | ︙ |
Changes to src/compare.tcl.
︙ | ︙ | |||
66 67 68 69 70 71 72 | # puts "D1 ($diffs1)" # puts "D2 ($diffs2)" # puts "S $sumsame D $sumdiff1 D $sumdiff2" return [expr {$sumsame - [maxAbs $sumdiff1 $sumdiff2]}] } # Initialise a multidimensional list with some value | < > | < < < < | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | # puts "D1 ($diffs1)" # puts "D2 ($diffs2)" # puts "S $sumsame D $sumdiff1 D $sumdiff2" return [expr {$sumsame - [maxAbs $sumdiff1 $sumdiff2]}] } # Initialise a multidimensional list with some value # The args are in the same order as indexes to lset/lindex proc Linit {elem args} { # Go through backwards foreach n [lreverse $args] { set elem [lrepeat $n $elem] } return $elem } # Decide how to display change blocks # This tries to match the lines that resemble each other and put them # next to each other. |
︙ | ︙ | |||
146 147 148 149 150 151 152 | } # Start with a check if the theoretical best works, since often that # is the case. set order 1 set result $origresult for {set i 0} {$i < ($size1 - 1)} {incr i} { | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | } # Start with a check if the theoretical best works, since often that # is the case. set order 1 set result $origresult for {set i 0} {$i < ($size1 - 1)} {incr i} { if {[lindex $result $i] >= [lindex $result [+ $i 1]]} { set order 0 break } } if {$order} { #puts "ORDER" return $origresult |
︙ | ︙ |
Changes to src/eskil.tcl.
︙ | ︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | set ::eskil(argc) $::argc set ::argv {} set ::argc 0 set debug 1 set diffver "Version 2.4+ 2009-02-12" set ::thisScript [file join [pwd] [info script]] # Do initalisations for needed packages and globals. # This is not run until needed to speed up command line error reporting. proc Init {} { package require Tk 8.4 catch {package require textSearch} package require wcb | > > > > > | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | set ::eskil(argc) $::argc set ::argv {} set ::argc 0 set debug 1 set diffver "Version 2.4+ 2009-02-12" set ::thisScript [file join [pwd] [info script]] namespace import tcl::mathop::+ namespace import tcl::mathop::- namespace import tcl::mathop::* namespace import tcl::mathop::/ # Do initalisations for needed packages and globals. # This is not run until needed to speed up command line error reporting. proc Init {} { package require Tk 8.4 catch {package require textSearch} package require wcb |
︙ | ︙ | |||
625 626 627 628 629 630 631 | gets $ch2 apa lappend block2 $apa } set apa [insertMatchingBlocks $top $block1 $block2] if {$apa >= 0} { addChange $top $apa change $line1 $n1 $line2 $n2 } else { | | | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | gets $ch2 apa lappend block2 $apa } set apa [insertMatchingBlocks $top $block1 $block2] if {$apa >= 0} { addChange $top $apa change $line1 $n1 $line2 $n2 } else { addMapLines $top [- $apa] # In this case, a change is not visible return 1 } } else { # No extra parsing at all. for {set t 0} {$t < $n1} {incr t} { gets $ch1 apa |
︙ | ︙ | |||
798 799 800 801 802 803 804 | set rightc 0 set lblock {} set lblockl 0 set rblock {} set rblockl 0 while {$leftc < $leftlen || $rightc < $rightlen} { | | | | 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 | set rightc 0 set lblock {} set lblockl 0 set rblock {} set rblockl 0 while {$leftc < $leftlen || $rightc < $rightlen} { lassign [lindex $leftLines $leftc] lline lmode lstr lassign [lindex $rightLines $rightc] rline rmode rstr # Fix the case where one side's block is empty. # That means that each line not marked should show up on both sides. if {$leftc >= $leftlen} { set lline $leftLine incr leftLine set lmode "" |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | # Note what rows are being displayed set w $::widgets($top,wDiff1) set width [winfo width $w] set height [winfo height $w] set first [$w index @0,0] | | | | 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | # Note what rows are being displayed set w $::widgets($top,wDiff1) set width [winfo width $w] set height [winfo height $w] set first [$w index @0,0] set last [$w index @[- $width 4],[- $height 4]] set first [lindex [split $first .] 0] set last [lindex [split $last .] 0] # Narrow it 5 lines since seeText will try to view 5 lines extra incr first 5 incr last -5 if {$last < $first} { |
︙ | ︙ | |||
1190 1191 1192 1193 1194 1195 1196 | } if {[llength $Pref(regsub)] > 0} { lappend opts -regsub $Pref(regsub) } # Apply nodigit after preprocess if {$Pref(nodigit)} {lappend opts -nodigit} | | | 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 | } if {[llength $Pref(regsub)] > 0} { lappend opts -regsub $Pref(regsub) } # Apply nodigit after preprocess if {$Pref(nodigit)} {lappend opts -nodigit} # If a special file for diffing is present, use it. if {[info exists ::diff($top,leftFileDiff)]} { set dFile1 $::diff($top,leftFileDiff) } else { set dFile1 $::diff($top,leftFile) } if {[info exists ::diff($top,rightFileDiff)]} { set dFile2 $::diff($top,rightFileDiff) |
︙ | ︙ | |||
1240 1241 1242 1243 1244 1245 1246 | set ch2 [open $::diff($top,rightFile)] set doingLine1 1 set doingLine2 1 # If there is a range, skip lines up to the range if {[llength $range] != 0} { disallowEdit $top | | | | 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | set ch2 [open $::diff($top,rightFile)] set doingLine1 1 set doingLine2 1 # If there is a range, skip lines up to the range if {[llength $range] != 0} { disallowEdit $top lassign $range start1 end1 start2 end2 while {$doingLine1 < $start1 && [gets $ch1 line] >= 0} { incr doingLine1 } while {$doingLine2 < $start2 && [gets $ch2 line] >= 0} { incr doingLine2 } } set t 0 foreach i $diffres { lassign $i line1 n1 line2 n2 set notvisible [doText $top $ch1 $ch2 $n1 $n2 $line1 $line2] if {$::diff($top,limitlines) && \ ($::diff($top,mapMax) > $::diff($top,limitlines))} { break } if {$notvisible != 1} { bindHighlight $top |
︙ | ︙ | |||
1279 1280 1281 1282 1283 1284 1285 | update idletasks set t 0 } } # If there is a range, just display the range if {[llength $range] != 0} { | | | 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 | update idletasks set t 0 } } # If there is a range, just display the range if {[llength $range] != 0} { lassign $range start1 end1 start2 end2 } else { set end1 0 set end2 0 } doText $top $ch1 $ch2 0 0 $end1 $end2 # Make sure all text widgets have the same number of lines. |
︙ | ︙ | |||
1482 1483 1484 1485 1486 1487 1488 | proc TextInterceptInsert {w ow index str args} { if {$::diff($w,allowChange) eq "none"} { wcb::cancel return } if {$::diff($w,allowChange) eq "all"} return | | | 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | proc TextInterceptInsert {w ow index str args} { if {$::diff($w,allowChange) eq "none"} { wcb::cancel return } if {$::diff($w,allowChange) eq "all"} return #wcb::cancel - Cancel a widget command #wcb::replace - Replace arguments of a widget command with new ones # Disallow all new lines if {[string first "\n" $str] >= 0} { wcb::cancel return } |
︙ | ︙ | |||
1648 1649 1650 1651 1652 1653 1654 | endUndoBlock $w } # Get the lines involved in the display proc getLinesFromRange {w range} { set from [lindex $range 0] set to [lindex $range 1] | | | | 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 | endUndoBlock $w } # Get the lines involved in the display proc getLinesFromRange {w range} { set from [lindex $range 0] set to [lindex $range 1] lassign [split $from "."] fromr fromi lassign [split $to "."] tor toi if {$toi == 0} {incr tor -1} # Get the corresponding lines in the file set t [$w get $fromr.0 $tor.end] set lines [lsort -integer [regexp -all -inline {\d+} $t]] set froml [lindex $lines 0] set tol [lindex $lines end] |
︙ | ︙ | |||
1699 1700 1701 1702 1703 1704 1705 | } # Get ranges for the change block set range [$w tag ranges hl$hl] set rangeo [$wo tag ranges hl$hl] # Get the lines involved in the block | | | | 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 | } # Get ranges for the change block set range [$w tag ranges hl$hl] set rangeo [$wo tag ranges hl$hl] # Get the lines involved in the block lassign [getLinesFromRange $w $range ] from to froml tol lassign [getLinesFromRange $wo $rangeo] fromo too fromlo tolo # More than one line in the block? set thisSize 0 set otherSize 0 if {$froml ne "" && $tol ne ""} { set thisSize [expr {$tol - $froml + 1}] } |
︙ | ︙ | |||
2000 2001 2002 2003 2004 2005 2006 | } else { set i 0 while 1 { set i [lsearch -integer -start $i $::diff($top,aligns) $leftline] if {$i < 0} break if {($i % 2) == 0} { set ::diff($top,aligns) [lreplace $::diff($top,aligns) \ | | | 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 | } else { set i 0 while 1 { set i [lsearch -integer -start $i $::diff($top,aligns) $leftline] if {$i < 0} break if {($i % 2) == 0} { set ::diff($top,aligns) [lreplace $::diff($top,aligns) \ $i [+ $i 1]] break } incr i } } if {[llength $::diff($top,aligns)] == 0} { |
︙ | ︙ | |||
2101 2102 2103 2104 2105 2106 2107 | } set text [$wd get {*}$range] set ::diff($top,separatetext$n) $text # Get the lines involved in the display set from [lindex $range 0] set to [lindex $range 1] | | | | 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 | } set text [$wd get {*}$range] set ::diff($top,separatetext$n) $text # Get the lines involved in the display set from [lindex $range 0] set to [lindex $range 1] lassign [split $from "."] froml fromi lassign [split $to "."] tol toi if {$toi == 0} {incr tol -1} # Get the corresponding lines in the file set t [$wl get $froml.0 $tol.end] set lines [lsort -integer [regexp -all -inline {\d+} $t]] set froml [lindex $lines 0] set tol [lindex $lines end] set ::diff($top,separatelines$n) [list $froml $tol] |
︙ | ︙ | |||
2376 2377 2378 2379 2380 2381 2382 | ttk::entryX $w -style TLabel $w configure {*}$args $w configure -takefocus 0 -state readonly ;#-readonlybackground $bg set i [lsearch $args -textvariable] if {$i >= 0} { | | | 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 | ttk::entryX $w -style TLabel $w configure {*}$args $w configure -takefocus 0 -state readonly ;#-readonlybackground $bg set i [lsearch $args -textvariable] if {$i >= 0} { set var [lindex $args [+ $i 1]] uplevel \#0 "trace variable $var w \ {after idle {$w xview end} ;#}" } } # Fill in default data for a diff window proc initDiffData {top} { |
︙ | ︙ | |||
3234 3235 3236 3237 3238 3239 3240 | puts {Usage: eskil [options] [file1] [file2] [options] See below. [file1],[file2] Files to be compared If no files are given, the program is started anyway and you can select files from within. If only one file is given, the program | | | 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 | puts {Usage: eskil [options] [file1] [file2] [options] See below. [file1],[file2] Files to be compared If no files are given, the program is started anyway and you can select files from within. If only one file is given, the program looks for version control of the file, and if found, runs in version control mode. Options: -nodiff : Normally, if there are enough information on the command line to run diff, Eskil will do so unless this option is specified. -dir : Start in directory diff mode. Ignores other args. |
︙ | ︙ | |||
3272 3273 3274 3275 3276 3277 3278 | -nonewline : Try to ignore newline changes. -nonewline+ : Try to ignore newline changes, and don't display. -prefix <str> : Care mainly about words starting with "str". -preprocess <pair> : TBW -r <ver> : Version info for version control mode. | | | | 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 | -nonewline : Try to ignore newline changes. -nonewline+ : Try to ignore newline changes, and don't display. -prefix <str> : Care mainly about words starting with "str". -preprocess <pair> : TBW -r <ver> : Version info for version control mode. -cvs : Detect CVS first, if multiple version systems are used. -svn : Detect SVN first, if multiple version systems are used. -conflict : Treat file as a merge conflict file and enter merge mode. -o <file> : Specify merge result output file. -browse : Automatically bring up file dialog after starting. -server : Set up Eskil to be controllable from the outside. |
︙ | ︙ | |||
3308 3309 3310 3311 3312 3313 3314 | set ::eskil(ignorenewline) 0 if {$::eskil(argc) == 0} { Init makeDiffWin return } | | | 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 | set ::eskil(ignorenewline) 0 if {$::eskil(argc) == 0} { Init makeDiffWin return } set allOpts { -w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix -noparse -line -smallblock -block -char -word -limit -nodiff -dir -clip -patch -browse -conflict -print -printps -printpdf -server -o -r -context -cvs -svn -review -foreach -preprocess -close -nonewline -plugin -plugininfo -plugindump |
︙ | ︙ | |||
3400 3401 3402 3403 3404 3405 3406 | # If not, let it fall through to the file check. if {[lsearch -exact $allOpts $arg] < 0} { set match [lsearch -glob -all -inline $allOpts $arg*] if {[llength $match] == 1} { set arg [lindex $match 0] } } | | | 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 | # If not, let it fall through to the file check. if {[lsearch -exact $allOpts $arg] < 0} { set match [lsearch -glob -all -inline $allOpts $arg*] if {[llength $match] == 1} { set arg [lindex $match 0] } } if {$arg eq "-w"} { set Pref(ignore) "-w" } elseif {$arg eq "--help" || $arg eq "-help"} { printUsage exit } elseif {$arg eq "-b"} { set Pref(ignore) "-b" |
︙ | ︙ | |||
3759 3760 3761 3762 3763 3764 3765 | set Pref(marklast) 1 set Pref(linewidth) 80 set Pref(lines) 60 set Pref(editor) "" set Pref(regsub) {} set Pref(toolbar) 0 set Pref(wideMap) 0 ;# Not settable in GUI yet | | | 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 | set Pref(marklast) 1 set Pref(linewidth) 80 set Pref(lines) 60 set Pref(editor) "" set Pref(regsub) {} set Pref(toolbar) 0 set Pref(wideMap) 0 ;# Not settable in GUI yet # Print options set Pref(grayLevel1) 0.6 set Pref(grayLevel2) 0.8 set Pref(wideLines) 0 set Pref(printHeaderSize) 10 set Pref(printCharsPerLine) 80 set Pref(printPaper) a4 |
︙ | ︙ |
Changes to src/help.tcl.
︙ | ︙ | |||
165 166 167 168 169 170 171 172 173 174 175 176 177 178 | } proc createDocFonts {} { if {[catch {font create docFont -family Helvetica -size -16}]} return font create docFontB {*}[font configure docFont] -weight bold set h [font metrics docFont -linespace] set t [expr {-$h + 4}] font create docFontP -family Courier -size $t for {} {$t > -20} {incr t -1} { font configure docFontP -size $t if {[font metrics docFontP -linespace] >= $h} break } } | > | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | } proc createDocFonts {} { if {[catch {font create docFont -family Helvetica -size -16}]} return font create docFontB {*}[font configure docFont] -weight bold set h [font metrics docFont -linespace] # Use negative size to get pixels. Search from small to bigger set t [expr {-$h + 4}] font create docFontP -family Courier -size $t for {} {$t > -20} {incr t -1} { font configure docFontP -size $t if {[font metrics docFontP -linespace] >= $h} break } } |
︙ | ︙ |
Changes to src/map.tcl.
︙ | ︙ | |||
75 76 77 78 79 80 81 | set h [winfo height $top.c_map] set x2 [expr {$w - ($Pref(wideMap) ? 5 : 1)}] if {$x2 < 0} { set x2 0 } map$top configure -width $w -height $h incr h -1 set y0 0 foreach change $::diff($top,changes) { | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | set h [winfo height $top.c_map] set x2 [expr {$w - ($Pref(wideMap) ? 5 : 1)}] if {$x2 < 0} { set x2 0 } map$top configure -width $w -height $h incr h -1 set y0 0 foreach change $::diff($top,changes) { lassign $change start length type set y1 [expr {$start * $h / $::diff($top,mapMax) + 1}] if {!$y0} { set y0 $y1 } ;# Record first occurance if {$y1 < 1} {set y1 1} if {$y1 > $h} {set y1 $h} set y2 [expr {($start + $length) * $h / $::diff($top,mapMax) + 1}] if {$y2 < 1} {set y2 1} if {$y2 <= $y1} {set y2 [expr {$y1 + 1}]} |
︙ | ︙ |
Changes to src/merge.tcl.
︙ | ︙ | |||
37 38 39 40 41 42 43 | set ch1 [open $::diff($top,leftFile) r] set ch2 [open $::diff($top,rightFile) r] set doingLine1 1 set doingLine2 1 set changeNo 0 foreach change $::diff($top,changes) { | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | set ch1 [open $::diff($top,leftFile) r] set ch2 [open $::diff($top,rightFile) r] set doingLine1 1 set doingLine2 1 set changeNo 0 foreach change $::diff($top,changes) { lassign $change start length type line1 n1 line2 n2 set data1 {} set data2 {} while {$doingLine1 < $line1} { gets $ch1 apa append data1 $apa\n incr doingLine1 } |
︙ | ︙ |
Changes to src/print.tcl.
︙ | ︙ | |||
18 19 20 21 22 23 24 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- | < < < < | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- # Format a line number for printing # It will always be maxlen chars wide. proc FormatLineno {lineno maxlen} { if {[string is integer -strict $lineno]} { set res [format "%d: " $lineno] } else { # Non-numerical linenumbers might turn up in some cases set res $lineno if {[string length $res] > $maxlen} { set res [string range $res 0 [- $maxlen 1]] } } if {[string length $res] < $maxlen} { set res [format "%*s" $maxlen $res] } return $res } |
︙ | ︙ | |||
200 201 202 203 204 205 206 | if {[string index $value end] eq "\n"} { set newline 1 set value [string trimright $value "\n"] } set len [string length $value] while {$chars + $len > $wraplength} { set wrap [expr {$wraplength - $chars}] | | | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | if {[string index $value end] eq "\n"} { set newline 1 set value [string trimright $value "\n"] } set len [string length $value] while {$chars + $len > $wraplength} { set wrap [expr {$wraplength - $chars}] set val1 [string range $value 0 [- $wrap 1]] set value [string range $value $wrap end] # The newline has its own element to simplify finding # it later. lappend line $val1 $tag "\n" {} $linepad {} set chars $maxlen incr wrapc set len [string length $value] |
︙ | ︙ |
Changes to src/printobj.tcl.
︙ | ︙ | |||
61 62 63 64 65 66 67 | } destructor { catch {$pdf destroy} } method StartPrint {} { # Page size | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | } destructor { catch {$pdf destroy} } method StartPrint {} { # Page size lassign [$pdf getDrawableArea] width height # Header metrics $pdf setFont $options(-headsize) Courier set headoffset [expr {$options(-headsize) + [$pdf getFontMetric bboxy]}] set hoy $headoffset # Figure out font size from number of chars per line |
︙ | ︙ | |||
106 107 108 109 110 111 112 | # Draw borders $pdf setStrokeColor 0 0 0 $pdf setFillColor 0.0 0.0 0.0 $pdf setLineStyle 0.5 # Outer border $pdf rectangle 0 $options(-headsize) \ | | | | | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | # Draw borders $pdf setStrokeColor 0 0 0 $pdf setFillColor 0.0 0.0 0.0 $pdf setLineStyle 0.5 # Outer border $pdf rectangle 0 $options(-headsize) \ $width [- $height $options(-headsize)] # Center line $pdf line [/ $width 2.0] $options(-headsize) \ [/ $width 2.0] $height # Header $pdf setFont $options(-headsize) Courier $pdf text $options(-headleft) -x 0 -y $hoy $pdf text "Page $page of $options(-headnpages)" \ -x [expr {$width / 2.0}] -y $hoy -align center $pdf text $options(-headright) -x $width -y $hoy -align right |
︙ | ︙ |
Changes to src/rev.tcl.
︙ | ︙ | |||
568 569 570 571 572 573 574 | } else { # Get a list from the log if {$filename eq ""} { set filename "." } set cmd [list svn log -q [file nativename $filename]] set revs [eskil::rev::SVN::GetRevList $filename] | | | | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | } else { # Get a list from the log if {$filename eq ""} { set filename "." } set cmd [list svn log -q [file nativename $filename]] set revs [eskil::rev::SVN::GetRevList $filename] set rev [lindex $revs [- $rev]] if {$rev eq ""} { set rev [lindex $revs end] } } } lappend result $rev } return $result } # Figure out ClearCase revision from arguments proc eskil::rev::CT::ParseRevs {filename revs} { if {$filename eq ""} { # CT does not support tree versions return {} } set tmp [eskil::rev::CT::current $filename] lassign $tmp stream latest if {[llength $revs] == 0} { return [list [file join $stream $latest]] } set result {} foreach rev $revs { # A negative version number is offset from latest. |
︙ | ︙ |
Changes to tests/all.tcl.
1 2 3 4 5 | #!/bin/sh #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- # the next line restarts using tclsh \ | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/bin/sh #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- # the next line restarts using tclsh \ exec tclsh8.5 "$0" "$@" set testScript [file normalize [file join [pwd] [info script]]] set testDir [file dirname $testScript] lappend auto_path eskil.vfs/lib package require tcltest 2.2 |
︙ | ︙ |
Added tests/procs.test.
> > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Tests for comparing misc procedures. -*- tcl -*- #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- test procs-1.1 { Linit } -body { # Make sure argument ordering is same as lindex lindex [Linit x 3 4 5] 2 3 4 } -result x test procs-1.2 { Linit } -body { lindex [Linit x 3 4 5] 4 3 2 } -result {} |