Fossil SCM
The diff --tk option shows an error message on the display if it encounters an input line that it does not understand. This means that "cannot compute difference between binary files" errors, and similar, are dealt with correctly.
Commit
86f0722e0cb0978d4dabfbfa65f550ffced769c6a0c19a38e75004833acf3ca2
Parent
99f93d9231c6044…
1 file changed
+5
-1
+5
-1
| --- src/diff.tcl | ||
| +++ src/diff.tcl | ||
| @@ -162,11 +162,15 @@ | ||
| 162 | 162 | foreach wx [list [string length $n1] [string length $n2]] { |
| 163 | 163 | if {$wx>$widths(ln)} {set widths(ln) $wx} |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | default { |
| 167 | - error "bad diff source line: $line" | |
| 167 | + .lnA insert end \n - | |
| 168 | + .txtA insert end $line\n err | |
| 169 | + .mkr insert end \n - | |
| 170 | + .lnB insert end \n - | |
| 171 | + .txtB insert end $line\n err | |
| 168 | 172 | } |
| 169 | 173 | } |
| 170 | 174 | } |
| 171 | 175 | |
| 172 | 176 | foreach c [cols] { |
| 173 | 177 |
| --- src/diff.tcl | |
| +++ src/diff.tcl | |
| @@ -162,11 +162,15 @@ | |
| 162 | foreach wx [list [string length $n1] [string length $n2]] { |
| 163 | if {$wx>$widths(ln)} {set widths(ln) $wx} |
| 164 | } |
| 165 | } |
| 166 | default { |
| 167 | error "bad diff source line: $line" |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | foreach c [cols] { |
| 173 |
| --- src/diff.tcl | |
| +++ src/diff.tcl | |
| @@ -162,11 +162,15 @@ | |
| 162 | foreach wx [list [string length $n1] [string length $n2]] { |
| 163 | if {$wx>$widths(ln)} {set widths(ln) $wx} |
| 164 | } |
| 165 | } |
| 166 | default { |
| 167 | .lnA insert end \n - |
| 168 | .txtA insert end $line\n err |
| 169 | .mkr insert end \n - |
| 170 | .lnB insert end \n - |
| 171 | .txtB insert end $line\n err |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | foreach c [cols] { |
| 177 |