Fossil SCM
(x)diff --context N, where N is a negative value, is now treated as infinite, per off-list feature request.
Commit
16d3d8b05eb100a76b9a953544fda1b4c677f2fceed2f57cc554081f5e5129f7
Parent
0aae0ef506501ef…
2 files changed
+3
-3
+3
-2
+3
-3
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2886,12 +2886,12 @@ | ||
| 2886 | 2886 | */ |
| 2887 | 2887 | int diff_context_lines(DiffConfig *pCfg){ |
| 2888 | 2888 | const int dflt = 5; |
| 2889 | 2889 | if(pCfg!=0){ |
| 2890 | 2890 | int n = pCfg->nContext; |
| 2891 | - if( n<=0 && (pCfg->diffFlags & DIFF_CONTEXT_EX)==0 ) n = dflt; | |
| 2892 | - return n; | |
| 2891 | + if( n==0 && (pCfg->diffFlags & DIFF_CONTEXT_EX)==0 ) n = dflt; | |
| 2892 | + return n<0 ? 0x7ffffff : n; | |
| 2893 | 2893 | }else{ |
| 2894 | 2894 | return dflt; |
| 2895 | 2895 | } |
| 2896 | 2896 | } |
| 2897 | 2897 | |
| @@ -3147,11 +3147,11 @@ | ||
| 3147 | 3147 | /* Undocumented and unsupported flags used for development |
| 3148 | 3148 | ** debugging and analysis: */ |
| 3149 | 3149 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 3150 | 3150 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 3151 | 3151 | } |
| 3152 | - if( (z = find_option("context","c",1))!=0 && (f = atoi(z))>=0 ){ | |
| 3152 | + if( (z = find_option("context","c",1))!=0 && (f = atoi(z))!=0 ){ | |
| 3153 | 3153 | pCfg->nContext = f; |
| 3154 | 3154 | diffFlags |= DIFF_CONTEXT_EX; |
| 3155 | 3155 | } |
| 3156 | 3156 | if( (z = find_option("width","W",1))!=0 && (f = atoi(z))>0 ){ |
| 3157 | 3157 | pCfg->wColumn = f; |
| 3158 | 3158 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2886,12 +2886,12 @@ | |
| 2886 | */ |
| 2887 | int diff_context_lines(DiffConfig *pCfg){ |
| 2888 | const int dflt = 5; |
| 2889 | if(pCfg!=0){ |
| 2890 | int n = pCfg->nContext; |
| 2891 | if( n<=0 && (pCfg->diffFlags & DIFF_CONTEXT_EX)==0 ) n = dflt; |
| 2892 | return n; |
| 2893 | }else{ |
| 2894 | return dflt; |
| 2895 | } |
| 2896 | } |
| 2897 | |
| @@ -3147,11 +3147,11 @@ | |
| 3147 | /* Undocumented and unsupported flags used for development |
| 3148 | ** debugging and analysis: */ |
| 3149 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 3150 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 3151 | } |
| 3152 | if( (z = find_option("context","c",1))!=0 && (f = atoi(z))>=0 ){ |
| 3153 | pCfg->nContext = f; |
| 3154 | diffFlags |= DIFF_CONTEXT_EX; |
| 3155 | } |
| 3156 | if( (z = find_option("width","W",1))!=0 && (f = atoi(z))>0 ){ |
| 3157 | pCfg->wColumn = f; |
| 3158 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2886,12 +2886,12 @@ | |
| 2886 | */ |
| 2887 | int diff_context_lines(DiffConfig *pCfg){ |
| 2888 | const int dflt = 5; |
| 2889 | if(pCfg!=0){ |
| 2890 | int n = pCfg->nContext; |
| 2891 | if( n==0 && (pCfg->diffFlags & DIFF_CONTEXT_EX)==0 ) n = dflt; |
| 2892 | return n<0 ? 0x7ffffff : n; |
| 2893 | }else{ |
| 2894 | return dflt; |
| 2895 | } |
| 2896 | } |
| 2897 | |
| @@ -3147,11 +3147,11 @@ | |
| 3147 | /* Undocumented and unsupported flags used for development |
| 3148 | ** debugging and analysis: */ |
| 3149 | if( find_option("debug",0,0)!=0 ) diffFlags |= DIFF_DEBUG; |
| 3150 | if( find_option("raw",0,0)!=0 ) diffFlags |= DIFF_RAW; |
| 3151 | } |
| 3152 | if( (z = find_option("context","c",1))!=0 && (f = atoi(z))!=0 ){ |
| 3153 | pCfg->nContext = f; |
| 3154 | diffFlags |= DIFF_CONTEXT_EX; |
| 3155 | } |
| 3156 | if( (z = find_option("width","W",1))!=0 && (f = atoi(z))>0 ){ |
| 3157 | pCfg->wColumn = f; |
| 3158 |
+3
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -368,11 +368,11 @@ | ||
| 368 | 368 | if( (pCfg->diffFlags & DIFF_BROWSER)!=0 ){ |
| 369 | 369 | tempDiffFilename = fossil_temp_filename(); |
| 370 | 370 | tempDiffFilename = sqlite3_mprintf("%z.html", tempDiffFilename); |
| 371 | 371 | diffOut = fossil_freopen(tempDiffFilename,"wb",stdout); |
| 372 | 372 | if( diffOut==0 ){ |
| 373 | - fossil_fatal("unable to create temporary file \"%s\"", | |
| 373 | + fossil_fatal("unable to create temporary file \"%s\"", | |
| 374 | 374 | tempDiffFilename); |
| 375 | 375 | } |
| 376 | 376 | #ifndef _WIN32 |
| 377 | 377 | signal(SIGINT, diff_www_interrupt); |
| 378 | 378 | #else |
| @@ -1076,11 +1076,12 @@ | ||
| 1076 | 1076 | ** --brief Show filenames only |
| 1077 | 1077 | ** -b|--browser Show the diff output in a web-browser |
| 1078 | 1078 | ** --by Shorthand for "--browser -y" |
| 1079 | 1079 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1080 | 1080 | ** --command PROG External diff program. Overrides "diff-command" |
| 1081 | -** -c|--context N Show N lines of context around each change | |
| 1081 | +** -c|--context N Show N lines of context around each change, with | |
| 1082 | +** negative N meaning show all content | |
| 1082 | 1083 | ** --diff-binary BOOL Include binary files with external commands |
| 1083 | 1084 | ** --exec-abs-paths Force absolute path names on external commands |
| 1084 | 1085 | ** --exec-rel-paths Force relative path names on external commands |
| 1085 | 1086 | ** -r|--from VERSION Select VERSION as source for the diff |
| 1086 | 1087 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 1087 | 1088 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -368,11 +368,11 @@ | |
| 368 | if( (pCfg->diffFlags & DIFF_BROWSER)!=0 ){ |
| 369 | tempDiffFilename = fossil_temp_filename(); |
| 370 | tempDiffFilename = sqlite3_mprintf("%z.html", tempDiffFilename); |
| 371 | diffOut = fossil_freopen(tempDiffFilename,"wb",stdout); |
| 372 | if( diffOut==0 ){ |
| 373 | fossil_fatal("unable to create temporary file \"%s\"", |
| 374 | tempDiffFilename); |
| 375 | } |
| 376 | #ifndef _WIN32 |
| 377 | signal(SIGINT, diff_www_interrupt); |
| 378 | #else |
| @@ -1076,11 +1076,12 @@ | |
| 1076 | ** --brief Show filenames only |
| 1077 | ** -b|--browser Show the diff output in a web-browser |
| 1078 | ** --by Shorthand for "--browser -y" |
| 1079 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1080 | ** --command PROG External diff program. Overrides "diff-command" |
| 1081 | ** -c|--context N Show N lines of context around each change |
| 1082 | ** --diff-binary BOOL Include binary files with external commands |
| 1083 | ** --exec-abs-paths Force absolute path names on external commands |
| 1084 | ** --exec-rel-paths Force relative path names on external commands |
| 1085 | ** -r|--from VERSION Select VERSION as source for the diff |
| 1086 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 1087 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -368,11 +368,11 @@ | |
| 368 | if( (pCfg->diffFlags & DIFF_BROWSER)!=0 ){ |
| 369 | tempDiffFilename = fossil_temp_filename(); |
| 370 | tempDiffFilename = sqlite3_mprintf("%z.html", tempDiffFilename); |
| 371 | diffOut = fossil_freopen(tempDiffFilename,"wb",stdout); |
| 372 | if( diffOut==0 ){ |
| 373 | fossil_fatal("unable to create temporary file \"%s\"", |
| 374 | tempDiffFilename); |
| 375 | } |
| 376 | #ifndef _WIN32 |
| 377 | signal(SIGINT, diff_www_interrupt); |
| 378 | #else |
| @@ -1076,11 +1076,12 @@ | |
| 1076 | ** --brief Show filenames only |
| 1077 | ** -b|--browser Show the diff output in a web-browser |
| 1078 | ** --by Shorthand for "--browser -y" |
| 1079 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1080 | ** --command PROG External diff program. Overrides "diff-command" |
| 1081 | ** -c|--context N Show N lines of context around each change, with |
| 1082 | ** negative N meaning show all content |
| 1083 | ** --diff-binary BOOL Include binary files with external commands |
| 1084 | ** --exec-abs-paths Force absolute path names on external commands |
| 1085 | ** --exec-rel-paths Force relative path names on external commands |
| 1086 | ** -r|--from VERSION Select VERSION as source for the diff |
| 1087 | ** -w|--ignore-all-space Ignore white space when comparing lines |
| 1088 |