Fossil SCM
Show "error" messages in Tk diff.
Commit
d4fea96ad82d90ec727e8ef1a3b03251c6f450c3
Parent
b8e61d24f825938…
1 file changed
+13
-3
+13
-3
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -628,10 +628,11 @@ | ||
| 628 | 628 | @ HR_PAD_TOP 4 |
| 629 | 629 | @ HR_PAD_BTM 8 |
| 630 | 630 | @ FN_BG #444444 |
| 631 | 631 | @ FN_FG #ffffff |
| 632 | 632 | @ FN_PAD 5 |
| 633 | +@ ERR_FG #ee0000 | |
| 633 | 634 | @ PADX 5 |
| 634 | 635 | @ WIDTH 80 |
| 635 | 636 | @ HEIGHT 45 |
| 636 | 637 | @ LB_HEIGHT 25 |
| 637 | 638 | @ } |
| @@ -680,20 +681,21 @@ | ||
| 680 | 681 | @ if {![regexp {^=+ (.*?) =+ versus =+ (.*?) =+$} $line all fn fn2] |
| 681 | 682 | @ && ![regexp {^=+ (.*?) =+$} $line all fn] |
| 682 | 683 | @ } { |
| 683 | 684 | @ continue |
| 684 | 685 | @ } |
| 685 | -@ if {[string compare -length 6 [getLine $difftxt $N ii] "<table"]} { | |
| 686 | +@ set errMsg "" | |
| 687 | +@ set line [getLine $difftxt $N ii] | |
| 688 | +@ if {[string compare -length 6 $line "<table"] | |
| 689 | +@ && ![regexp {<p[^>]*>(.+)} $line - errMsg]} { | |
| 686 | 690 | @ continue |
| 687 | 691 | @ } |
| 688 | 692 | @ incr nDiffs |
| 689 | 693 | @ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}] |
| 690 | 694 | @ .wfiles.lb insert end $fn |
| 691 | 695 | @ |
| 692 | 696 | @ foreach c [cols] { |
| 693 | -@ while {[getLine $difftxt $N ii] ne "<pre>"} continue | |
| 694 | -@ | |
| 695 | 697 | @ if {$nDiffs > 1} { |
| 696 | 698 | @ $c insert end \n - |
| 697 | 699 | @ } |
| 698 | 700 | @ if {[colType $c] eq "txt"} { |
| 699 | 701 | @ $c insert end $fn\n fn |
| @@ -701,10 +703,12 @@ | ||
| 701 | 703 | @ } else { |
| 702 | 704 | @ $c insert end \n fn |
| 703 | 705 | @ } |
| 704 | 706 | @ $c insert end \n - |
| 705 | 707 | @ |
| 708 | +@ if {$errMsg ne ""} continue | |
| 709 | +@ while {[getLine $difftxt $N ii] ne "<pre>"} continue | |
| 706 | 710 | @ set type [colType $c] |
| 707 | 711 | @ set str {} |
| 708 | 712 | @ while {[set line [getLine $difftxt $N ii]] ne "</pre>"} { |
| 709 | 713 | @ set len [string length [dehtml $line]] |
| 710 | 714 | @ if {$len > $widths($type)} { |
| @@ -723,10 +727,15 @@ | ||
| 723 | 727 | @ } else { |
| 724 | 728 | @ $c insert end [dehtml $pre] - |
| 725 | 729 | @ } |
| 726 | 730 | @ } |
| 727 | 731 | @ } |
| 732 | +@ | |
| 733 | +@ if {$errMsg ne ""} { | |
| 734 | +@ foreach c {.txtA .txtB} {$c insert end [string trim $errMsg] err} | |
| 735 | +@ foreach c [cols] {$c insert end \n -} | |
| 736 | +@ } | |
| 728 | 737 | @ } |
| 729 | 738 | @ |
| 730 | 739 | @ foreach c [cols] { |
| 731 | 740 | @ set type [colType $c] |
| 732 | 741 | @ if {$type ne "txt"} { |
| @@ -894,10 +903,11 @@ | ||
| 894 | 903 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 895 | 904 | @ $txt tag lower $tag |
| 896 | 905 | @ } |
| 897 | 906 | @ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \ |
| 898 | 907 | @ -justify center |
| 908 | +@ $txt tag config err -foreground $CFG(ERR_FG) | |
| 899 | 909 | @ } |
| 900 | 910 | @ text .mkr |
| 901 | 911 | @ |
| 902 | 912 | @ foreach c [cols] { |
| 903 | 913 | @ set keyPrefix [string toupper [colType $c]]_COL_ |
| 904 | 914 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -628,10 +628,11 @@ | |
| 628 | @ HR_PAD_TOP 4 |
| 629 | @ HR_PAD_BTM 8 |
| 630 | @ FN_BG #444444 |
| 631 | @ FN_FG #ffffff |
| 632 | @ FN_PAD 5 |
| 633 | @ PADX 5 |
| 634 | @ WIDTH 80 |
| 635 | @ HEIGHT 45 |
| 636 | @ LB_HEIGHT 25 |
| 637 | @ } |
| @@ -680,20 +681,21 @@ | |
| 680 | @ if {![regexp {^=+ (.*?) =+ versus =+ (.*?) =+$} $line all fn fn2] |
| 681 | @ && ![regexp {^=+ (.*?) =+$} $line all fn] |
| 682 | @ } { |
| 683 | @ continue |
| 684 | @ } |
| 685 | @ if {[string compare -length 6 [getLine $difftxt $N ii] "<table"]} { |
| 686 | @ continue |
| 687 | @ } |
| 688 | @ incr nDiffs |
| 689 | @ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}] |
| 690 | @ .wfiles.lb insert end $fn |
| 691 | @ |
| 692 | @ foreach c [cols] { |
| 693 | @ while {[getLine $difftxt $N ii] ne "<pre>"} continue |
| 694 | @ |
| 695 | @ if {$nDiffs > 1} { |
| 696 | @ $c insert end \n - |
| 697 | @ } |
| 698 | @ if {[colType $c] eq "txt"} { |
| 699 | @ $c insert end $fn\n fn |
| @@ -701,10 +703,12 @@ | |
| 701 | @ } else { |
| 702 | @ $c insert end \n fn |
| 703 | @ } |
| 704 | @ $c insert end \n - |
| 705 | @ |
| 706 | @ set type [colType $c] |
| 707 | @ set str {} |
| 708 | @ while {[set line [getLine $difftxt $N ii]] ne "</pre>"} { |
| 709 | @ set len [string length [dehtml $line]] |
| 710 | @ if {$len > $widths($type)} { |
| @@ -723,10 +727,15 @@ | |
| 723 | @ } else { |
| 724 | @ $c insert end [dehtml $pre] - |
| 725 | @ } |
| 726 | @ } |
| 727 | @ } |
| 728 | @ } |
| 729 | @ |
| 730 | @ foreach c [cols] { |
| 731 | @ set type [colType $c] |
| 732 | @ if {$type ne "txt"} { |
| @@ -894,10 +903,11 @@ | |
| 894 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 895 | @ $txt tag lower $tag |
| 896 | @ } |
| 897 | @ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \ |
| 898 | @ -justify center |
| 899 | @ } |
| 900 | @ text .mkr |
| 901 | @ |
| 902 | @ foreach c [cols] { |
| 903 | @ set keyPrefix [string toupper [colType $c]]_COL_ |
| 904 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -628,10 +628,11 @@ | |
| 628 | @ HR_PAD_TOP 4 |
| 629 | @ HR_PAD_BTM 8 |
| 630 | @ FN_BG #444444 |
| 631 | @ FN_FG #ffffff |
| 632 | @ FN_PAD 5 |
| 633 | @ ERR_FG #ee0000 |
| 634 | @ PADX 5 |
| 635 | @ WIDTH 80 |
| 636 | @ HEIGHT 45 |
| 637 | @ LB_HEIGHT 25 |
| 638 | @ } |
| @@ -680,20 +681,21 @@ | |
| 681 | @ if {![regexp {^=+ (.*?) =+ versus =+ (.*?) =+$} $line all fn fn2] |
| 682 | @ && ![regexp {^=+ (.*?) =+$} $line all fn] |
| 683 | @ } { |
| 684 | @ continue |
| 685 | @ } |
| 686 | @ set errMsg "" |
| 687 | @ set line [getLine $difftxt $N ii] |
| 688 | @ if {[string compare -length 6 $line "<table"] |
| 689 | @ && ![regexp {<p[^>]*>(.+)} $line - errMsg]} { |
| 690 | @ continue |
| 691 | @ } |
| 692 | @ incr nDiffs |
| 693 | @ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}] |
| 694 | @ .wfiles.lb insert end $fn |
| 695 | @ |
| 696 | @ foreach c [cols] { |
| 697 | @ if {$nDiffs > 1} { |
| 698 | @ $c insert end \n - |
| 699 | @ } |
| 700 | @ if {[colType $c] eq "txt"} { |
| 701 | @ $c insert end $fn\n fn |
| @@ -701,10 +703,12 @@ | |
| 703 | @ } else { |
| 704 | @ $c insert end \n fn |
| 705 | @ } |
| 706 | @ $c insert end \n - |
| 707 | @ |
| 708 | @ if {$errMsg ne ""} continue |
| 709 | @ while {[getLine $difftxt $N ii] ne "<pre>"} continue |
| 710 | @ set type [colType $c] |
| 711 | @ set str {} |
| 712 | @ while {[set line [getLine $difftxt $N ii]] ne "</pre>"} { |
| 713 | @ set len [string length [dehtml $line]] |
| 714 | @ if {$len > $widths($type)} { |
| @@ -723,10 +727,15 @@ | |
| 727 | @ } else { |
| 728 | @ $c insert end [dehtml $pre] - |
| 729 | @ } |
| 730 | @ } |
| 731 | @ } |
| 732 | @ |
| 733 | @ if {$errMsg ne ""} { |
| 734 | @ foreach c {.txtA .txtB} {$c insert end [string trim $errMsg] err} |
| 735 | @ foreach c [cols] {$c insert end \n -} |
| 736 | @ } |
| 737 | @ } |
| 738 | @ |
| 739 | @ foreach c [cols] { |
| 740 | @ set type [colType $c] |
| 741 | @ if {$type ne "txt"} { |
| @@ -894,10 +903,11 @@ | |
| 903 | @ $txt tag config $tag -background $CFG([string toupper $tag]_BG) |
| 904 | @ $txt tag lower $tag |
| 905 | @ } |
| 906 | @ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \ |
| 907 | @ -justify center |
| 908 | @ $txt tag config err -foreground $CFG(ERR_FG) |
| 909 | @ } |
| 910 | @ text .mkr |
| 911 | @ |
| 912 | @ foreach c [cols] { |
| 913 | @ set keyPrefix [string toupper [colType $c]]_COL_ |
| 914 |