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).

jan.nijtmans 2014-03-04 08:21 diff-eolws
Commit 28b39cc516c759aae18036610db4ddc6ce593982
3 files changed +3 -2 +1 -2 +5 -2
+3 -2
--- src/diff.c
+++ src/diff.c
@@ -1998,11 +1998,12 @@
19981998
*/
19991999
static int annotation_start(Annotator *p, Blob *pInput){
20002000
int i;
20012001
20022002
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);
20042005
if( p->c.aTo==0 ){
20052006
return 1;
20062007
}
20072008
p->aOrig = fossil_malloc( sizeof(p->aOrig[0])*p->c.nTo );
20082009
for(i=0; i<p->c.nTo; i++){
@@ -2025,11 +2026,11 @@
20252026
int i, j;
20262027
int lnTo;
20272028
20282029
/* Prepare the parent file to be diffed */
20292030
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);
20312032
if( p->c.aFrom==0 ){
20322033
return 1;
20332034
}
20342035
20352036
/* Compute the differences going from pParent to the file being
20362037
--- 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 @@
981981
int i;
982982
Blob script;
983983
char *zTempFile = 0;
984984
char *zCmd;
985985
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",
987987
g.nameOfExe, zSubCmd);
988988
for(i=firstArg; i<g.argc; i++){
989989
const char *z = g.argv[i];
990990
if( z[0]=='-' ){
991991
if( strglob("*-html",z) ) continue;
992992
if( strglob("*-y",z) ) continue;
993993
if( strglob("*-i",z) ) continue;
994
- if( strglob("*-w",z) ) continue;
995994
/* The undocumented --script FILENAME option causes the Tk script to
996995
** be written into the FILENAME instead of being run. This is used
997996
** for testing and debugging. */
998997
if( strglob("*-script",z) && i<g.argc-1 ){
999998
i++;
1000999
--- 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 @@
449449
if( verboseFlag==0 ){
450450
diffFlags = 0; /* Zero means do not show any diff */
451451
}else{
452452
int x;
453453
if( sideBySide ){
454
- diffFlags = DIFF_SIDEBYSIDE | DIFF_IGNORE_EOLWS;
454
+ diffFlags = DIFF_SIDEBYSIDE;
455455
456456
/* "dw" query parameter determines width of each column */
457457
x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1);
458458
if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK;
459459
diffFlags += x;
460460
}else{
461
- diffFlags = DIFF_INLINE | DIFF_IGNORE_EOLWS;
461
+ diffFlags = DIFF_INLINE;
462462
}
463463
464
+ if( P("w") ){
465
+ diffFlags |= (DIFF_IGNORE_SOLWS|DIFF_IGNORE_EOLWS);
466
+ }
464467
/* "dc" query parameter determines lines of context */
465468
x = atoi(PD("dc","7"));
466469
if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK;
467470
diffFlags += x;
468471
469472
--- 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

Keyboard Shortcuts

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