Fossil SCM
Don't ignore whitespace by default, except in annotations/blames. Add new "w" option to some Web UI pages, allowing to ignore whitespace (no buttons yet).
Commit
28b39cc516c759aae18036610db4ddc6ce593982
Parent
d4fea96ad82d90e…
3 files changed
+3
-2
+1
-2
+5
-2
+3
-2
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1998,11 +1998,12 @@ | ||
| 1998 | 1998 | */ |
| 1999 | 1999 | static int annotation_start(Annotator *p, Blob *pInput){ |
| 2000 | 2000 | int i; |
| 2001 | 2001 | |
| 2002 | 2002 | memset(p, 0, sizeof(*p)); |
| 2003 | - p->c.aTo = break_into_lines(blob_str(pInput), blob_size(pInput),&p->c.nTo,DIFF_IGNORE_EOLWS); | |
| 2003 | + p->c.aTo = break_into_lines(blob_str(pInput), blob_size(pInput),&p->c.nTo, | |
| 2004 | + DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); | |
| 2004 | 2005 | if( p->c.aTo==0 ){ |
| 2005 | 2006 | return 1; |
| 2006 | 2007 | } |
| 2007 | 2008 | p->aOrig = fossil_malloc( sizeof(p->aOrig[0])*p->c.nTo ); |
| 2008 | 2009 | for(i=0; i<p->c.nTo; i++){ |
| @@ -2025,11 +2026,11 @@ | ||
| 2025 | 2026 | int i, j; |
| 2026 | 2027 | int lnTo; |
| 2027 | 2028 | |
| 2028 | 2029 | /* Prepare the parent file to be diffed */ |
| 2029 | 2030 | p->c.aFrom = break_into_lines(blob_str(pParent), blob_size(pParent), |
| 2030 | - &p->c.nFrom, DIFF_IGNORE_EOLWS); | |
| 2031 | + &p->c.nFrom, DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); | |
| 2031 | 2032 | if( p->c.aFrom==0 ){ |
| 2032 | 2033 | return 1; |
| 2033 | 2034 | } |
| 2034 | 2035 | |
| 2035 | 2036 | /* Compute the differences going from pParent to the file being |
| 2036 | 2037 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1998,11 +1998,12 @@ | |
| 1998 | */ |
| 1999 | static int annotation_start(Annotator *p, Blob *pInput){ |
| 2000 | int i; |
| 2001 | |
| 2002 | memset(p, 0, sizeof(*p)); |
| 2003 | p->c.aTo = break_into_lines(blob_str(pInput), blob_size(pInput),&p->c.nTo,DIFF_IGNORE_EOLWS); |
| 2004 | if( p->c.aTo==0 ){ |
| 2005 | return 1; |
| 2006 | } |
| 2007 | p->aOrig = fossil_malloc( sizeof(p->aOrig[0])*p->c.nTo ); |
| 2008 | for(i=0; i<p->c.nTo; i++){ |
| @@ -2025,11 +2026,11 @@ | |
| 2025 | int i, j; |
| 2026 | int lnTo; |
| 2027 | |
| 2028 | /* Prepare the parent file to be diffed */ |
| 2029 | p->c.aFrom = break_into_lines(blob_str(pParent), blob_size(pParent), |
| 2030 | &p->c.nFrom, DIFF_IGNORE_EOLWS); |
| 2031 | if( p->c.aFrom==0 ){ |
| 2032 | return 1; |
| 2033 | } |
| 2034 | |
| 2035 | /* Compute the differences going from pParent to the file being |
| 2036 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1998,11 +1998,12 @@ | |
| 1998 | */ |
| 1999 | static int annotation_start(Annotator *p, Blob *pInput){ |
| 2000 | int i; |
| 2001 | |
| 2002 | memset(p, 0, sizeof(*p)); |
| 2003 | p->c.aTo = break_into_lines(blob_str(pInput), blob_size(pInput),&p->c.nTo, |
| 2004 | DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); |
| 2005 | if( p->c.aTo==0 ){ |
| 2006 | return 1; |
| 2007 | } |
| 2008 | p->aOrig = fossil_malloc( sizeof(p->aOrig[0])*p->c.nTo ); |
| 2009 | for(i=0; i<p->c.nTo; i++){ |
| @@ -2025,11 +2026,11 @@ | |
| 2026 | int i, j; |
| 2027 | int lnTo; |
| 2028 | |
| 2029 | /* Prepare the parent file to be diffed */ |
| 2030 | p->c.aFrom = break_into_lines(blob_str(pParent), blob_size(pParent), |
| 2031 | &p->c.nFrom, DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); |
| 2032 | if( p->c.aFrom==0 ){ |
| 2033 | return 1; |
| 2034 | } |
| 2035 | |
| 2036 | /* Compute the differences going from pParent to the file being |
| 2037 |
+1
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -981,19 +981,18 @@ | ||
| 981 | 981 | int i; |
| 982 | 982 | Blob script; |
| 983 | 983 | char *zTempFile = 0; |
| 984 | 984 | char *zCmd; |
| 985 | 985 | blob_zero(&script); |
| 986 | - blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v -w", | |
| 986 | + blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", | |
| 987 | 987 | g.nameOfExe, zSubCmd); |
| 988 | 988 | for(i=firstArg; i<g.argc; i++){ |
| 989 | 989 | const char *z = g.argv[i]; |
| 990 | 990 | if( z[0]=='-' ){ |
| 991 | 991 | if( strglob("*-html",z) ) continue; |
| 992 | 992 | if( strglob("*-y",z) ) continue; |
| 993 | 993 | if( strglob("*-i",z) ) continue; |
| 994 | - if( strglob("*-w",z) ) continue; | |
| 995 | 994 | /* The undocumented --script FILENAME option causes the Tk script to |
| 996 | 995 | ** be written into the FILENAME instead of being run. This is used |
| 997 | 996 | ** for testing and debugging. */ |
| 998 | 997 | if( strglob("*-script",z) && i<g.argc-1 ){ |
| 999 | 998 | i++; |
| 1000 | 999 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -981,19 +981,18 @@ | |
| 981 | int i; |
| 982 | Blob script; |
| 983 | char *zTempFile = 0; |
| 984 | char *zCmd; |
| 985 | blob_zero(&script); |
| 986 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v -w", |
| 987 | g.nameOfExe, zSubCmd); |
| 988 | for(i=firstArg; i<g.argc; i++){ |
| 989 | const char *z = g.argv[i]; |
| 990 | if( z[0]=='-' ){ |
| 991 | if( strglob("*-html",z) ) continue; |
| 992 | if( strglob("*-y",z) ) continue; |
| 993 | if( strglob("*-i",z) ) continue; |
| 994 | if( strglob("*-w",z) ) continue; |
| 995 | /* The undocumented --script FILENAME option causes the Tk script to |
| 996 | ** be written into the FILENAME instead of being run. This is used |
| 997 | ** for testing and debugging. */ |
| 998 | if( strglob("*-script",z) && i<g.argc-1 ){ |
| 999 | i++; |
| 1000 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -981,19 +981,18 @@ | |
| 981 | int i; |
| 982 | Blob script; |
| 983 | char *zTempFile = 0; |
| 984 | char *zCmd; |
| 985 | blob_zero(&script); |
| 986 | blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v", |
| 987 | g.nameOfExe, zSubCmd); |
| 988 | for(i=firstArg; i<g.argc; i++){ |
| 989 | const char *z = g.argv[i]; |
| 990 | if( z[0]=='-' ){ |
| 991 | if( strglob("*-html",z) ) continue; |
| 992 | if( strglob("*-y",z) ) continue; |
| 993 | if( strglob("*-i",z) ) continue; |
| 994 | /* The undocumented --script FILENAME option causes the Tk script to |
| 995 | ** be written into the FILENAME instead of being run. This is used |
| 996 | ** for testing and debugging. */ |
| 997 | if( strglob("*-script",z) && i<g.argc-1 ){ |
| 998 | i++; |
| 999 |
+5
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -449,20 +449,23 @@ | ||
| 449 | 449 | if( verboseFlag==0 ){ |
| 450 | 450 | diffFlags = 0; /* Zero means do not show any diff */ |
| 451 | 451 | }else{ |
| 452 | 452 | int x; |
| 453 | 453 | if( sideBySide ){ |
| 454 | - diffFlags = DIFF_SIDEBYSIDE | DIFF_IGNORE_EOLWS; | |
| 454 | + diffFlags = DIFF_SIDEBYSIDE; | |
| 455 | 455 | |
| 456 | 456 | /* "dw" query parameter determines width of each column */ |
| 457 | 457 | x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1); |
| 458 | 458 | if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK; |
| 459 | 459 | diffFlags += x; |
| 460 | 460 | }else{ |
| 461 | - diffFlags = DIFF_INLINE | DIFF_IGNORE_EOLWS; | |
| 461 | + diffFlags = DIFF_INLINE; | |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | + if( P("w") ){ | |
| 465 | + diffFlags |= (DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); | |
| 466 | + } | |
| 464 | 467 | /* "dc" query parameter determines lines of context */ |
| 465 | 468 | x = atoi(PD("dc","7")); |
| 466 | 469 | if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK; |
| 467 | 470 | diffFlags += x; |
| 468 | 471 | |
| 469 | 472 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -449,20 +449,23 @@ | |
| 449 | if( verboseFlag==0 ){ |
| 450 | diffFlags = 0; /* Zero means do not show any diff */ |
| 451 | }else{ |
| 452 | int x; |
| 453 | if( sideBySide ){ |
| 454 | diffFlags = DIFF_SIDEBYSIDE | DIFF_IGNORE_EOLWS; |
| 455 | |
| 456 | /* "dw" query parameter determines width of each column */ |
| 457 | x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1); |
| 458 | if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK; |
| 459 | diffFlags += x; |
| 460 | }else{ |
| 461 | diffFlags = DIFF_INLINE | DIFF_IGNORE_EOLWS; |
| 462 | } |
| 463 | |
| 464 | /* "dc" query parameter determines lines of context */ |
| 465 | x = atoi(PD("dc","7")); |
| 466 | if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK; |
| 467 | diffFlags += x; |
| 468 | |
| 469 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -449,20 +449,23 @@ | |
| 449 | if( verboseFlag==0 ){ |
| 450 | diffFlags = 0; /* Zero means do not show any diff */ |
| 451 | }else{ |
| 452 | int x; |
| 453 | if( sideBySide ){ |
| 454 | diffFlags = DIFF_SIDEBYSIDE; |
| 455 | |
| 456 | /* "dw" query parameter determines width of each column */ |
| 457 | x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1); |
| 458 | if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK; |
| 459 | diffFlags += x; |
| 460 | }else{ |
| 461 | diffFlags = DIFF_INLINE; |
| 462 | } |
| 463 | |
| 464 | if( P("w") ){ |
| 465 | diffFlags |= (DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS); |
| 466 | } |
| 467 | /* "dc" query parameter determines lines of context */ |
| 468 | x = atoi(PD("dc","7")); |
| 469 | if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK; |
| 470 | diffFlags += x; |
| 471 | |
| 472 |