Fossil SCM
Incremental step in integrating DiffConfig.
Commit
f7c8416fcd5c7db842966f2d4c092e4b55f5b998a6e1425e07b22b8b0c1d8c25
Parent
8601fb13d6115f5…
4 files changed
+26
-14
+9
-10
+13
-14
+16
-18
+26
-14
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -72,11 +72,26 @@ | ||
| 72 | 72 | */ |
| 73 | 73 | #define LENGTH_MASK_SZ 15 |
| 74 | 74 | #define LENGTH_MASK ((1<<LENGTH_MASK_SZ)-1) |
| 75 | 75 | |
| 76 | 76 | /* |
| 77 | -** Configuration options for a diff operation | |
| 77 | +** An instance of this object describes the formatting and processing | |
| 78 | +** details desired of a "diff" operation. | |
| 79 | +** | |
| 80 | +** Conceptually, this object is as an encoding of the command-line options | |
| 81 | +** for the "fossil diff" command. That is not a precise description, though, | |
| 82 | +** because not all diff operations are started from the command-line. But | |
| 83 | +** the idea is sound. | |
| 84 | +** | |
| 85 | +** Information encoded by this object includes but is not limited to: | |
| 86 | +** | |
| 87 | +** * The desired output format (unified vs. side-by-side, | |
| 88 | +** TCL, JSON, HTML vs. plain-text). | |
| 89 | +** | |
| 90 | +** * Number of lines of context surrounding each difference block | |
| 91 | +** | |
| 92 | +** * Width of output columns for text side-by-side diffop | |
| 78 | 93 | */ |
| 79 | 94 | struct DiffConfig { |
| 80 | 95 | u64 diffFlags; /* Legacy diff flags */ |
| 81 | 96 | }; |
| 82 | 97 | |
| @@ -2725,10 +2740,12 @@ | ||
| 2725 | 2740 | return c.aEdit; |
| 2726 | 2741 | } |
| 2727 | 2742 | } |
| 2728 | 2743 | |
| 2729 | 2744 | /* |
| 2745 | +** Initialize the DiffConfig object using command-line options. | |
| 2746 | +** | |
| 2730 | 2747 | ** Process diff-related command-line options and return an appropriate |
| 2731 | 2748 | ** "diffFlags" integer. |
| 2732 | 2749 | ** |
| 2733 | 2750 | ** --brief Show filenames only DIFF_BRIEF |
| 2734 | 2751 | ** -c|--context N N lines of context. DIFF_CONTEXT_MASK |
| @@ -2742,17 +2759,16 @@ | ||
| 2742 | 2759 | ** -w|--ignore-all-space Ignore all whitespaces DIFF_IGNORE_ALLWS |
| 2743 | 2760 | ** -W|--width N N character lines. DIFF_WIDTH_MASK |
| 2744 | 2761 | ** -y|--side-by-side Side-by-side diff. DIFF_SIDEBYSIDE |
| 2745 | 2762 | ** -Z|--ignore-trailing-space Ignore eol-whitespaces DIFF_IGNORE_EOLWS |
| 2746 | 2763 | */ |
| 2747 | -u64 diff_options(DiffConfig *pCfg){ | |
| 2764 | +void diff_options(DiffConfig *pCfg, int isGDiff){ | |
| 2748 | 2765 | u64 diffFlags = 0; |
| 2749 | 2766 | const char *z; |
| 2750 | 2767 | int f; |
| 2751 | - if( pCfg ){ | |
| 2752 | - memset(pCfg, 0, sizeof(*pCfg)); | |
| 2753 | - } | |
| 2768 | + | |
| 2769 | + memset(pCfg, 0, sizeof(*pCfg)); | |
| 2754 | 2770 | if( find_option("ignore-trailing-space","Z",0)!=0 ){ |
| 2755 | 2771 | diffFlags = DIFF_IGNORE_EOLWS; |
| 2756 | 2772 | } |
| 2757 | 2773 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2758 | 2774 | diffFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| @@ -2799,14 +2815,11 @@ | ||
| 2799 | 2815 | |
| 2800 | 2816 | /* Undocumented and unsupported flags used for development |
| 2801 | 2817 | ** debugging and analysis: */ |
| 2802 | 2818 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 2803 | 2819 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 2804 | - if( pCfg ){ | |
| 2805 | - pCfg->diffFlags = diffFlags; | |
| 2806 | - } | |
| 2807 | - return diffFlags; | |
| 2820 | + pCfg->diffFlags = diffFlags; | |
| 2808 | 2821 | } |
| 2809 | 2822 | |
| 2810 | 2823 | /* |
| 2811 | 2824 | ** COMMAND: test-diff |
| 2812 | 2825 | ** COMMAND: xdiff |
| @@ -2826,11 +2839,10 @@ | ||
| 2826 | 2839 | ** This command used to be called "test-diff". The older "test-diff" spelling |
| 2827 | 2840 | ** still works, for compatibility. |
| 2828 | 2841 | */ |
| 2829 | 2842 | void test_diff_cmd(void){ |
| 2830 | 2843 | Blob a, b, out; |
| 2831 | - u64 diffFlag; | |
| 2832 | 2844 | const char *zRe; /* Regex filter for diff output */ |
| 2833 | 2845 | ReCompiled *pRe = 0; /* Regex filter for diff output */ |
| 2834 | 2846 | DiffConfig DCfg; |
| 2835 | 2847 | |
| 2836 | 2848 | if( find_option("tk",0,0)!=0 ){ |
| @@ -2842,21 +2854,21 @@ | ||
| 2842 | 2854 | zRe = find_option("regexp","e",1); |
| 2843 | 2855 | if( zRe ){ |
| 2844 | 2856 | const char *zErr = re_compile(&pRe, zRe, 0); |
| 2845 | 2857 | if( zErr ) fossil_fatal("regex error: %s", zErr); |
| 2846 | 2858 | } |
| 2847 | - diffFlag = diff_options(&DCfg); | |
| 2859 | + diff_options(&DCfg, 0); | |
| 2848 | 2860 | verify_all_options(); |
| 2849 | 2861 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 2850 | 2862 | blob_zero(&out); |
| 2851 | - diff_begin(diffFlag); | |
| 2852 | - diff_print_filenames(g.argv[2], g.argv[3], diffFlag, &out); | |
| 2863 | + diff_begin(DCfg.diffFlags); | |
| 2864 | + diff_print_filenames(g.argv[2], g.argv[3], DCfg.diffFlags, &out); | |
| 2853 | 2865 | blob_read_from_file(&a, g.argv[2], ExtFILE); |
| 2854 | 2866 | blob_read_from_file(&b, g.argv[3], ExtFILE); |
| 2855 | 2867 | text_diff(&a, &b, &out, pRe, &DCfg); |
| 2856 | 2868 | blob_write_to_file(&out, "-"); |
| 2857 | - diff_end(diffFlag, 0); | |
| 2869 | + diff_end(DCfg.diffFlags, 0); | |
| 2858 | 2870 | re_free(pRe); |
| 2859 | 2871 | } |
| 2860 | 2872 | |
| 2861 | 2873 | /************************************************************************** |
| 2862 | 2874 | ** The basic difference engine is above. What follows is the annotation |
| 2863 | 2875 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -72,11 +72,26 @@ | |
| 72 | */ |
| 73 | #define LENGTH_MASK_SZ 15 |
| 74 | #define LENGTH_MASK ((1<<LENGTH_MASK_SZ)-1) |
| 75 | |
| 76 | /* |
| 77 | ** Configuration options for a diff operation |
| 78 | */ |
| 79 | struct DiffConfig { |
| 80 | u64 diffFlags; /* Legacy diff flags */ |
| 81 | }; |
| 82 | |
| @@ -2725,10 +2740,12 @@ | |
| 2725 | return c.aEdit; |
| 2726 | } |
| 2727 | } |
| 2728 | |
| 2729 | /* |
| 2730 | ** Process diff-related command-line options and return an appropriate |
| 2731 | ** "diffFlags" integer. |
| 2732 | ** |
| 2733 | ** --brief Show filenames only DIFF_BRIEF |
| 2734 | ** -c|--context N N lines of context. DIFF_CONTEXT_MASK |
| @@ -2742,17 +2759,16 @@ | |
| 2742 | ** -w|--ignore-all-space Ignore all whitespaces DIFF_IGNORE_ALLWS |
| 2743 | ** -W|--width N N character lines. DIFF_WIDTH_MASK |
| 2744 | ** -y|--side-by-side Side-by-side diff. DIFF_SIDEBYSIDE |
| 2745 | ** -Z|--ignore-trailing-space Ignore eol-whitespaces DIFF_IGNORE_EOLWS |
| 2746 | */ |
| 2747 | u64 diff_options(DiffConfig *pCfg){ |
| 2748 | u64 diffFlags = 0; |
| 2749 | const char *z; |
| 2750 | int f; |
| 2751 | if( pCfg ){ |
| 2752 | memset(pCfg, 0, sizeof(*pCfg)); |
| 2753 | } |
| 2754 | if( find_option("ignore-trailing-space","Z",0)!=0 ){ |
| 2755 | diffFlags = DIFF_IGNORE_EOLWS; |
| 2756 | } |
| 2757 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2758 | diffFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| @@ -2799,14 +2815,11 @@ | |
| 2799 | |
| 2800 | /* Undocumented and unsupported flags used for development |
| 2801 | ** debugging and analysis: */ |
| 2802 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 2803 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 2804 | if( pCfg ){ |
| 2805 | pCfg->diffFlags = diffFlags; |
| 2806 | } |
| 2807 | return diffFlags; |
| 2808 | } |
| 2809 | |
| 2810 | /* |
| 2811 | ** COMMAND: test-diff |
| 2812 | ** COMMAND: xdiff |
| @@ -2826,11 +2839,10 @@ | |
| 2826 | ** This command used to be called "test-diff". The older "test-diff" spelling |
| 2827 | ** still works, for compatibility. |
| 2828 | */ |
| 2829 | void test_diff_cmd(void){ |
| 2830 | Blob a, b, out; |
| 2831 | u64 diffFlag; |
| 2832 | const char *zRe; /* Regex filter for diff output */ |
| 2833 | ReCompiled *pRe = 0; /* Regex filter for diff output */ |
| 2834 | DiffConfig DCfg; |
| 2835 | |
| 2836 | if( find_option("tk",0,0)!=0 ){ |
| @@ -2842,21 +2854,21 @@ | |
| 2842 | zRe = find_option("regexp","e",1); |
| 2843 | if( zRe ){ |
| 2844 | const char *zErr = re_compile(&pRe, zRe, 0); |
| 2845 | if( zErr ) fossil_fatal("regex error: %s", zErr); |
| 2846 | } |
| 2847 | diffFlag = diff_options(&DCfg); |
| 2848 | verify_all_options(); |
| 2849 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 2850 | blob_zero(&out); |
| 2851 | diff_begin(diffFlag); |
| 2852 | diff_print_filenames(g.argv[2], g.argv[3], diffFlag, &out); |
| 2853 | blob_read_from_file(&a, g.argv[2], ExtFILE); |
| 2854 | blob_read_from_file(&b, g.argv[3], ExtFILE); |
| 2855 | text_diff(&a, &b, &out, pRe, &DCfg); |
| 2856 | blob_write_to_file(&out, "-"); |
| 2857 | diff_end(diffFlag, 0); |
| 2858 | re_free(pRe); |
| 2859 | } |
| 2860 | |
| 2861 | /************************************************************************** |
| 2862 | ** The basic difference engine is above. What follows is the annotation |
| 2863 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -72,11 +72,26 @@ | |
| 72 | */ |
| 73 | #define LENGTH_MASK_SZ 15 |
| 74 | #define LENGTH_MASK ((1<<LENGTH_MASK_SZ)-1) |
| 75 | |
| 76 | /* |
| 77 | ** An instance of this object describes the formatting and processing |
| 78 | ** details desired of a "diff" operation. |
| 79 | ** |
| 80 | ** Conceptually, this object is as an encoding of the command-line options |
| 81 | ** for the "fossil diff" command. That is not a precise description, though, |
| 82 | ** because not all diff operations are started from the command-line. But |
| 83 | ** the idea is sound. |
| 84 | ** |
| 85 | ** Information encoded by this object includes but is not limited to: |
| 86 | ** |
| 87 | ** * The desired output format (unified vs. side-by-side, |
| 88 | ** TCL, JSON, HTML vs. plain-text). |
| 89 | ** |
| 90 | ** * Number of lines of context surrounding each difference block |
| 91 | ** |
| 92 | ** * Width of output columns for text side-by-side diffop |
| 93 | */ |
| 94 | struct DiffConfig { |
| 95 | u64 diffFlags; /* Legacy diff flags */ |
| 96 | }; |
| 97 | |
| @@ -2725,10 +2740,12 @@ | |
| 2740 | return c.aEdit; |
| 2741 | } |
| 2742 | } |
| 2743 | |
| 2744 | /* |
| 2745 | ** Initialize the DiffConfig object using command-line options. |
| 2746 | ** |
| 2747 | ** Process diff-related command-line options and return an appropriate |
| 2748 | ** "diffFlags" integer. |
| 2749 | ** |
| 2750 | ** --brief Show filenames only DIFF_BRIEF |
| 2751 | ** -c|--context N N lines of context. DIFF_CONTEXT_MASK |
| @@ -2742,17 +2759,16 @@ | |
| 2759 | ** -w|--ignore-all-space Ignore all whitespaces DIFF_IGNORE_ALLWS |
| 2760 | ** -W|--width N N character lines. DIFF_WIDTH_MASK |
| 2761 | ** -y|--side-by-side Side-by-side diff. DIFF_SIDEBYSIDE |
| 2762 | ** -Z|--ignore-trailing-space Ignore eol-whitespaces DIFF_IGNORE_EOLWS |
| 2763 | */ |
| 2764 | void diff_options(DiffConfig *pCfg, int isGDiff){ |
| 2765 | u64 diffFlags = 0; |
| 2766 | const char *z; |
| 2767 | int f; |
| 2768 | |
| 2769 | memset(pCfg, 0, sizeof(*pCfg)); |
| 2770 | if( find_option("ignore-trailing-space","Z",0)!=0 ){ |
| 2771 | diffFlags = DIFF_IGNORE_EOLWS; |
| 2772 | } |
| 2773 | if( find_option("ignore-all-space","w",0)!=0 ){ |
| 2774 | diffFlags = DIFF_IGNORE_ALLWS; /* stronger than DIFF_IGNORE_EOLWS */ |
| @@ -2799,14 +2815,11 @@ | |
| 2815 | |
| 2816 | /* Undocumented and unsupported flags used for development |
| 2817 | ** debugging and analysis: */ |
| 2818 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 2819 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 2820 | pCfg->diffFlags = diffFlags; |
| 2821 | } |
| 2822 | |
| 2823 | /* |
| 2824 | ** COMMAND: test-diff |
| 2825 | ** COMMAND: xdiff |
| @@ -2826,11 +2839,10 @@ | |
| 2839 | ** This command used to be called "test-diff". The older "test-diff" spelling |
| 2840 | ** still works, for compatibility. |
| 2841 | */ |
| 2842 | void test_diff_cmd(void){ |
| 2843 | Blob a, b, out; |
| 2844 | const char *zRe; /* Regex filter for diff output */ |
| 2845 | ReCompiled *pRe = 0; /* Regex filter for diff output */ |
| 2846 | DiffConfig DCfg; |
| 2847 | |
| 2848 | if( find_option("tk",0,0)!=0 ){ |
| @@ -2842,21 +2854,21 @@ | |
| 2854 | zRe = find_option("regexp","e",1); |
| 2855 | if( zRe ){ |
| 2856 | const char *zErr = re_compile(&pRe, zRe, 0); |
| 2857 | if( zErr ) fossil_fatal("regex error: %s", zErr); |
| 2858 | } |
| 2859 | diff_options(&DCfg, 0); |
| 2860 | verify_all_options(); |
| 2861 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 2862 | blob_zero(&out); |
| 2863 | diff_begin(DCfg.diffFlags); |
| 2864 | diff_print_filenames(g.argv[2], g.argv[3], DCfg.diffFlags, &out); |
| 2865 | blob_read_from_file(&a, g.argv[2], ExtFILE); |
| 2866 | blob_read_from_file(&b, g.argv[3], ExtFILE); |
| 2867 | text_diff(&a, &b, &out, pRe, &DCfg); |
| 2868 | blob_write_to_file(&out, "-"); |
| 2869 | diff_end(DCfg.diffFlags, 0); |
| 2870 | re_free(pRe); |
| 2871 | } |
| 2872 | |
| 2873 | /************************************************************************** |
| 2874 | ** The basic difference engine is above. What follows is the annotation |
| 2875 |
+9
-10
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -1112,11 +1112,10 @@ | ||
| 1112 | 1112 | const char *zBranch; /* Branch to diff */ |
| 1113 | 1113 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 1114 | 1114 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 1115 | 1115 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 1116 | 1116 | int againstUndo = 0; /* Diff against files in the undo buffer */ |
| 1117 | - u64 diffFlags = 0; /* Flags to control the DIFF */ | |
| 1118 | 1117 | FileDirList *pFileDir = 0; /* Restrict the diff to these files */ |
| 1119 | 1118 | DiffConfig DCfg; /* Diff configuration object */ |
| 1120 | 1119 | |
| 1121 | 1120 | if( find_option("tk",0,0)!=0 || has_option("tclsh") ){ |
| 1122 | 1121 | diff_tk("diff", 2); |
| @@ -1127,16 +1126,16 @@ | ||
| 1127 | 1126 | zFrom = find_option("from", "r", 1); |
| 1128 | 1127 | zTo = find_option("to", 0, 1); |
| 1129 | 1128 | zCheckin = find_option("checkin", 0, 1); |
| 1130 | 1129 | zBranch = find_option("branch", 0, 1); |
| 1131 | 1130 | againstUndo = find_option("undo",0,0)!=0; |
| 1132 | - diffFlags = diff_options(&DCfg); | |
| 1131 | + diff_options(&DCfg, isGDiff); | |
| 1133 | 1132 | verboseFlag = find_option("verbose","v",0)!=0; |
| 1134 | 1133 | if( !verboseFlag ){ |
| 1135 | 1134 | verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */ |
| 1136 | 1135 | } |
| 1137 | - if( verboseFlag ) diffFlags |= DIFF_VERBOSE; | |
| 1136 | + if( verboseFlag ) DCfg.diffFlags |= DIFF_VERBOSE; | |
| 1138 | 1137 | if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){ |
| 1139 | 1138 | fossil_fatal("cannot use --undo together with --from, --to, --checkin," |
| 1140 | 1139 | " or --branch"); |
| 1141 | 1140 | } |
| 1142 | 1141 | if( zBranch ){ |
| @@ -1156,11 +1155,11 @@ | ||
| 1156 | 1155 | fossil_fatal("must use --from if --to is present"); |
| 1157 | 1156 | }else{ |
| 1158 | 1157 | db_find_and_open_repository(0, 0); |
| 1159 | 1158 | } |
| 1160 | 1159 | if( !isInternDiff |
| 1161 | - && (diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */ | |
| 1160 | + && (DCfg.diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */ | |
| 1162 | 1161 | ){ |
| 1163 | 1162 | zDiffCmd = find_option("command", 0, 1); |
| 1164 | 1163 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 1165 | 1164 | } |
| 1166 | 1165 | zBinGlob = diff_get_binary_glob(); |
| @@ -1194,24 +1193,24 @@ | ||
| 1194 | 1193 | ridTo); |
| 1195 | 1194 | if( zFrom==0 ){ |
| 1196 | 1195 | fossil_fatal("check-in %s has no parent", zTo); |
| 1197 | 1196 | } |
| 1198 | 1197 | } |
| 1199 | - diff_begin(diffFlags); | |
| 1198 | + diff_begin(DCfg.diffFlags); | |
| 1200 | 1199 | if( againstUndo ){ |
| 1201 | 1200 | if( db_lget_int("undo_available",0)==0 ){ |
| 1202 | 1201 | fossil_print("No undo or redo is available\n"); |
| 1203 | 1202 | return; |
| 1204 | 1203 | } |
| 1205 | 1204 | diff_against_undo(zDiffCmd, zBinGlob, fIncludeBinary, |
| 1206 | - diffFlags, pFileDir); | |
| 1205 | + DCfg.diffFlags, pFileDir); | |
| 1207 | 1206 | }else if( zTo==0 ){ |
| 1208 | 1207 | diff_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1209 | - diffFlags, pFileDir, 0); | |
| 1208 | + DCfg.diffFlags, pFileDir, 0); | |
| 1210 | 1209 | }else{ |
| 1211 | 1210 | diff_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1212 | - diffFlags, pFileDir); | |
| 1211 | + DCfg.diffFlags, pFileDir); | |
| 1213 | 1212 | } |
| 1214 | 1213 | if( pFileDir ){ |
| 1215 | 1214 | int i; |
| 1216 | 1215 | for(i=0; pFileDir[i].zName; i++){ |
| 1217 | 1216 | if( pFileDir[i].nUsed==0 |
| @@ -1222,12 +1221,12 @@ | ||
| 1222 | 1221 | } |
| 1223 | 1222 | fossil_free(pFileDir[i].zName); |
| 1224 | 1223 | } |
| 1225 | 1224 | fossil_free(pFileDir); |
| 1226 | 1225 | } |
| 1227 | - diff_end(diffFlags, 0); | |
| 1228 | - if ( diffFlags & DIFF_NUMSTAT ){ | |
| 1226 | + diff_end(DCfg.diffFlags, 0); | |
| 1227 | + if ( DCfg.diffFlags & DIFF_NUMSTAT ){ | |
| 1229 | 1228 | fossil_print("%10d %10d TOTAL over %d changed files\n", |
| 1230 | 1229 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1231 | 1230 | } |
| 1232 | 1231 | } |
| 1233 | 1232 | |
| 1234 | 1233 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1112,11 +1112,10 @@ | |
| 1112 | const char *zBranch; /* Branch to diff */ |
| 1113 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 1114 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 1115 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 1116 | int againstUndo = 0; /* Diff against files in the undo buffer */ |
| 1117 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 1118 | FileDirList *pFileDir = 0; /* Restrict the diff to these files */ |
| 1119 | DiffConfig DCfg; /* Diff configuration object */ |
| 1120 | |
| 1121 | if( find_option("tk",0,0)!=0 || has_option("tclsh") ){ |
| 1122 | diff_tk("diff", 2); |
| @@ -1127,16 +1126,16 @@ | |
| 1127 | zFrom = find_option("from", "r", 1); |
| 1128 | zTo = find_option("to", 0, 1); |
| 1129 | zCheckin = find_option("checkin", 0, 1); |
| 1130 | zBranch = find_option("branch", 0, 1); |
| 1131 | againstUndo = find_option("undo",0,0)!=0; |
| 1132 | diffFlags = diff_options(&DCfg); |
| 1133 | verboseFlag = find_option("verbose","v",0)!=0; |
| 1134 | if( !verboseFlag ){ |
| 1135 | verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */ |
| 1136 | } |
| 1137 | if( verboseFlag ) diffFlags |= DIFF_VERBOSE; |
| 1138 | if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){ |
| 1139 | fossil_fatal("cannot use --undo together with --from, --to, --checkin," |
| 1140 | " or --branch"); |
| 1141 | } |
| 1142 | if( zBranch ){ |
| @@ -1156,11 +1155,11 @@ | |
| 1156 | fossil_fatal("must use --from if --to is present"); |
| 1157 | }else{ |
| 1158 | db_find_and_open_repository(0, 0); |
| 1159 | } |
| 1160 | if( !isInternDiff |
| 1161 | && (diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */ |
| 1162 | ){ |
| 1163 | zDiffCmd = find_option("command", 0, 1); |
| 1164 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 1165 | } |
| 1166 | zBinGlob = diff_get_binary_glob(); |
| @@ -1194,24 +1193,24 @@ | |
| 1194 | ridTo); |
| 1195 | if( zFrom==0 ){ |
| 1196 | fossil_fatal("check-in %s has no parent", zTo); |
| 1197 | } |
| 1198 | } |
| 1199 | diff_begin(diffFlags); |
| 1200 | if( againstUndo ){ |
| 1201 | if( db_lget_int("undo_available",0)==0 ){ |
| 1202 | fossil_print("No undo or redo is available\n"); |
| 1203 | return; |
| 1204 | } |
| 1205 | diff_against_undo(zDiffCmd, zBinGlob, fIncludeBinary, |
| 1206 | diffFlags, pFileDir); |
| 1207 | }else if( zTo==0 ){ |
| 1208 | diff_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1209 | diffFlags, pFileDir, 0); |
| 1210 | }else{ |
| 1211 | diff_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1212 | diffFlags, pFileDir); |
| 1213 | } |
| 1214 | if( pFileDir ){ |
| 1215 | int i; |
| 1216 | for(i=0; pFileDir[i].zName; i++){ |
| 1217 | if( pFileDir[i].nUsed==0 |
| @@ -1222,12 +1221,12 @@ | |
| 1222 | } |
| 1223 | fossil_free(pFileDir[i].zName); |
| 1224 | } |
| 1225 | fossil_free(pFileDir); |
| 1226 | } |
| 1227 | diff_end(diffFlags, 0); |
| 1228 | if ( diffFlags & DIFF_NUMSTAT ){ |
| 1229 | fossil_print("%10d %10d TOTAL over %d changed files\n", |
| 1230 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1231 | } |
| 1232 | } |
| 1233 | |
| 1234 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1112,11 +1112,10 @@ | |
| 1112 | const char *zBranch; /* Branch to diff */ |
| 1113 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 1114 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 1115 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 1116 | int againstUndo = 0; /* Diff against files in the undo buffer */ |
| 1117 | FileDirList *pFileDir = 0; /* Restrict the diff to these files */ |
| 1118 | DiffConfig DCfg; /* Diff configuration object */ |
| 1119 | |
| 1120 | if( find_option("tk",0,0)!=0 || has_option("tclsh") ){ |
| 1121 | diff_tk("diff", 2); |
| @@ -1127,16 +1126,16 @@ | |
| 1126 | zFrom = find_option("from", "r", 1); |
| 1127 | zTo = find_option("to", 0, 1); |
| 1128 | zCheckin = find_option("checkin", 0, 1); |
| 1129 | zBranch = find_option("branch", 0, 1); |
| 1130 | againstUndo = find_option("undo",0,0)!=0; |
| 1131 | diff_options(&DCfg, isGDiff); |
| 1132 | verboseFlag = find_option("verbose","v",0)!=0; |
| 1133 | if( !verboseFlag ){ |
| 1134 | verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */ |
| 1135 | } |
| 1136 | if( verboseFlag ) DCfg.diffFlags |= DIFF_VERBOSE; |
| 1137 | if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){ |
| 1138 | fossil_fatal("cannot use --undo together with --from, --to, --checkin," |
| 1139 | " or --branch"); |
| 1140 | } |
| 1141 | if( zBranch ){ |
| @@ -1156,11 +1155,11 @@ | |
| 1155 | fossil_fatal("must use --from if --to is present"); |
| 1156 | }else{ |
| 1157 | db_find_and_open_repository(0, 0); |
| 1158 | } |
| 1159 | if( !isInternDiff |
| 1160 | && (DCfg.diffFlags & DIFF_HTML)==0 /* External diff can't generate HTML */ |
| 1161 | ){ |
| 1162 | zDiffCmd = find_option("command", 0, 1); |
| 1163 | if( zDiffCmd==0 ) zDiffCmd = diff_command_external(isGDiff); |
| 1164 | } |
| 1165 | zBinGlob = diff_get_binary_glob(); |
| @@ -1194,24 +1193,24 @@ | |
| 1193 | ridTo); |
| 1194 | if( zFrom==0 ){ |
| 1195 | fossil_fatal("check-in %s has no parent", zTo); |
| 1196 | } |
| 1197 | } |
| 1198 | diff_begin(DCfg.diffFlags); |
| 1199 | if( againstUndo ){ |
| 1200 | if( db_lget_int("undo_available",0)==0 ){ |
| 1201 | fossil_print("No undo or redo is available\n"); |
| 1202 | return; |
| 1203 | } |
| 1204 | diff_against_undo(zDiffCmd, zBinGlob, fIncludeBinary, |
| 1205 | DCfg.diffFlags, pFileDir); |
| 1206 | }else if( zTo==0 ){ |
| 1207 | diff_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1208 | DCfg.diffFlags, pFileDir, 0); |
| 1209 | }else{ |
| 1210 | diff_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 1211 | DCfg.diffFlags, pFileDir); |
| 1212 | } |
| 1213 | if( pFileDir ){ |
| 1214 | int i; |
| 1215 | for(i=0; pFileDir[i].zName; i++){ |
| 1216 | if( pFileDir[i].nUsed==0 |
| @@ -1222,12 +1221,12 @@ | |
| 1221 | } |
| 1222 | fossil_free(pFileDir[i].zName); |
| 1223 | } |
| 1224 | fossil_free(pFileDir); |
| 1225 | } |
| 1226 | diff_end(DCfg.diffFlags, 0); |
| 1227 | if ( DCfg.diffFlags & DIFF_NUMSTAT ){ |
| 1228 | fossil_print("%10d %10d TOTAL over %d changed files\n", |
| 1229 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1230 | } |
| 1231 | } |
| 1232 | |
| 1233 |
+13
-14
| --- src/patch.c | ||
| +++ src/patch.c | ||
| @@ -720,15 +720,15 @@ | ||
| 720 | 720 | static void patch_diff( |
| 721 | 721 | unsigned mFlags, /* Patch flags. only -f is allowed */ |
| 722 | 722 | const char *zDiffCmd, /* Command used for diffing */ |
| 723 | 723 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 724 | 724 | int fIncludeBinary, /* Do diffs against binary files */ |
| 725 | - u64 diffFlags /* Other diff flags */ | |
| 725 | + DiffConfig *pCfg /* Diff options */ | |
| 726 | 726 | ){ |
| 727 | 727 | int nErr = 0; |
| 728 | 728 | Stmt q; |
| 729 | - int bWebpage = (diffFlags & DIFF_WEBPAGE)!=0; | |
| 729 | + int bWebpage = (pCfg->diffFlags & DIFF_WEBPAGE)!=0; | |
| 730 | 730 | Blob empty; |
| 731 | 731 | blob_zero(&empty); |
| 732 | 732 | |
| 733 | 733 | if( (mFlags & PATCH_FORCE)==0 ){ |
| 734 | 734 | /* Check to ensure that the patch is against the repository that |
| @@ -764,11 +764,11 @@ | ||
| 764 | 764 | "in the %s repository", zBaseline, g.zRepositoryName); |
| 765 | 765 | } |
| 766 | 766 | } |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | - diff_begin(diffFlags); | |
| 769 | + diff_begin(pCfg->diffFlags); | |
| 770 | 770 | db_prepare(&q, |
| 771 | 771 | "SELECT" |
| 772 | 772 | " (SELECT blob.rid FROM blob WHERE blob.uuid=chng.hash)," |
| 773 | 773 | " pathname," /* 1: new pathname */ |
| 774 | 774 | " origname," /* 2: original pathname. Null if not renamed */ |
| @@ -804,25 +804,25 @@ | ||
| 804 | 804 | zName = db_column_text(&q, 1); |
| 805 | 805 | rid = db_column_int(&q, 0); |
| 806 | 806 | |
| 807 | 807 | if( db_column_type(&q,3)==SQLITE_NULL ){ |
| 808 | 808 | if( !bWebpage ) fossil_print("DELETE %s\n", zName); |
| 809 | - diff_print_index(zName, diffFlags, 0); | |
| 809 | + diff_print_index(zName, pCfg->diffFlags, 0); | |
| 810 | 810 | isBin2 = 0; |
| 811 | 811 | content_get(rid, &a); |
| 812 | 812 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 813 | 813 | diff_file_mem(&a, &empty, isBin1, isBin2, zName, zDiffCmd, |
| 814 | - zBinGlob, fIncludeBinary, diffFlags); | |
| 814 | + zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 815 | 815 | }else if( rid==0 ){ |
| 816 | 816 | db_ephemeral_blob(&q, 3, &a); |
| 817 | 817 | blob_uncompress(&a, &a); |
| 818 | 818 | if( !bWebpage ) fossil_print("ADDED %s\n", zName); |
| 819 | - diff_print_index(zName, diffFlags, 0); | |
| 819 | + diff_print_index(zName, pCfg->diffFlags, 0); | |
| 820 | 820 | isBin1 = 0; |
| 821 | 821 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 822 | 822 | diff_file_mem(&empty, &a, isBin1, isBin2, zName, zDiffCmd, |
| 823 | - zBinGlob, fIncludeBinary, diffFlags); | |
| 823 | + zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 824 | 824 | blob_reset(&a); |
| 825 | 825 | }else if( db_column_bytes(&q, 3)>0 ){ |
| 826 | 826 | Blob delta; |
| 827 | 827 | db_ephemeral_blob(&q, 3, &delta); |
| 828 | 828 | blob_uncompress(&delta, &delta); |
| @@ -829,18 +829,18 @@ | ||
| 829 | 829 | content_get(rid, &a); |
| 830 | 830 | blob_delta_apply(&a, &delta, &b); |
| 831 | 831 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 832 | 832 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 833 | 833 | diff_file_mem(&a, &b, isBin1, isBin2, zName, |
| 834 | - zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); | |
| 834 | + zDiffCmd, zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 835 | 835 | blob_reset(&a); |
| 836 | 836 | blob_reset(&b); |
| 837 | 837 | blob_reset(&delta); |
| 838 | 838 | } |
| 839 | 839 | } |
| 840 | 840 | db_finalize(&q); |
| 841 | - diff_end(diffFlags, nErr); | |
| 841 | + diff_end(pCfg->diffFlags, nErr); | |
| 842 | 842 | if( nErr ) fossil_fatal("abort due to prior errors"); |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | |
| 846 | 846 | /* |
| @@ -949,37 +949,36 @@ | ||
| 949 | 949 | }else |
| 950 | 950 | if( strncmp(zCmd, "diff", n)==0 ){ |
| 951 | 951 | const char *zDiffCmd = 0; |
| 952 | 952 | const char *zBinGlob = 0; |
| 953 | 953 | int fIncludeBinary = 0; |
| 954 | - u64 diffFlags; | |
| 955 | 954 | char *zIn; |
| 956 | 955 | unsigned flags = 0; |
| 957 | 956 | DiffConfig DCfg; |
| 958 | 957 | |
| 959 | 958 | if( find_option("tk",0,0)!=0 ){ |
| 960 | 959 | db_close(0); |
| 961 | 960 | diff_tk("patch diff", 3); |
| 962 | 961 | return; |
| 963 | 962 | } |
| 964 | - diffFlags = diff_options(&DCfg); | |
| 963 | + diff_options(&DCfg, zCmd[0]=='g'); | |
| 965 | 964 | if( find_option("internal","i",0)==0 |
| 966 | - && (diffFlags & DIFF_HTML)==0 | |
| 965 | + && (DCfg.diffFlags & DIFF_HTML)==0 | |
| 967 | 966 | ){ |
| 968 | 967 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 969 | 968 | } |
| 970 | - if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; | |
| 969 | + if( find_option("verbose","v",0)!=0 ) DCfg.diffFlags |= DIFF_VERBOSE; | |
| 971 | 970 | if( zDiffCmd ){ |
| 972 | 971 | zBinGlob = diff_get_binary_glob(); |
| 973 | 972 | fIncludeBinary = diff_include_binary_files(); |
| 974 | 973 | } |
| 975 | 974 | db_find_and_open_repository(0, 0); |
| 976 | 975 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 977 | 976 | verify_all_options(); |
| 978 | 977 | zIn = patch_find_patch_filename("apply"); |
| 979 | 978 | patch_attach(zIn, stdin); |
| 980 | - patch_diff(flags, zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); | |
| 979 | + patch_diff(flags, zDiffCmd, zBinGlob, fIncludeBinary, &DCfg); | |
| 981 | 980 | fossil_free(zIn); |
| 982 | 981 | }else |
| 983 | 982 | if( strncmp(zCmd, "pull", n)==0 ){ |
| 984 | 983 | FILE *pIn = 0; |
| 985 | 984 | unsigned flags = 0; |
| 986 | 985 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -720,15 +720,15 @@ | |
| 720 | static void patch_diff( |
| 721 | unsigned mFlags, /* Patch flags. only -f is allowed */ |
| 722 | const char *zDiffCmd, /* Command used for diffing */ |
| 723 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 724 | int fIncludeBinary, /* Do diffs against binary files */ |
| 725 | u64 diffFlags /* Other diff flags */ |
| 726 | ){ |
| 727 | int nErr = 0; |
| 728 | Stmt q; |
| 729 | int bWebpage = (diffFlags & DIFF_WEBPAGE)!=0; |
| 730 | Blob empty; |
| 731 | blob_zero(&empty); |
| 732 | |
| 733 | if( (mFlags & PATCH_FORCE)==0 ){ |
| 734 | /* Check to ensure that the patch is against the repository that |
| @@ -764,11 +764,11 @@ | |
| 764 | "in the %s repository", zBaseline, g.zRepositoryName); |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | diff_begin(diffFlags); |
| 770 | db_prepare(&q, |
| 771 | "SELECT" |
| 772 | " (SELECT blob.rid FROM blob WHERE blob.uuid=chng.hash)," |
| 773 | " pathname," /* 1: new pathname */ |
| 774 | " origname," /* 2: original pathname. Null if not renamed */ |
| @@ -804,25 +804,25 @@ | |
| 804 | zName = db_column_text(&q, 1); |
| 805 | rid = db_column_int(&q, 0); |
| 806 | |
| 807 | if( db_column_type(&q,3)==SQLITE_NULL ){ |
| 808 | if( !bWebpage ) fossil_print("DELETE %s\n", zName); |
| 809 | diff_print_index(zName, diffFlags, 0); |
| 810 | isBin2 = 0; |
| 811 | content_get(rid, &a); |
| 812 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 813 | diff_file_mem(&a, &empty, isBin1, isBin2, zName, zDiffCmd, |
| 814 | zBinGlob, fIncludeBinary, diffFlags); |
| 815 | }else if( rid==0 ){ |
| 816 | db_ephemeral_blob(&q, 3, &a); |
| 817 | blob_uncompress(&a, &a); |
| 818 | if( !bWebpage ) fossil_print("ADDED %s\n", zName); |
| 819 | diff_print_index(zName, diffFlags, 0); |
| 820 | isBin1 = 0; |
| 821 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 822 | diff_file_mem(&empty, &a, isBin1, isBin2, zName, zDiffCmd, |
| 823 | zBinGlob, fIncludeBinary, diffFlags); |
| 824 | blob_reset(&a); |
| 825 | }else if( db_column_bytes(&q, 3)>0 ){ |
| 826 | Blob delta; |
| 827 | db_ephemeral_blob(&q, 3, &delta); |
| 828 | blob_uncompress(&delta, &delta); |
| @@ -829,18 +829,18 @@ | |
| 829 | content_get(rid, &a); |
| 830 | blob_delta_apply(&a, &delta, &b); |
| 831 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 832 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 833 | diff_file_mem(&a, &b, isBin1, isBin2, zName, |
| 834 | zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); |
| 835 | blob_reset(&a); |
| 836 | blob_reset(&b); |
| 837 | blob_reset(&delta); |
| 838 | } |
| 839 | } |
| 840 | db_finalize(&q); |
| 841 | diff_end(diffFlags, nErr); |
| 842 | if( nErr ) fossil_fatal("abort due to prior errors"); |
| 843 | } |
| 844 | |
| 845 | |
| 846 | /* |
| @@ -949,37 +949,36 @@ | |
| 949 | }else |
| 950 | if( strncmp(zCmd, "diff", n)==0 ){ |
| 951 | const char *zDiffCmd = 0; |
| 952 | const char *zBinGlob = 0; |
| 953 | int fIncludeBinary = 0; |
| 954 | u64 diffFlags; |
| 955 | char *zIn; |
| 956 | unsigned flags = 0; |
| 957 | DiffConfig DCfg; |
| 958 | |
| 959 | if( find_option("tk",0,0)!=0 ){ |
| 960 | db_close(0); |
| 961 | diff_tk("patch diff", 3); |
| 962 | return; |
| 963 | } |
| 964 | diffFlags = diff_options(&DCfg); |
| 965 | if( find_option("internal","i",0)==0 |
| 966 | && (diffFlags & DIFF_HTML)==0 |
| 967 | ){ |
| 968 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 969 | } |
| 970 | if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; |
| 971 | if( zDiffCmd ){ |
| 972 | zBinGlob = diff_get_binary_glob(); |
| 973 | fIncludeBinary = diff_include_binary_files(); |
| 974 | } |
| 975 | db_find_and_open_repository(0, 0); |
| 976 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 977 | verify_all_options(); |
| 978 | zIn = patch_find_patch_filename("apply"); |
| 979 | patch_attach(zIn, stdin); |
| 980 | patch_diff(flags, zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); |
| 981 | fossil_free(zIn); |
| 982 | }else |
| 983 | if( strncmp(zCmd, "pull", n)==0 ){ |
| 984 | FILE *pIn = 0; |
| 985 | unsigned flags = 0; |
| 986 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -720,15 +720,15 @@ | |
| 720 | static void patch_diff( |
| 721 | unsigned mFlags, /* Patch flags. only -f is allowed */ |
| 722 | const char *zDiffCmd, /* Command used for diffing */ |
| 723 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 724 | int fIncludeBinary, /* Do diffs against binary files */ |
| 725 | DiffConfig *pCfg /* Diff options */ |
| 726 | ){ |
| 727 | int nErr = 0; |
| 728 | Stmt q; |
| 729 | int bWebpage = (pCfg->diffFlags & DIFF_WEBPAGE)!=0; |
| 730 | Blob empty; |
| 731 | blob_zero(&empty); |
| 732 | |
| 733 | if( (mFlags & PATCH_FORCE)==0 ){ |
| 734 | /* Check to ensure that the patch is against the repository that |
| @@ -764,11 +764,11 @@ | |
| 764 | "in the %s repository", zBaseline, g.zRepositoryName); |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | diff_begin(pCfg->diffFlags); |
| 770 | db_prepare(&q, |
| 771 | "SELECT" |
| 772 | " (SELECT blob.rid FROM blob WHERE blob.uuid=chng.hash)," |
| 773 | " pathname," /* 1: new pathname */ |
| 774 | " origname," /* 2: original pathname. Null if not renamed */ |
| @@ -804,25 +804,25 @@ | |
| 804 | zName = db_column_text(&q, 1); |
| 805 | rid = db_column_int(&q, 0); |
| 806 | |
| 807 | if( db_column_type(&q,3)==SQLITE_NULL ){ |
| 808 | if( !bWebpage ) fossil_print("DELETE %s\n", zName); |
| 809 | diff_print_index(zName, pCfg->diffFlags, 0); |
| 810 | isBin2 = 0; |
| 811 | content_get(rid, &a); |
| 812 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 813 | diff_file_mem(&a, &empty, isBin1, isBin2, zName, zDiffCmd, |
| 814 | zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 815 | }else if( rid==0 ){ |
| 816 | db_ephemeral_blob(&q, 3, &a); |
| 817 | blob_uncompress(&a, &a); |
| 818 | if( !bWebpage ) fossil_print("ADDED %s\n", zName); |
| 819 | diff_print_index(zName, pCfg->diffFlags, 0); |
| 820 | isBin1 = 0; |
| 821 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 822 | diff_file_mem(&empty, &a, isBin1, isBin2, zName, zDiffCmd, |
| 823 | zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 824 | blob_reset(&a); |
| 825 | }else if( db_column_bytes(&q, 3)>0 ){ |
| 826 | Blob delta; |
| 827 | db_ephemeral_blob(&q, 3, &delta); |
| 828 | blob_uncompress(&delta, &delta); |
| @@ -829,18 +829,18 @@ | |
| 829 | content_get(rid, &a); |
| 830 | blob_delta_apply(&a, &delta, &b); |
| 831 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 832 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 833 | diff_file_mem(&a, &b, isBin1, isBin2, zName, |
| 834 | zDiffCmd, zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 835 | blob_reset(&a); |
| 836 | blob_reset(&b); |
| 837 | blob_reset(&delta); |
| 838 | } |
| 839 | } |
| 840 | db_finalize(&q); |
| 841 | diff_end(pCfg->diffFlags, nErr); |
| 842 | if( nErr ) fossil_fatal("abort due to prior errors"); |
| 843 | } |
| 844 | |
| 845 | |
| 846 | /* |
| @@ -949,37 +949,36 @@ | |
| 949 | }else |
| 950 | if( strncmp(zCmd, "diff", n)==0 ){ |
| 951 | const char *zDiffCmd = 0; |
| 952 | const char *zBinGlob = 0; |
| 953 | int fIncludeBinary = 0; |
| 954 | char *zIn; |
| 955 | unsigned flags = 0; |
| 956 | DiffConfig DCfg; |
| 957 | |
| 958 | if( find_option("tk",0,0)!=0 ){ |
| 959 | db_close(0); |
| 960 | diff_tk("patch diff", 3); |
| 961 | return; |
| 962 | } |
| 963 | diff_options(&DCfg, zCmd[0]=='g'); |
| 964 | if( find_option("internal","i",0)==0 |
| 965 | && (DCfg.diffFlags & DIFF_HTML)==0 |
| 966 | ){ |
| 967 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 968 | } |
| 969 | if( find_option("verbose","v",0)!=0 ) DCfg.diffFlags |= DIFF_VERBOSE; |
| 970 | if( zDiffCmd ){ |
| 971 | zBinGlob = diff_get_binary_glob(); |
| 972 | fIncludeBinary = diff_include_binary_files(); |
| 973 | } |
| 974 | db_find_and_open_repository(0, 0); |
| 975 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 976 | verify_all_options(); |
| 977 | zIn = patch_find_patch_filename("apply"); |
| 978 | patch_attach(zIn, stdin); |
| 979 | patch_diff(flags, zDiffCmd, zBinGlob, fIncludeBinary, &DCfg); |
| 980 | fossil_free(zIn); |
| 981 | }else |
| 982 | if( strncmp(zCmd, "pull", n)==0 ){ |
| 983 | FILE *pIn = 0; |
| 984 | unsigned flags = 0; |
| 985 |
+16
-18
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -406,17 +406,17 @@ | ||
| 406 | 406 | int stashid, /* The stash entry to diff */ |
| 407 | 407 | const char *zDiffCmd, /* Command used for diffing */ |
| 408 | 408 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 409 | 409 | int fBaseline, /* Diff against original baseline check-in if true */ |
| 410 | 410 | int fIncludeBinary, /* Do diffs against binary files */ |
| 411 | - u64 diffFlags /* Other diff flags */ | |
| 411 | + DiffConfig *pCfg /* Diff formatting options */ | |
| 412 | 412 | ){ |
| 413 | 413 | Stmt q; |
| 414 | 414 | Blob empty; |
| 415 | - int bWebpage = (diffFlags & DIFF_WEBPAGE)!=0; | |
| 415 | + int bWebpage = (pCfg->diffFlags & DIFF_WEBPAGE)!=0; | |
| 416 | 416 | blob_zero(&empty); |
| 417 | - diff_begin(diffFlags); | |
| 417 | + diff_begin(pCfg->diffFlags); | |
| 418 | 418 | db_prepare(&q, |
| 419 | 419 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 420 | 420 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", |
| 421 | 421 | stashid |
| 422 | 422 | ); |
| @@ -430,56 +430,56 @@ | ||
| 430 | 430 | char *zOPath = mprintf("%s%s", g.zLocalRoot, zOrig); |
| 431 | 431 | Blob a, b; |
| 432 | 432 | if( rid==0 ){ |
| 433 | 433 | db_ephemeral_blob(&q, 6, &a); |
| 434 | 434 | if( !bWebpage ) fossil_print("ADDED %s\n", zNew); |
| 435 | - diff_print_index(zNew, diffFlags, 0); | |
| 435 | + diff_print_index(zNew, pCfg->diffFlags, 0); | |
| 436 | 436 | isBin1 = 0; |
| 437 | 437 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 438 | 438 | diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd, |
| 439 | - zBinGlob, fIncludeBinary, diffFlags); | |
| 439 | + zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 440 | 440 | }else if( isRemoved ){ |
| 441 | 441 | if( !bWebpage) fossil_print("DELETE %s\n", zOrig); |
| 442 | - diff_print_index(zNew, diffFlags, 0); | |
| 442 | + diff_print_index(zNew, pCfg->diffFlags, 0); | |
| 443 | 443 | isBin2 = 0; |
| 444 | 444 | if( fBaseline ){ |
| 445 | 445 | content_get(rid, &a); |
| 446 | 446 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 447 | 447 | diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd, |
| 448 | - zBinGlob, fIncludeBinary, diffFlags); | |
| 448 | + zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 449 | 449 | } |
| 450 | 450 | }else{ |
| 451 | 451 | Blob delta; |
| 452 | 452 | int isOrigLink = file_islink(zOPath); |
| 453 | 453 | db_ephemeral_blob(&q, 6, &delta); |
| 454 | 454 | if( !bWebpage ) fossil_print("CHANGED %s\n", zNew); |
| 455 | 455 | if( !isOrigLink != !isLink ){ |
| 456 | - diff_print_index(zNew, diffFlags, 0); | |
| 457 | - diff_print_filenames(zOrig, zNew, diffFlags, 0); | |
| 456 | + diff_print_index(zNew, pCfg->diffFlags, 0); | |
| 457 | + diff_print_filenames(zOrig, zNew, pCfg->diffFlags, 0); | |
| 458 | 458 | printf(DIFF_CANNOT_COMPUTE_SYMLINK); |
| 459 | 459 | }else{ |
| 460 | 460 | content_get(rid, &a); |
| 461 | 461 | blob_delta_apply(&a, &delta, &b); |
| 462 | 462 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 463 | 463 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 464 | 464 | if( fBaseline ){ |
| 465 | 465 | diff_file_mem(&a, &b, isBin1, isBin2, zNew, |
| 466 | - zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); | |
| 466 | + zDiffCmd, zBinGlob, fIncludeBinary, pCfg->diffFlags); | |
| 467 | 467 | }else{ |
| 468 | 468 | /*Diff with file on disk using fSwapDiff=1 to show the diff in the |
| 469 | 469 | same direction as if fBaseline=1.*/ |
| 470 | 470 | diff_file(&b, isBin2, zOPath, zNew, zDiffCmd, |
| 471 | - zBinGlob, fIncludeBinary, diffFlags, 1, 0); | |
| 471 | + zBinGlob, fIncludeBinary, pCfg->diffFlags, 1, 0); | |
| 472 | 472 | } |
| 473 | 473 | blob_reset(&a); |
| 474 | 474 | blob_reset(&b); |
| 475 | 475 | } |
| 476 | 476 | blob_reset(&delta); |
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | db_finalize(&q); |
| 480 | - diff_end(diffFlags, 0); | |
| 480 | + diff_end(pCfg->diffFlags, 0); | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | /* |
| 484 | 484 | ** Drop the indicated stash |
| 485 | 485 | */ |
| @@ -744,11 +744,10 @@ | ||
| 744 | 744 | ){ |
| 745 | 745 | const char *zDiffCmd = 0; |
| 746 | 746 | const char *zBinGlob = 0; |
| 747 | 747 | int fIncludeBinary = 0; |
| 748 | 748 | int fBaseline = 0; |
| 749 | - u64 diffFlags; | |
| 750 | 749 | DiffConfig DCfg; |
| 751 | 750 | |
| 752 | 751 | if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){ |
| 753 | 752 | fBaseline = 1; |
| 754 | 753 | } |
| @@ -755,25 +754,24 @@ | ||
| 755 | 754 | if( find_option("tk",0,0)!=0 ){ |
| 756 | 755 | db_close(0); |
| 757 | 756 | diff_tk(fBaseline ? "stash show" : "stash diff", 3); |
| 758 | 757 | return; |
| 759 | 758 | } |
| 760 | - diffFlags = diff_options(&DCfg); | |
| 759 | + diff_options(&DCfg, zCmd[0]=='g'); | |
| 761 | 760 | if( find_option("internal","i",0)==0 |
| 762 | - && (diffFlags & DIFF_HTML)==0 | |
| 761 | + && (DCfg.diffFlags & DIFF_HTML)==0 | |
| 763 | 762 | ){ |
| 764 | 763 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 765 | 764 | } |
| 766 | - if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; | |
| 765 | + if( find_option("verbose","v",0)!=0 ) DCfg.diffFlags |= DIFF_VERBOSE; | |
| 767 | 766 | if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd)); |
| 768 | 767 | if( zDiffCmd ){ |
| 769 | 768 | zBinGlob = diff_get_binary_glob(); |
| 770 | 769 | fIncludeBinary = diff_include_binary_files(); |
| 771 | 770 | } |
| 772 | 771 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 773 | - stash_diff(stashid, zDiffCmd, zBinGlob, fBaseline, fIncludeBinary, | |
| 774 | - diffFlags); | |
| 772 | + stash_diff(stashid, zDiffCmd, zBinGlob, fBaseline, fIncludeBinary, &DCfg); | |
| 775 | 773 | }else |
| 776 | 774 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 777 | 775 | g.argv[1] = "help"; |
| 778 | 776 | g.argv[2] = "stash"; |
| 779 | 777 | g.argc = 3; |
| 780 | 778 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -406,17 +406,17 @@ | |
| 406 | int stashid, /* The stash entry to diff */ |
| 407 | const char *zDiffCmd, /* Command used for diffing */ |
| 408 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 409 | int fBaseline, /* Diff against original baseline check-in if true */ |
| 410 | int fIncludeBinary, /* Do diffs against binary files */ |
| 411 | u64 diffFlags /* Other diff flags */ |
| 412 | ){ |
| 413 | Stmt q; |
| 414 | Blob empty; |
| 415 | int bWebpage = (diffFlags & DIFF_WEBPAGE)!=0; |
| 416 | blob_zero(&empty); |
| 417 | diff_begin(diffFlags); |
| 418 | db_prepare(&q, |
| 419 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 420 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", |
| 421 | stashid |
| 422 | ); |
| @@ -430,56 +430,56 @@ | |
| 430 | char *zOPath = mprintf("%s%s", g.zLocalRoot, zOrig); |
| 431 | Blob a, b; |
| 432 | if( rid==0 ){ |
| 433 | db_ephemeral_blob(&q, 6, &a); |
| 434 | if( !bWebpage ) fossil_print("ADDED %s\n", zNew); |
| 435 | diff_print_index(zNew, diffFlags, 0); |
| 436 | isBin1 = 0; |
| 437 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 438 | diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd, |
| 439 | zBinGlob, fIncludeBinary, diffFlags); |
| 440 | }else if( isRemoved ){ |
| 441 | if( !bWebpage) fossil_print("DELETE %s\n", zOrig); |
| 442 | diff_print_index(zNew, diffFlags, 0); |
| 443 | isBin2 = 0; |
| 444 | if( fBaseline ){ |
| 445 | content_get(rid, &a); |
| 446 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 447 | diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd, |
| 448 | zBinGlob, fIncludeBinary, diffFlags); |
| 449 | } |
| 450 | }else{ |
| 451 | Blob delta; |
| 452 | int isOrigLink = file_islink(zOPath); |
| 453 | db_ephemeral_blob(&q, 6, &delta); |
| 454 | if( !bWebpage ) fossil_print("CHANGED %s\n", zNew); |
| 455 | if( !isOrigLink != !isLink ){ |
| 456 | diff_print_index(zNew, diffFlags, 0); |
| 457 | diff_print_filenames(zOrig, zNew, diffFlags, 0); |
| 458 | printf(DIFF_CANNOT_COMPUTE_SYMLINK); |
| 459 | }else{ |
| 460 | content_get(rid, &a); |
| 461 | blob_delta_apply(&a, &delta, &b); |
| 462 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 463 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 464 | if( fBaseline ){ |
| 465 | diff_file_mem(&a, &b, isBin1, isBin2, zNew, |
| 466 | zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); |
| 467 | }else{ |
| 468 | /*Diff with file on disk using fSwapDiff=1 to show the diff in the |
| 469 | same direction as if fBaseline=1.*/ |
| 470 | diff_file(&b, isBin2, zOPath, zNew, zDiffCmd, |
| 471 | zBinGlob, fIncludeBinary, diffFlags, 1, 0); |
| 472 | } |
| 473 | blob_reset(&a); |
| 474 | blob_reset(&b); |
| 475 | } |
| 476 | blob_reset(&delta); |
| 477 | } |
| 478 | } |
| 479 | db_finalize(&q); |
| 480 | diff_end(diffFlags, 0); |
| 481 | } |
| 482 | |
| 483 | /* |
| 484 | ** Drop the indicated stash |
| 485 | */ |
| @@ -744,11 +744,10 @@ | |
| 744 | ){ |
| 745 | const char *zDiffCmd = 0; |
| 746 | const char *zBinGlob = 0; |
| 747 | int fIncludeBinary = 0; |
| 748 | int fBaseline = 0; |
| 749 | u64 diffFlags; |
| 750 | DiffConfig DCfg; |
| 751 | |
| 752 | if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){ |
| 753 | fBaseline = 1; |
| 754 | } |
| @@ -755,25 +754,24 @@ | |
| 755 | if( find_option("tk",0,0)!=0 ){ |
| 756 | db_close(0); |
| 757 | diff_tk(fBaseline ? "stash show" : "stash diff", 3); |
| 758 | return; |
| 759 | } |
| 760 | diffFlags = diff_options(&DCfg); |
| 761 | if( find_option("internal","i",0)==0 |
| 762 | && (diffFlags & DIFF_HTML)==0 |
| 763 | ){ |
| 764 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 765 | } |
| 766 | if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; |
| 767 | if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd)); |
| 768 | if( zDiffCmd ){ |
| 769 | zBinGlob = diff_get_binary_glob(); |
| 770 | fIncludeBinary = diff_include_binary_files(); |
| 771 | } |
| 772 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 773 | stash_diff(stashid, zDiffCmd, zBinGlob, fBaseline, fIncludeBinary, |
| 774 | diffFlags); |
| 775 | }else |
| 776 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 777 | g.argv[1] = "help"; |
| 778 | g.argv[2] = "stash"; |
| 779 | g.argc = 3; |
| 780 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -406,17 +406,17 @@ | |
| 406 | int stashid, /* The stash entry to diff */ |
| 407 | const char *zDiffCmd, /* Command used for diffing */ |
| 408 | const char *zBinGlob, /* GLOB pattern to determine binary files */ |
| 409 | int fBaseline, /* Diff against original baseline check-in if true */ |
| 410 | int fIncludeBinary, /* Do diffs against binary files */ |
| 411 | DiffConfig *pCfg /* Diff formatting options */ |
| 412 | ){ |
| 413 | Stmt q; |
| 414 | Blob empty; |
| 415 | int bWebpage = (pCfg->diffFlags & DIFF_WEBPAGE)!=0; |
| 416 | blob_zero(&empty); |
| 417 | diff_begin(pCfg->diffFlags); |
| 418 | db_prepare(&q, |
| 419 | "SELECT blob.rid, isRemoved, isExec, isLink, origname, newname, delta" |
| 420 | " FROM stashfile, blob WHERE stashid=%d AND blob.uuid=stashfile.hash", |
| 421 | stashid |
| 422 | ); |
| @@ -430,56 +430,56 @@ | |
| 430 | char *zOPath = mprintf("%s%s", g.zLocalRoot, zOrig); |
| 431 | Blob a, b; |
| 432 | if( rid==0 ){ |
| 433 | db_ephemeral_blob(&q, 6, &a); |
| 434 | if( !bWebpage ) fossil_print("ADDED %s\n", zNew); |
| 435 | diff_print_index(zNew, pCfg->diffFlags, 0); |
| 436 | isBin1 = 0; |
| 437 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 438 | diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd, |
| 439 | zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 440 | }else if( isRemoved ){ |
| 441 | if( !bWebpage) fossil_print("DELETE %s\n", zOrig); |
| 442 | diff_print_index(zNew, pCfg->diffFlags, 0); |
| 443 | isBin2 = 0; |
| 444 | if( fBaseline ){ |
| 445 | content_get(rid, &a); |
| 446 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 447 | diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd, |
| 448 | zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 449 | } |
| 450 | }else{ |
| 451 | Blob delta; |
| 452 | int isOrigLink = file_islink(zOPath); |
| 453 | db_ephemeral_blob(&q, 6, &delta); |
| 454 | if( !bWebpage ) fossil_print("CHANGED %s\n", zNew); |
| 455 | if( !isOrigLink != !isLink ){ |
| 456 | diff_print_index(zNew, pCfg->diffFlags, 0); |
| 457 | diff_print_filenames(zOrig, zNew, pCfg->diffFlags, 0); |
| 458 | printf(DIFF_CANNOT_COMPUTE_SYMLINK); |
| 459 | }else{ |
| 460 | content_get(rid, &a); |
| 461 | blob_delta_apply(&a, &delta, &b); |
| 462 | isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 463 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b); |
| 464 | if( fBaseline ){ |
| 465 | diff_file_mem(&a, &b, isBin1, isBin2, zNew, |
| 466 | zDiffCmd, zBinGlob, fIncludeBinary, pCfg->diffFlags); |
| 467 | }else{ |
| 468 | /*Diff with file on disk using fSwapDiff=1 to show the diff in the |
| 469 | same direction as if fBaseline=1.*/ |
| 470 | diff_file(&b, isBin2, zOPath, zNew, zDiffCmd, |
| 471 | zBinGlob, fIncludeBinary, pCfg->diffFlags, 1, 0); |
| 472 | } |
| 473 | blob_reset(&a); |
| 474 | blob_reset(&b); |
| 475 | } |
| 476 | blob_reset(&delta); |
| 477 | } |
| 478 | } |
| 479 | db_finalize(&q); |
| 480 | diff_end(pCfg->diffFlags, 0); |
| 481 | } |
| 482 | |
| 483 | /* |
| 484 | ** Drop the indicated stash |
| 485 | */ |
| @@ -744,11 +744,10 @@ | |
| 744 | ){ |
| 745 | const char *zDiffCmd = 0; |
| 746 | const char *zBinGlob = 0; |
| 747 | int fIncludeBinary = 0; |
| 748 | int fBaseline = 0; |
| 749 | DiffConfig DCfg; |
| 750 | |
| 751 | if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){ |
| 752 | fBaseline = 1; |
| 753 | } |
| @@ -755,25 +754,24 @@ | |
| 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 | diff_options(&DCfg, zCmd[0]=='g'); |
| 760 | if( find_option("internal","i",0)==0 |
| 761 | && (DCfg.diffFlags & DIFF_HTML)==0 |
| 762 | ){ |
| 763 | zDiffCmd = diff_command_external(zCmd[0]=='g'); |
| 764 | } |
| 765 | if( find_option("verbose","v",0)!=0 ) DCfg.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 | } |
| 771 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 772 | stash_diff(stashid, zDiffCmd, zBinGlob, fBaseline, fIncludeBinary, &DCfg); |
| 773 | }else |
| 774 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 775 | g.argv[1] = "help"; |
| 776 | g.argv[2] = "stash"; |
| 777 | g.argc = 3; |
| 778 |