Fossil SCM

Show "error" messages in Tk diff.

joel 2014-03-04 00:42 diff-eolws
Commit d4fea96ad82d90ec727e8ef1a3b03251c6f450c3
1 file changed +13 -3
+13 -3
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -628,10 +628,11 @@
628628
@ HR_PAD_TOP 4
629629
@ HR_PAD_BTM 8
630630
@ FN_BG #444444
631631
@ FN_FG #ffffff
632632
@ FN_PAD 5
633
+@ ERR_FG #ee0000
633634
@ PADX 5
634635
@ WIDTH 80
635636
@ HEIGHT 45
636637
@ LB_HEIGHT 25
637638
@ }
@@ -680,20 +681,21 @@
680681
@ if {![regexp {^=+ (.*?) =+ versus =+ (.*?) =+$} $line all fn fn2]
681682
@ && ![regexp {^=+ (.*?) =+$} $line all fn]
682683
@ } {
683684
@ continue
684685
@ }
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]} {
686690
@ continue
687691
@ }
688692
@ incr nDiffs
689693
@ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}]
690694
@ .wfiles.lb insert end $fn
691695
@
692696
@ foreach c [cols] {
693
-@ while {[getLine $difftxt $N ii] ne "<pre>"} continue
694
-@
695697
@ if {$nDiffs > 1} {
696698
@ $c insert end \n -
697699
@ }
698700
@ if {[colType $c] eq "txt"} {
699701
@ $c insert end $fn\n fn
@@ -701,10 +703,12 @@
701703
@ } else {
702704
@ $c insert end \n fn
703705
@ }
704706
@ $c insert end \n -
705707
@
708
+@ if {$errMsg ne ""} continue
709
+@ while {[getLine $difftxt $N ii] ne "<pre>"} continue
706710
@ set type [colType $c]
707711
@ set str {}
708712
@ while {[set line [getLine $difftxt $N ii]] ne "</pre>"} {
709713
@ set len [string length [dehtml $line]]
710714
@ if {$len > $widths($type)} {
@@ -723,10 +727,15 @@
723727
@ } else {
724728
@ $c insert end [dehtml $pre] -
725729
@ }
726730
@ }
727731
@ }
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
+@ }
728737
@ }
729738
@
730739
@ foreach c [cols] {
731740
@ set type [colType $c]
732741
@ if {$type ne "txt"} {
@@ -894,10 +903,11 @@
894903
@ $txt tag config $tag -background $CFG([string toupper $tag]_BG)
895904
@ $txt tag lower $tag
896905
@ }
897906
@ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \
898907
@ -justify center
908
+@ $txt tag config err -foreground $CFG(ERR_FG)
899909
@ }
900910
@ text .mkr
901911
@
902912
@ foreach c [cols] {
903913
@ set keyPrefix [string toupper [colType $c]]_COL_
904914
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button