Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Bugfix in nocase. Added -r support to ClearCase diff. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
d883625aa5f88a16d9425da6a26bf52f |
User & Date: | peter 2004-06-24 15:08:40.000 |
Context
2004-06-24
| ||
15:40 | Refactored revision file code. check-in: b0d3145067 user: peter tags: trunk | |
15:08 | Bugfix in nocase. Added -r support to ClearCase diff. check-in: d883625aa5 user: peter tags: trunk | |
2004-06-22
| ||
19:48 | Changed DiffUtil link to binary version. check-in: c21279fd49 user: peter tags: trunk | |
Changes
Changes to src/eskil.tcl.
︙ | ︙ | |||
47 48 49 50 51 52 53 | # Add a dummy if it does not exist. proc addBalloon {args} {} } else { namespace import -force psballoon::addBalloon } set debug 0 | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | # Add a dummy if it does not exist. proc addBalloon {args} {} } else { namespace import -force psballoon::addBalloon } set debug 0 set diffver "Version 2.0.4+ 2004-06-24" set thisScript [file join [pwd] [info script]] set thisDir [file dirname $thisScript] # Follow any link set tmplink $thisScript while {[file type $tmplink] eq "link"} { set tmplink [file readlink $tmplink] |
︙ | ︙ | |||
177 178 179 180 181 182 183 | } } # Compare two lines and rate how much they resemble each other. # This has never worked well. Some day I'll sit down, think this through, # and come up with a better algorithm. proc compareLines2 {line1 line2} { | > > | | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | } } # Compare two lines and rate how much they resemble each other. # This has never worked well. Some day I'll sit down, think this through, # and come up with a better algorithm. proc compareLines2 {line1 line2} { set opts $::Pref(ignore) if {$::Pref(nocase)} {lappend opts -nocase} set res [eval DiffUtil::diffStrings $opts \$line1 \$line2] # Collect identical pieces and different pieces set sames {} set diffs1 {} set diffs2 {} foreach {same1 same2 diff1 diff2} $res { lappend sames $same1 |
︙ | ︙ | |||
1143 1144 1145 1146 1147 1148 1149 | lappend revs $::diff($top,doptrev2) } switch [llength $revs] { 0 { # Compare local file with latest version. set ::diff($top,leftFile) [tmpFile] | | | | | | | | | | | | | | | | | | | | | | | < < < < | < | | < | | > > > | > > > > > > > > > > > > > > > > > | > > > > > > > | > > > | > | | > > > > > > > > > > > > > > > > > > > > > > > > > > | 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 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 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 | lappend revs $::diff($top,doptrev2) } switch [llength $revs] { 0 { # Compare local file with latest version. set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightLabel) $::diff($top,RevFile) set ::diff($top,rightFile) $::diff($top,RevFile) if {$::diff($top,mode) eq "CVS"} { set ::diff($top,leftLabel) "$::diff($top,RevFile) (CVS)" execCvsUpdate $::diff($top,RevFile) $::diff($top,leftFile) } else { set ::diff($top,leftLabel) "$::diff($top,RevFile) (RCS)" catch {exec co -p [file nativename $::diff($top,RevFile)] \ > $::diff($top,leftFile)} } } 1 { # Compare local file with specified version. set r [lindex $revs 0] set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightLabel) $::diff($top,RevFile) set ::diff($top,rightFile) $::diff($top,RevFile) if {$::diff($top,mode) eq "CVS"} { set ::diff($top,leftLabel) "$::diff($top,RevFile) (CVS $r)" execCvsUpdate $::diff($top,RevFile) $::diff($top,leftFile) -r $r } else { set ::diff($top,leftLabel) "$::diff($top,RevFile) (RCS $r)" catch {exec co -p$r [file nativename $::diff($top,RevFile)] \ > $::diff($top,leftFile)} } } default { # Compare the two specified versions. set r1 [lindex $revs 0] set r2 [lindex $revs 1] set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightFile) [tmpFile] if {$::diff($top,mode) eq "CVS"} { set ::diff($top,leftLabel) "$::diff($top,RevFile) (CVS $r1)" set ::diff($top,rightLabel) "$::diff($top,RevFile) (CVS $r2)" execCvsUpdate $::diff($top,RevFile) $::diff($top,leftFile) -r $r1 execCvsUpdate $::diff($top,RevFile) $::diff($top,rightFile) -r $r2 } else { set ::diff($top,leftLabel) "$::diff($top,RevFile) (RCS $r1)" set ::diff($top,rightLabel) "$::diff($top,RevFile) (RCS $r2)" catch {exec co -p$r1 [file nativename $::diff($top,RevFile)] \ > $::diff($top,leftFile)} catch {exec co -p$r2 [file nativename $::diff($top,RevFile)] \ > $::diff($top,rightFile)} } } } # Make sure labels are updated before processing starts update idletasks } # Clean up after a RCS/CVS/CT diff. proc cleanupRCS {top} { global Pref clearTmp $::diff($top,rightFile) $::diff($top,leftFile) set ::diff($top,rightFile) $::diff($top,RevFile) set ::diff($top,leftFile) $::diff($top,RevFile) } # Prepare for ClearCase diff. Checkout copies of the versions needed. proc prepareClearCase {top} { global Pref # Figure out stream and current version if {[catch {exec cleartool ls $::diff($top,RevFile)} info]} { puts "Cleartool error: $info" return } set currV {} if {![regexp {@@(\S+)\s+from (\S+)\s+Rule} $info -> dummy currV]} { regexp {@@(\S+)} $info -> currV } set stream [file dirname $currV] set latest [file tail $currV] # Search for revision options set revs {} if {$::diff($top,doptrev1) != ""} { lappend revs $::diff($top,doptrev1) } if {$::diff($top,doptrev2) != ""} { lappend revs $::diff($top,doptrev2) } foreach rev $revs { if {![string is digit -strict $rev] || $rev < 0 || $rev > $latest} { puts "Bad revision '$rev'" return } } if {[llength $revs] == 0} { lappend revs $latest } switch [llength $revs] { 1 { # Compare local file with specified version. set r [lindex $revs 0] set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightLabel) $::diff($top,RevFile) set ::diff($top,rightFile) $::diff($top,RevFile) set ::diff($top,leftLabel) "$::diff($top,RevFile) (CT $r)" set filerev [file nativename \ $::diff($top,RevFile)@@[file join $stream $r]] if {[catch {exec cleartool get -to $::diff($top,leftFile) \ $filerev} msg]} { puts "Cleartool error: $msg" return } } default { # Compare the two specified versions. set r1 [lindex $revs 0] set r2 [lindex $revs 1] set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightFile) [tmpFile] set ::diff($top,leftLabel) "$::diff($top,RevFile) (CT $r1)" set ::diff($top,rightLabel) "$::diff($top,RevFile) (CT $r2)" set filerev1 [file nativename \ $::diff($top,RevFile)@@[file join $stream $r1]] set filerev2 [file nativename \ $::diff($top,RevFile)@@[file join $stream $r2]] if {[catch {exec cleartool get -to $::diff($top,leftFile) \ $filerev1} msg]} { puts "Cleartool error: $msg" return } if {[catch {exec cleartool get -to $::diff($top,rightFile) \ $filerev2} msg]} { puts "Cleartool error: $msg" return } } } } # Prepare for a diff by creating needed temporary files proc prepareFiles {top} { set ::diff($top,cleanup) "" if {$::diff($top,mode) eq "RCS" || $::diff($top,mode) eq "CVS"} { |
︙ | ︙ | |||
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 | } set range {} if {[info exists ::diff($top,range)] && \ [llength $::diff($top,range)] == 4} { set range $::diff($top,range) lappend opts -range $range } set differr [catch {eval DiffUtil::diffFiles $opts \ \$::diff($top,leftFile) \$::diff($top,rightFile)} diffres] # In conflict mode we can use the diff information collected when # parsing the conflict file. This makes sure the blocks in the conflict # file become change-blocks during merge. if {$::diff($top,mode) eq "conflictPure"} { | > | 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 | } set range {} if {[info exists ::diff($top,range)] && \ [llength $::diff($top,range)] == 4} { set range $::diff($top,range) lappend opts -range $range } set differr [catch {eval DiffUtil::diffFiles $opts \ \$::diff($top,leftFile) \$::diff($top,rightFile)} diffres] # In conflict mode we can use the diff information collected when # parsing the conflict file. This makes sure the blocks in the conflict # file become change-blocks during merge. if {$::diff($top,mode) eq "conflictPure"} { |
︙ | ︙ | |||
1634 1635 1636 1637 1638 1639 1640 | doDiff $top } } proc openRCS {top} { if {[doOpenRight $top]} { set ::diff($top,mode) "RCS" | | | | 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 | doDiff $top } } proc openRCS {top} { if {[doOpenRight $top]} { set ::diff($top,mode) "RCS" set ::diff($top,RevFile) $::diff($top,rightFile) set ::diff($top,leftLabel) "RCS" set ::diff($top,leftOK) 0 doDiff $top } } proc openCVS {top} { if {[doOpenRight $top]} { set ::diff($top,mode) "CVS" set ::diff($top,RevFile) $::diff($top,rightFile) set ::diff($top,leftLabel) "CVS" set ::diff($top,leftOK) 0 doDiff $top } } proc openBoth {top forget} { |
︙ | ︙ | |||
4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 | $w.t insert end "A Tcl/Tk frontend to diff\n\n" $w.t insert end "$diffver\n\n" $w.t insert end "Made by Peter Spjuth\n" $w.t insert end "E-Mail: peter.spjuth@space.se\n" $w.t insert end "\nURL: http://spjuth.pointclark.net/Eskil.html\n" $w.t insert end "\nTcl version: [info patchlevel]\n" $w.t insert end "\nCredits:\n" $w.t insert end "Ideas for scrollbar map and merge function\n" $w.t insert end "taken from TkDiff" set last [lindex [split [$w.t index end] "."] 0] $w.t configure -height $last $w.t configure -state disabled | > | 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 | $w.t insert end "A Tcl/Tk frontend to diff\n\n" $w.t insert end "$diffver\n\n" $w.t insert end "Made by Peter Spjuth\n" $w.t insert end "E-Mail: peter.spjuth@space.se\n" $w.t insert end "\nURL: http://spjuth.pointclark.net/Eskil.html\n" $w.t insert end "\nTcl version: [info patchlevel]\n" $w.t insert end "DiffUtil version: [package provide DiffUtil]\n" $w.t insert end "\nCredits:\n" $w.t insert end "Ideas for scrollbar map and merge function\n" $w.t insert end "taken from TkDiff" set last [lindex [split [$w.t index end] "."] 0] $w.t configure -height $last $w.t configure -state disabled |
︙ | ︙ | |||
4575 4576 4577 4578 4579 4580 4581 | } if {!$autobrowse} { # Check for revision control # RCS if {[llength [glob -nocomplain [file join $fulldir RCS]]]} { set ::diff($top,mode) "RCS" set ::diff($top,rightDir) $fulldir | | | | | 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 | } if {!$autobrowse} { # Check for revision control # RCS if {[llength [glob -nocomplain [file join $fulldir RCS]]]} { set ::diff($top,mode) "RCS" set ::diff($top,rightDir) $fulldir set ::diff($top,RevFile) $fullname set ::diff($top,rightLabel) $fullname set ::diff($top,rightFile) $fullname set ::diff($top,rightOK) 1 set ::diff($top,leftLabel) "RCS" if {$noautodiff} { enableRedo $top } else { after idle [list doDiff $top] } return } # CVS if {[llength [glob -nocomplain [file join $fulldir CVS]]]} { set ::diff($top,mode) "CVS" set ::diff($top,rightDir) $fulldir set ::diff($top,RevFile) $fullname set ::diff($top,rightLabel) $fullname set ::diff($top,rightFile) $fullname set ::diff($top,rightOK) 1 set ::diff($top,leftLabel) "CVS" if {$noautodiff} { enableRedo $top } else { after idle [list doDiff $top] } return } # ClearCase if {[auto_execok cleartool] != ""} { if {![catch {exec cleartool pwv -s} view] && \ $view != "** NONE **"} { set ::diff($top,mode) "CT" set ::diff($top,rightDir) $fulldir set ::diff($top,RevFile) $fullname set ::diff($top,rightLabel) $fullname set ::diff($top,rightFile) $fullname set ::diff($top,rightOK) 1 set ::diff($top,leftLabel) "CT" if {$noautodiff} { enableRedo $top } else { |
︙ | ︙ | |||
4677 4678 4679 4680 4681 4682 4683 | if {[tk_messageBox -title Diff -icon question \ -message "Do CVS diff?" -type yesno] eq "yes"} { set fulldir $::diff($top,leftDir) set fullname $::diff($top,leftFile) set ::diff($top,leftOK) 0 set ::diff($top,mode) "CVS" set ::diff($top,rightDir) $fulldir | | | 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 | if {[tk_messageBox -title Diff -icon question \ -message "Do CVS diff?" -type yesno] eq "yes"} { set fulldir $::diff($top,leftDir) set fullname $::diff($top,leftFile) set ::diff($top,leftOK) 0 set ::diff($top,mode) "CVS" set ::diff($top,rightDir) $fulldir set ::diff($top,RevFile) $fullname set ::diff($top,rightLabel) $fullname set ::diff($top,rightFile) $fullname set ::diff($top,rightOK) 1 set ::diff($top,leftLabel) "CVS" after idle [list doDiff $top] } } |
︙ | ︙ |