Fossil SCM
Change internal $cmd Tcl variable in $fossilcmd. One of the Tcl packages in my environment (not written by me) defines this variable, which breaks "fossil diff --tk". Still investigating, but this is a harmless workaround.
Commit
f92d80d42a823b03031216b2b1617255d18ef407
Parent
e3a4d954b784d92…
1 file changed
+4
-4
+4
-4
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -642,12 +642,12 @@ | ||
| 642 | 642 | @ proc colType {c} { |
| 643 | 643 | @ regexp {[a-z]+} $c type |
| 644 | 644 | @ return $type |
| 645 | 645 | @ } |
| 646 | 646 | @ |
| 647 | -@ proc readDiffs {cmd} { | |
| 648 | -@ set in [open $cmd r] | |
| 647 | +@ proc readDiffs {fossilcmd} { | |
| 648 | +@ set in [open $fossilcmd r] | |
| 649 | 649 | @ fconfigure $in -encoding utf-8 |
| 650 | 650 | @ set nDiffs 0 |
| 651 | 651 | @ array set widths {txt 0 ln 0 mkr 0} |
| 652 | 652 | @ while {[gets $in line] != -1} { |
| 653 | 653 | @ if {![regexp {^=+\s+(.*?)\s+=+$} $line all fn]} { |
| @@ -883,11 +883,11 @@ | ||
| 883 | 883 | @ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical |
| 884 | 884 | @ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal |
| 885 | 885 | @ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal |
| 886 | 886 | @ frame .spacer |
| 887 | 887 | @ |
| 888 | -@ if {[readDiffs $cmd] == 0} { | |
| 888 | +@ if {[readDiffs $fossilcmd] == 0} { | |
| 889 | 889 | @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes" |
| 890 | 890 | @ exit |
| 891 | 891 | @ } |
| 892 | 892 | @ update idletasks |
| 893 | 893 | @ |
| @@ -918,11 +918,11 @@ | ||
| 918 | 918 | int i; |
| 919 | 919 | Blob script; |
| 920 | 920 | char *zTempFile; |
| 921 | 921 | char *zCmd; |
| 922 | 922 | blob_zero(&script); |
| 923 | - blob_appendf(&script, "set cmd {| \"%/\" %s --html -y -i -v", | |
| 923 | + blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", | |
| 924 | 924 | g.nameOfExe, zSubCmd); |
| 925 | 925 | for(i=firstArg; i<g.argc; i++){ |
| 926 | 926 | const char *z = g.argv[i]; |
| 927 | 927 | if( z[0]=='-' ){ |
| 928 | 928 | if( strglob("*-html",z) ) continue; |
| 929 | 929 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -642,12 +642,12 @@ | |
| 642 | @ proc colType {c} { |
| 643 | @ regexp {[a-z]+} $c type |
| 644 | @ return $type |
| 645 | @ } |
| 646 | @ |
| 647 | @ proc readDiffs {cmd} { |
| 648 | @ set in [open $cmd r] |
| 649 | @ fconfigure $in -encoding utf-8 |
| 650 | @ set nDiffs 0 |
| 651 | @ array set widths {txt 0 ln 0 mkr 0} |
| 652 | @ while {[gets $in line] != -1} { |
| 653 | @ if {![regexp {^=+\s+(.*?)\s+=+$} $line all fn]} { |
| @@ -883,11 +883,11 @@ | |
| 883 | @ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical |
| 884 | @ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal |
| 885 | @ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal |
| 886 | @ frame .spacer |
| 887 | @ |
| 888 | @ if {[readDiffs $cmd] == 0} { |
| 889 | @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes" |
| 890 | @ exit |
| 891 | @ } |
| 892 | @ update idletasks |
| 893 | @ |
| @@ -918,11 +918,11 @@ | |
| 918 | int i; |
| 919 | Blob script; |
| 920 | char *zTempFile; |
| 921 | char *zCmd; |
| 922 | blob_zero(&script); |
| 923 | blob_appendf(&script, "set cmd {| \"%/\" %s --html -y -i -v", |
| 924 | g.nameOfExe, zSubCmd); |
| 925 | for(i=firstArg; i<g.argc; i++){ |
| 926 | const char *z = g.argv[i]; |
| 927 | if( z[0]=='-' ){ |
| 928 | if( strglob("*-html",z) ) continue; |
| 929 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -642,12 +642,12 @@ | |
| 642 | @ proc colType {c} { |
| 643 | @ regexp {[a-z]+} $c type |
| 644 | @ return $type |
| 645 | @ } |
| 646 | @ |
| 647 | @ proc readDiffs {fossilcmd} { |
| 648 | @ set in [open $fossilcmd r] |
| 649 | @ fconfigure $in -encoding utf-8 |
| 650 | @ set nDiffs 0 |
| 651 | @ array set widths {txt 0 ln 0 mkr 0} |
| 652 | @ while {[gets $in line] != -1} { |
| 653 | @ if {![regexp {^=+\s+(.*?)\s+=+$} $line all fn]} { |
| @@ -883,11 +883,11 @@ | |
| 883 | @ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical |
| 884 | @ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal |
| 885 | @ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal |
| 886 | @ frame .spacer |
| 887 | @ |
| 888 | @ if {[readDiffs $fossilcmd] == 0} { |
| 889 | @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes" |
| 890 | @ exit |
| 891 | @ } |
| 892 | @ update idletasks |
| 893 | @ |
| @@ -918,11 +918,11 @@ | |
| 918 | int i; |
| 919 | Blob script; |
| 920 | char *zTempFile; |
| 921 | char *zCmd; |
| 922 | blob_zero(&script); |
| 923 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", |
| 924 | g.nameOfExe, zSubCmd); |
| 925 | for(i=firstArg; i<g.argc; i++){ |
| 926 | const char *z = g.argv[i]; |
| 927 | if( z[0]=='-' ){ |
| 928 | if( strglob("*-html",z) ) continue; |
| 929 |