Fossil SCM
Do not use an external diff command to generate HTML for --tk or --webpage or --browser.
Commit
83feccc291acc6e6937da5e06ea294c7fa6be512bb63c94ccb2dce3b7c822b2e
Parent
16a01582e6c5c6f…
3 files changed
+4
-1
+4
-2
+4
-2
+4
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -299,10 +299,11 @@ | ||
| 299 | 299 | zExtra = zSbsCss; |
| 300 | 300 | }else{ |
| 301 | 301 | zExtra = ""; |
| 302 | 302 | } |
| 303 | 303 | fossil_print(zWebpageHdr/*works-like:"%s"*/, zExtra); |
| 304 | + fflush(stdout); | |
| 304 | 305 | } |
| 305 | 306 | } |
| 306 | 307 | |
| 307 | 308 | /* Do any final output required by a diff and complete the diff |
| 308 | 309 | ** process. |
| @@ -1098,11 +1099,13 @@ | ||
| 1098 | 1099 | }else if( zFrom==0 ){ |
| 1099 | 1100 | fossil_fatal("must use --from if --to is present"); |
| 1100 | 1101 | }else{ |
| 1101 | 1102 | db_find_and_open_repository(0, 0); |
| 1102 | 1103 | } |
| 1103 | - if( !isInternDiff ){ | |
| 1104 | + if( !isInternDiff | |
| 1105 | + && (diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */ | |
| 1106 | + ){ | |
| 1104 | 1107 | zDiffCmd = find_option("command", 0, 1); |
| 1105 | 1108 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 1106 | 1109 | } |
| 1107 | 1110 | zBinGlob = diff_get_binary_glob(); |
| 1108 | 1111 | fIncludeBinary = diff_include_binary_files(); |
| 1109 | 1112 |
| --- 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 @@ | ||
| 958 | 958 | if( find_option("tk",0,0)!=0 ){ |
| 959 | 959 | db_close(0); |
| 960 | 960 | diff_tk("patch diff", 3); |
| 961 | 961 | return; |
| 962 | 962 | } |
| 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 | + ){ | |
| 964 | 967 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 965 | 968 | } |
| 966 | - diffFlags = diff_options(); | |
| 967 | 969 | if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; |
| 968 | 970 | if( zDiffCmd ){ |
| 969 | 971 | zBinGlob = diff_get_binary_glob(); |
| 970 | 972 | fIncludeBinary = diff_include_binary_files(); |
| 971 | 973 | } |
| 972 | 974 |
| --- 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 @@ | ||
| 754 | 754 | if( find_option("tk",0,0)!=0 ){ |
| 755 | 755 | db_close(0); |
| 756 | 756 | diff_tk(fBaseline ? "stash show" : "stash diff", 3); |
| 757 | 757 | return; |
| 758 | 758 | } |
| 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 | + ){ | |
| 760 | 763 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 761 | 764 | } |
| 762 | - diffFlags = diff_options(); | |
| 763 | 765 | if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; |
| 764 | 766 | if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd)); |
| 765 | 767 | if( zDiffCmd ){ |
| 766 | 768 | zBinGlob = diff_get_binary_glob(); |
| 767 | 769 | fIncludeBinary = diff_include_binary_files(); |
| 768 | 770 |
| --- 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 |