Fossil SCM

Do not use an external diff command to generate HTML for --tk or --webpage or --browser.

drh 2021-08-27 00:33 trunk
Commit 83feccc291acc6e6937da5e06ea294c7fa6be512bb63c94ccb2dce3b7c822b2e
3 files changed +4 -1 +4 -2 +4 -2
+4 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -299,10 +299,11 @@
299299
zExtra = zSbsCss;
300300
}else{
301301
zExtra = "";
302302
}
303303
fossil_print(zWebpageHdr/*works-like:"%s"*/, zExtra);
304
+ fflush(stdout);
304305
}
305306
}
306307
307308
/* Do any final output required by a diff and complete the diff
308309
** process.
@@ -1098,11 +1099,13 @@
10981099
}else if( zFrom==0 ){
10991100
fossil_fatal("must use --from if --to is present");
11001101
}else{
11011102
db_find_and_open_repository(0, 0);
11021103
}
1103
- if( !isInternDiff ){
1104
+ if( !isInternDiff
1105
+ && (diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */
1106
+ ){
11041107
zDiffCmd = find_option("command", 0, 1);
11051108
if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff);
11061109
}
11071110
zBinGlob = diff_get_binary_glob();
11081111
fIncludeBinary = diff_include_binary_files();
11091112
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -299,10 +299,11 @@
299 zExtra = zSbsCss;
300 }else{
301 zExtra = "";
302 }
303 fossil_print(zWebpageHdr/*works-like:"%s"*/, zExtra);
 
304 }
305 }
306
307 /* Do any final output required by a diff and complete the diff
308 ** process.
@@ -1098,11 +1099,13 @@
1098 }else if( zFrom==0 ){
1099 fossil_fatal("must use --from if --to is present");
1100 }else{
1101 db_find_and_open_repository(0, 0);
1102 }
1103 if( !isInternDiff ){
 
 
1104 zDiffCmd = find_option("command", 0, 1);
1105 if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff);
1106 }
1107 zBinGlob = diff_get_binary_glob();
1108 fIncludeBinary = diff_include_binary_files();
1109
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -299,10 +299,11 @@
299 zExtra = zSbsCss;
300 }else{
301 zExtra = "";
302 }
303 fossil_print(zWebpageHdr/*works-like:"%s"*/, zExtra);
304 fflush(stdout);
305 }
306 }
307
308 /* Do any final output required by a diff and complete the diff
309 ** process.
@@ -1098,11 +1099,13 @@
1099 }else if( zFrom==0 ){
1100 fossil_fatal("must use --from if --to is present");
1101 }else{
1102 db_find_and_open_repository(0, 0);
1103 }
1104 if( !isInternDiff
1105 && (diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */
1106 ){
1107 zDiffCmd = find_option("command", 0, 1);
1108 if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff);
1109 }
1110 zBinGlob = diff_get_binary_glob();
1111 fIncludeBinary = diff_include_binary_files();
1112
+4 -2
--- src/patch.c
+++ src/patch.c
@@ -958,14 +958,16 @@
958958
if( find_option("tk",0,0)!=0 ){
959959
db_close(0);
960960
diff_tk("patch diff", 3);
961961
return;
962962
}
963
- if( find_option("internal","i",0)==0 ){
963
+ diffFlags = diff_options();
964
+ if( find_option("internal","i",0)==0
965
+ && (diffFlags & DIFF_HTML)==0
966
+ ){
964967
zDiffCmd = diff_command_external(zCmd[0]=='g');
965968
}
966
- diffFlags = diff_options();
967969
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
968970
if( zDiffCmd ){
969971
zBinGlob = diff_get_binary_glob();
970972
fIncludeBinary = diff_include_binary_files();
971973
}
972974
--- src/patch.c
+++ src/patch.c
@@ -958,14 +958,16 @@
958 if( find_option("tk",0,0)!=0 ){
959 db_close(0);
960 diff_tk("patch diff", 3);
961 return;
962 }
963 if( find_option("internal","i",0)==0 ){
 
 
 
964 zDiffCmd = diff_command_external(zCmd[0]=='g');
965 }
966 diffFlags = diff_options();
967 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
968 if( zDiffCmd ){
969 zBinGlob = diff_get_binary_glob();
970 fIncludeBinary = diff_include_binary_files();
971 }
972
--- src/patch.c
+++ src/patch.c
@@ -958,14 +958,16 @@
958 if( find_option("tk",0,0)!=0 ){
959 db_close(0);
960 diff_tk("patch diff", 3);
961 return;
962 }
963 diffFlags = diff_options();
964 if( find_option("internal","i",0)==0
965 && (diffFlags & DIFF_HTML)==0
966 ){
967 zDiffCmd = diff_command_external(zCmd[0]=='g');
968 }
 
969 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
970 if( zDiffCmd ){
971 zBinGlob = diff_get_binary_glob();
972 fIncludeBinary = diff_include_binary_files();
973 }
974
+4 -2
--- src/stash.c
+++ src/stash.c
@@ -754,14 +754,16 @@
754754
if( find_option("tk",0,0)!=0 ){
755755
db_close(0);
756756
diff_tk(fBaseline ? "stash show" : "stash diff", 3);
757757
return;
758758
}
759
- if( find_option("internal","i",0)==0 ){
759
+ diffFlags = diff_options();
760
+ if( find_option("internal","i",0)==0
761
+ && (diffFlags & DIFF_HTML)==0
762
+ ){
760763
zDiffCmd = diff_command_external(zCmd[0]=='g');
761764
}
762
- diffFlags = diff_options();
763765
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
764766
if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
765767
if( zDiffCmd ){
766768
zBinGlob = diff_get_binary_glob();
767769
fIncludeBinary = diff_include_binary_files();
768770
--- src/stash.c
+++ src/stash.c
@@ -754,14 +754,16 @@
754 if( find_option("tk",0,0)!=0 ){
755 db_close(0);
756 diff_tk(fBaseline ? "stash show" : "stash diff", 3);
757 return;
758 }
759 if( find_option("internal","i",0)==0 ){
 
 
 
760 zDiffCmd = diff_command_external(zCmd[0]=='g');
761 }
762 diffFlags = diff_options();
763 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
764 if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
765 if( zDiffCmd ){
766 zBinGlob = diff_get_binary_glob();
767 fIncludeBinary = diff_include_binary_files();
768
--- src/stash.c
+++ src/stash.c
@@ -754,14 +754,16 @@
754 if( find_option("tk",0,0)!=0 ){
755 db_close(0);
756 diff_tk(fBaseline ? "stash show" : "stash diff", 3);
757 return;
758 }
759 diffFlags = diff_options();
760 if( find_option("internal","i",0)==0
761 && (diffFlags & DIFF_HTML)==0
762 ){
763 zDiffCmd = diff_command_external(zCmd[0]=='g');
764 }
 
765 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
766 if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
767 if( zDiffCmd ){
768 zBinGlob = diff_get_binary_glob();
769 fIncludeBinary = diff_include_binary_files();
770

Keyboard Shortcuts

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