Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Make command line opts propagate to all windows |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e63d2b620546480681b67df70378c4d0 |
User & Date: | peter 2014-11-18 23:51:32.186 |
Context
2014-11-18
| ||
23:58 | Use underscore as internal magic revision number for "current" check-in: d10147b123 user: peter tags: trunk | |
23:51 | Make command line opts propagate to all windows check-in: e63d2b6205 user: peter tags: trunk | |
23:22 | Extend dirdiff support to GIT check-in: e77266d088 user: peter tags: trunk | |
Changes
Changes to plugins/keyword.tcl.
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | } # To be used in directory diff, a plugin must define this procedure. # ch1: An input channel for reading the first file. # ch2: An input channel for reading the second file. # info1: A dictionary with info about the first file. # info2: A dictionary with info about the second file. proc FileCompare {ch1 ch2 info1 info2} { set bufsz 65536 # Assume that all keywords are in the first block set f1 [read $ch1 $bufsz] set f2 [read $ch2 $bufsz] regsub -all {\$\w+:[^\$]*\$} $f1 {} f1 regsub -all {\$\w+:[^\$]*\$} $f2 {} f2 | > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | } # To be used in directory diff, a plugin must define this procedure. # ch1: An input channel for reading the first file. # ch2: An input channel for reading the second file. # info1: A dictionary with info about the first file. # info2: A dictionary with info about the second file. # Info dictionaries contain at least elements "name" and "size". proc FileCompare {ch1 ch2 info1 info2} { set bufsz 65536 # Assume that all keywords are in the first block set f1 [read $ch1 $bufsz] set f2 [read $ch2 $bufsz] regsub -all {\$\w+:[^\$]*\$} $f1 {} f1 regsub -all {\$\w+:[^\$]*\$} $f2 {} f2 |
︙ | ︙ |
Changes to src/dirdiff.tcl.
︙ | ︙ | |||
1260 1261 1262 1263 1264 1265 1266 | grid $top.l1 $top.e1 -sticky we grid $top.l2 $top.e2 -sticky we grid columnconfigure $top 1 -weight 1 grid rowconfigure $top 2 -weight 1 } | | < < < < < | | > | | 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | grid $top.l1 $top.e1 -sticky we grid $top.l2 $top.e2 -sticky we grid columnconfigure $top 1 -weight 1 grid rowconfigure $top 2 -weight 1 } proc makeDirDiffWin {} { if {![info exists ::dirdiff(leftDir)]} { set ::dirdiff(leftDir) "" } if {![info exists ::dirdiff(rightDir)]} { set ::dirdiff(rightDir) "" } set ::eskil(.dirdiff,plugin) "" foreach {item val} $::eskil(defaultopts) { set ::eskil(.dirdiff,$item) $val } # Support -r for directory diff set revs {} array set opts $::eskil(defaultopts) if {[info exists opts(doptrev1)] && $opts(doptrev1) ne ""} { lappend revs $opts(doptrev1) } if {[info exists opts(doptrev2)] && $opts(doptrev2) ne ""} { lappend revs $opts(doptrev2) } if {$::dirdiff(leftDir) eq $::dirdiff(rightDir)} { set fullname $::dirdiff(leftDir) set type [detectRevSystem $fullname] # Is this a revision system with dirdiff support? if {[info commands eskil::rev::${type}::mount] ne ""} { # No -r given; fall back on current. # Note: Only fossil/svn/git supports 0 for current currently if {[llength $revs] == 0} {set revs 0} set revs [eskil::rev::${type}::ParseRevs $fullname $revs] set rev1 [lindex $revs 0] set rev2 [lindex $revs 1] # A little "splash-screen" to show progress destroy .dirdiffX |
︙ | ︙ |
Changes to src/eskil.tcl.
︙ | ︙ | |||
2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 | set ::eskil($top,mode) "" set ::eskil($top,printFile) "" set ::eskil($top,mergeFile) "" set ::eskil($top,ancestorFile) "" set ::eskil($top,conflictFile) "" set ::eskil($top,limitlines) 0 set ::eskil($top,plugin) "" } # Create a new diff window and diff two files proc newDiff {file1 file2 {range {}}} { set top [makeDiffWin] update | > > > > > | 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 | set ::eskil($top,mode) "" set ::eskil($top,printFile) "" set ::eskil($top,mergeFile) "" set ::eskil($top,ancestorFile) "" set ::eskil($top,conflictFile) "" set ::eskil($top,limitlines) 0 set ::eskil($top,plugin) "" # Copy the collected options from command line foreach {item val} $::eskil(defaultopts) { set ::eskil($top,$item) $val } } # Create a new diff window and diff two files proc newDiff {file1 file2 {range {}}} { set top [makeDiffWin] update |
︙ | ︙ | |||
3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 | # This can be used as an entry point if embedding eskil. # In that case fill in ::eskil(argv) and ::eskil(argc) before calling. proc parseCommandLine {} { global dirdiff set ::eskil(autoclose) 0 set ::eskil(ignorenewline) 0 if {$::eskil(argc) == 0} { Init return [makeDiffWin] } set allOpts { | > | 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 | # This can be used as an entry point if embedding eskil. # In that case fill in ::eskil(argv) and ::eskil(argc) before calling. proc parseCommandLine {} { global dirdiff set ::eskil(autoclose) 0 set ::eskil(ignorenewline) 0 set ::eskil(defaultopts) {} if {$::eskil(argc) == 0} { Init return [makeDiffWin] } set allOpts { |
︙ | ︙ | |||
4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | exit } set opts(plugin) $pinterp set opts(pluginname) $plugin set opts(plugininfo) $plugininfo } # Do we start in clip diff mode? if {$doclip} { return [makeClipDiffWin] } # Figure out if we start in a diff or dirdiff window. set len [llength $files] if {$len == 0 && $dodir} { set dirdiff(leftDir) [pwd] set dirdiff(rightDir) [pwd] | > > > | | | < < < < | 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 | exit } set opts(plugin) $pinterp set opts(pluginname) $plugin set opts(plugininfo) $plugininfo } # Store the command line given opts set ::eskil(defaultopts) [array get opts] # Do we start in clip diff mode? if {$doclip} { return [makeClipDiffWin] } # Figure out if we start in a diff or dirdiff window. set len [llength $files] if {$len == 0 && $dodir} { set dirdiff(leftDir) [pwd] set dirdiff(rightDir) [pwd] return [makeDirDiffWin] } if {$len == 1} { set fullname [lindex $files 0] if {[FileIsDirectory $fullname 1]} { set dirdiff(leftDir) $fullname set dirdiff(rightDir) $dirdiff(leftDir) return [makeDirDiffWin] } } elseif {$len >= 2} { set fullname1 [lindex $files 0] set fullname2 [lindex $files 1] if {[FileIsDirectory $fullname1 1] && [FileIsDirectory $fullname2 1]} { set dirdiff(leftDir) $fullname1 set dirdiff(rightDir) $fullname2 return [makeDirDiffWin] } } # Ok, we have a normal diff set top [makeDiffWin] update # It is preferable to see the end if the rev string is too long $::widgets($top,rev1) xview end $::widgets($top,rev2) xview end if {$doreview} { set rev [detectRevSystem "" $preferedRev] |
︙ | ︙ | |||
4307 4308 4309 4310 4311 4312 4313 | foreach file $files { if {$first} { set first 0 } else { # Create new window for other files set top [makeDiffWin] update | < < < < | 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 | foreach file $files { if {$first} { set first 0 } else { # Create new window for other files set top [makeDiffWin] update # It is preferable to see the end if the rev string is too long $::widgets($top,rev1) xview end $::widgets($top,rev2) xview end } set fullname $file set fulldir [file dirname $fullname] if {$::eskil($top,mode) eq "conflict"} { |
︙ | ︙ |
Changes to src/rev.tcl.
︙ | ︙ | |||
680 681 682 683 684 685 686 687 688 689 690 691 692 693 | } # Figure out GIT revision from arguments proc eskil::rev::GIT::ParseRevs {filename revs} { set result "" foreach rev $revs { switch -glob -- $rev { HEAD - master - * { # Let anything through for now lappend result $rev } } } return $result } | > > > | 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | } # Figure out GIT revision from arguments proc eskil::rev::GIT::ParseRevs {filename revs} { set result "" foreach rev $revs { switch -glob -- $rev { 0 { lappend result HEAD } HEAD - master - * { # Let anything through for now lappend result $rev } } } return $result } |
︙ | ︙ |