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.

jan.nijtmans 2013-09-06 14:18 trunk
Commit f92d80d42a823b03031216b2b1617255d18ef407
1 file changed +4 -4
+4 -4
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -642,12 +642,12 @@
642642
@ proc colType {c} {
643643
@ regexp {[a-z]+} $c type
644644
@ return $type
645645
@ }
646646
@
647
-@ proc readDiffs {cmd} {
648
-@ set in [open $cmd r]
647
+@ proc readDiffs {fossilcmd} {
648
+@ set in [open $fossilcmd r]
649649
@ fconfigure $in -encoding utf-8
650650
@ set nDiffs 0
651651
@ array set widths {txt 0 ln 0 mkr 0}
652652
@ while {[gets $in line] != -1} {
653653
@ if {![regexp {^=+\s+(.*?)\s+=+$} $line all fn]} {
@@ -883,11 +883,11 @@
883883
@ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical
884884
@ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal
885885
@ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal
886886
@ frame .spacer
887887
@
888
-@ if {[readDiffs $cmd] == 0} {
888
+@ if {[readDiffs $fossilcmd] == 0} {
889889
@ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
890890
@ exit
891891
@ }
892892
@ update idletasks
893893
@
@@ -918,11 +918,11 @@
918918
int i;
919919
Blob script;
920920
char *zTempFile;
921921
char *zCmd;
922922
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",
924924
g.nameOfExe, zSubCmd);
925925
for(i=firstArg; i<g.argc; i++){
926926
const char *z = g.argv[i];
927927
if( z[0]=='-' ){
928928
if( strglob("*-html",z) ) continue;
929929
--- 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

Keyboard Shortcuts

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