Fossil SCM
Expand the "diffFlags" variable to 64-bits in order to accommodate new options to the various "diff" commands.
Commit
2b1767500e3cd9df1ba660809d1fe58f1e46b33b
Parent
85f1856c95209ea…
6 files changed
+18
-17
+10
-10
+7
-7
+1
-1
+3
-3
+1
-1
+18
-17
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -25,21 +25,22 @@ | ||
| 25 | 25 | |
| 26 | 26 | #if INTERFACE |
| 27 | 27 | /* |
| 28 | 28 | ** Allowed flag parameters to the text_diff() and html_sbsdiff() funtions: |
| 29 | 29 | */ |
| 30 | -#define DIFF_CONTEXT_MASK 0x0000ffff /* Lines of context. Default if 0 */ | |
| 31 | -#define DIFF_WIDTH_MASK 0x00ff0000 /* side-by-side column width */ | |
| 32 | -#define DIFF_IGNORE_EOLWS 0x01000000 /* Ignore end-of-line whitespace */ | |
| 33 | -#define DIFF_SIDEBYSIDE 0x02000000 /* Generate a side-by-side diff */ | |
| 34 | -#define DIFF_NEWFILE 0x04000000 /* Missing files are as empty files */ | |
| 35 | -#define DIFF_BRIEF 0x08000000 /* Show filenames only */ | |
| 36 | -#define DIFF_INLINE 0x00000000 /* Inline (not side-by-side) diff */ | |
| 37 | -#define DIFF_HTML 0x10000000 /* Render for HTML */ | |
| 38 | -#define DIFF_LINENO 0x20000000 /* Show line numbers in context diff */ | |
| 39 | -#define DIFF_NOOPT 0x40000000 /* Suppress optimizations for debug */ | |
| 40 | -#define DIFF_INVERT 0x80000000 /* Invert the diff for debug */ | |
| 30 | +#define DIFF_CONTEXT_MASK ((u64)0x0000ffff) /* Lines of context. Default if 0 */ | |
| 31 | +#define DIFF_WIDTH_MASK ((u64)0x00ff0000) /* side-by-side column width */ | |
| 32 | +#define DIFF_IGNORE_EOLWS ((u64)0x01000000) /* Ignore end-of-line whitespace */ | |
| 33 | +#define DIFF_SIDEBYSIDE ((u64)0x02000000) /* Generate a side-by-side diff */ | |
| 34 | +#define DIFF_NEWFILE ((u64)0x04000000) /* Missing shown as empty files */ | |
| 35 | +#define DIFF_BRIEF ((u64)0x08000000) /* Show filenames only */ | |
| 36 | +#define DIFF_INLINE ((u64)0x00000000) /* Inline (not side-by-side) diff */ | |
| 37 | +#define DIFF_HTML ((u64)0x10000000) /* Render for HTML */ | |
| 38 | +#define DIFF_LINENO ((u64)0x20000000) /* Show line numbers */ | |
| 39 | +#define DIFF_WS_WARNING ((u64)0x40000000) /* Warn about whitespace */ | |
| 40 | +#define DIFF_NOOPT (((u64)0x01)<<32) /* Suppress optimizations (debug) */ | |
| 41 | +#define DIFF_INVERT (((u64)0x02)<<32) /* Invert the diff (debug) */ | |
| 41 | 42 | |
| 42 | 43 | #endif /* INTERFACE */ |
| 43 | 44 | |
| 44 | 45 | /* |
| 45 | 46 | ** Maximum length of a line in a text file. (8192) |
| @@ -1427,21 +1428,21 @@ | ||
| 1427 | 1428 | |
| 1428 | 1429 | /* |
| 1429 | 1430 | ** Extract the number of lines of context from diffFlags. Supply an |
| 1430 | 1431 | ** appropriate default if no context width is specified. |
| 1431 | 1432 | */ |
| 1432 | -int diff_context_lines(int diffFlags){ | |
| 1433 | +int diff_context_lines(u64 diffFlags){ | |
| 1433 | 1434 | int n = diffFlags & DIFF_CONTEXT_MASK; |
| 1434 | 1435 | if( n==0 ) n = 5; |
| 1435 | 1436 | return n; |
| 1436 | 1437 | } |
| 1437 | 1438 | |
| 1438 | 1439 | /* |
| 1439 | 1440 | ** Extract the width of columns for side-by-side diff. Supply an |
| 1440 | 1441 | ** appropriate default if no width is given. |
| 1441 | 1442 | */ |
| 1442 | -int diff_width(int diffFlags){ | |
| 1443 | +int diff_width(u64 diffFlags){ | |
| 1443 | 1444 | int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1); |
| 1444 | 1445 | if( w==0 ) w = 80; |
| 1445 | 1446 | return w; |
| 1446 | 1447 | } |
| 1447 | 1448 | |
| @@ -1461,11 +1462,11 @@ | ||
| 1461 | 1462 | */ |
| 1462 | 1463 | int *text_diff( |
| 1463 | 1464 | Blob *pA_Blob, /* FROM file */ |
| 1464 | 1465 | Blob *pB_Blob, /* TO file */ |
| 1465 | 1466 | Blob *pOut, /* Write diff here if not NULL */ |
| 1466 | - int diffFlags /* DIFF_* flags defined above */ | |
| 1467 | + u64 diffFlags /* DIFF_* flags defined above */ | |
| 1467 | 1468 | ){ |
| 1468 | 1469 | int ignoreEolWs; /* Ignore whitespace at the end of lines */ |
| 1469 | 1470 | int nContext; /* Amount of context to display */ |
| 1470 | 1471 | DContext c; |
| 1471 | 1472 | |
| @@ -1532,11 +1533,11 @@ | ||
| 1532 | 1533 | ** --noopt Disable optimization DIFF_NOOPT |
| 1533 | 1534 | ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE |
| 1534 | 1535 | ** --width|-W N N character lines. DIFF_WIDTH_MASK |
| 1535 | 1536 | */ |
| 1536 | 1537 | int diff_options(void){ |
| 1537 | - int diffFlags = 0; | |
| 1538 | + u64 diffFlags = 0; | |
| 1538 | 1539 | const char *z; |
| 1539 | 1540 | int f; |
| 1540 | 1541 | if( find_option("side-by-side","y",0)!=0 ) diffFlags |= DIFF_SIDEBYSIDE; |
| 1541 | 1542 | if( (z = find_option("context","c",1))!=0 && (f = atoi(z))>0 ){ |
| 1542 | 1543 | if( f > DIFF_CONTEXT_MASK ) f = DIFF_CONTEXT_MASK; |
| @@ -1561,11 +1562,11 @@ | ||
| 1561 | 1562 | void test_rawdiff_cmd(void){ |
| 1562 | 1563 | Blob a, b; |
| 1563 | 1564 | int r; |
| 1564 | 1565 | int i; |
| 1565 | 1566 | int *R; |
| 1566 | - int diffFlags = diff_options(); | |
| 1567 | + u64 diffFlags = diff_options(); | |
| 1567 | 1568 | if( g.argc<4 ) usage("FILE1 FILE2 ..."); |
| 1568 | 1569 | blob_read_from_file(&a, g.argv[2]); |
| 1569 | 1570 | for(i=3; i<g.argc; i++){ |
| 1570 | 1571 | if( i>3 ) fossil_print("-------------------------------\n"); |
| 1571 | 1572 | blob_read_from_file(&b, g.argv[i]); |
| @@ -1583,11 +1584,11 @@ | ||
| 1583 | 1584 | ** |
| 1584 | 1585 | ** Print the difference between two files. The usual diff options apply. |
| 1585 | 1586 | */ |
| 1586 | 1587 | void test_udiff_cmd(void){ |
| 1587 | 1588 | Blob a, b, out; |
| 1588 | - int diffFlag = diff_options(); | |
| 1589 | + u64 diffFlag = diff_options(); | |
| 1589 | 1590 | |
| 1590 | 1591 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 1591 | 1592 | blob_read_from_file(&a, g.argv[2]); |
| 1592 | 1593 | blob_read_from_file(&b, g.argv[3]); |
| 1593 | 1594 | blob_zero(&out); |
| 1594 | 1595 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -25,21 +25,22 @@ | |
| 25 | |
| 26 | #if INTERFACE |
| 27 | /* |
| 28 | ** Allowed flag parameters to the text_diff() and html_sbsdiff() funtions: |
| 29 | */ |
| 30 | #define DIFF_CONTEXT_MASK 0x0000ffff /* Lines of context. Default if 0 */ |
| 31 | #define DIFF_WIDTH_MASK 0x00ff0000 /* side-by-side column width */ |
| 32 | #define DIFF_IGNORE_EOLWS 0x01000000 /* Ignore end-of-line whitespace */ |
| 33 | #define DIFF_SIDEBYSIDE 0x02000000 /* Generate a side-by-side diff */ |
| 34 | #define DIFF_NEWFILE 0x04000000 /* Missing files are as empty files */ |
| 35 | #define DIFF_BRIEF 0x08000000 /* Show filenames only */ |
| 36 | #define DIFF_INLINE 0x00000000 /* Inline (not side-by-side) diff */ |
| 37 | #define DIFF_HTML 0x10000000 /* Render for HTML */ |
| 38 | #define DIFF_LINENO 0x20000000 /* Show line numbers in context diff */ |
| 39 | #define DIFF_NOOPT 0x40000000 /* Suppress optimizations for debug */ |
| 40 | #define DIFF_INVERT 0x80000000 /* Invert the diff for debug */ |
| 41 | |
| 42 | #endif /* INTERFACE */ |
| 43 | |
| 44 | /* |
| 45 | ** Maximum length of a line in a text file. (8192) |
| @@ -1427,21 +1428,21 @@ | |
| 1427 | |
| 1428 | /* |
| 1429 | ** Extract the number of lines of context from diffFlags. Supply an |
| 1430 | ** appropriate default if no context width is specified. |
| 1431 | */ |
| 1432 | int diff_context_lines(int diffFlags){ |
| 1433 | int n = diffFlags & DIFF_CONTEXT_MASK; |
| 1434 | if( n==0 ) n = 5; |
| 1435 | return n; |
| 1436 | } |
| 1437 | |
| 1438 | /* |
| 1439 | ** Extract the width of columns for side-by-side diff. Supply an |
| 1440 | ** appropriate default if no width is given. |
| 1441 | */ |
| 1442 | int diff_width(int diffFlags){ |
| 1443 | int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1); |
| 1444 | if( w==0 ) w = 80; |
| 1445 | return w; |
| 1446 | } |
| 1447 | |
| @@ -1461,11 +1462,11 @@ | |
| 1461 | */ |
| 1462 | int *text_diff( |
| 1463 | Blob *pA_Blob, /* FROM file */ |
| 1464 | Blob *pB_Blob, /* TO file */ |
| 1465 | Blob *pOut, /* Write diff here if not NULL */ |
| 1466 | int diffFlags /* DIFF_* flags defined above */ |
| 1467 | ){ |
| 1468 | int ignoreEolWs; /* Ignore whitespace at the end of lines */ |
| 1469 | int nContext; /* Amount of context to display */ |
| 1470 | DContext c; |
| 1471 | |
| @@ -1532,11 +1533,11 @@ | |
| 1532 | ** --noopt Disable optimization DIFF_NOOPT |
| 1533 | ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE |
| 1534 | ** --width|-W N N character lines. DIFF_WIDTH_MASK |
| 1535 | */ |
| 1536 | int diff_options(void){ |
| 1537 | int diffFlags = 0; |
| 1538 | const char *z; |
| 1539 | int f; |
| 1540 | if( find_option("side-by-side","y",0)!=0 ) diffFlags |= DIFF_SIDEBYSIDE; |
| 1541 | if( (z = find_option("context","c",1))!=0 && (f = atoi(z))>0 ){ |
| 1542 | if( f > DIFF_CONTEXT_MASK ) f = DIFF_CONTEXT_MASK; |
| @@ -1561,11 +1562,11 @@ | |
| 1561 | void test_rawdiff_cmd(void){ |
| 1562 | Blob a, b; |
| 1563 | int r; |
| 1564 | int i; |
| 1565 | int *R; |
| 1566 | int diffFlags = diff_options(); |
| 1567 | if( g.argc<4 ) usage("FILE1 FILE2 ..."); |
| 1568 | blob_read_from_file(&a, g.argv[2]); |
| 1569 | for(i=3; i<g.argc; i++){ |
| 1570 | if( i>3 ) fossil_print("-------------------------------\n"); |
| 1571 | blob_read_from_file(&b, g.argv[i]); |
| @@ -1583,11 +1584,11 @@ | |
| 1583 | ** |
| 1584 | ** Print the difference between two files. The usual diff options apply. |
| 1585 | */ |
| 1586 | void test_udiff_cmd(void){ |
| 1587 | Blob a, b, out; |
| 1588 | int diffFlag = diff_options(); |
| 1589 | |
| 1590 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 1591 | blob_read_from_file(&a, g.argv[2]); |
| 1592 | blob_read_from_file(&b, g.argv[3]); |
| 1593 | blob_zero(&out); |
| 1594 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -25,21 +25,22 @@ | |
| 25 | |
| 26 | #if INTERFACE |
| 27 | /* |
| 28 | ** Allowed flag parameters to the text_diff() and html_sbsdiff() funtions: |
| 29 | */ |
| 30 | #define DIFF_CONTEXT_MASK ((u64)0x0000ffff) /* Lines of context. Default if 0 */ |
| 31 | #define DIFF_WIDTH_MASK ((u64)0x00ff0000) /* side-by-side column width */ |
| 32 | #define DIFF_IGNORE_EOLWS ((u64)0x01000000) /* Ignore end-of-line whitespace */ |
| 33 | #define DIFF_SIDEBYSIDE ((u64)0x02000000) /* Generate a side-by-side diff */ |
| 34 | #define DIFF_NEWFILE ((u64)0x04000000) /* Missing shown as empty files */ |
| 35 | #define DIFF_BRIEF ((u64)0x08000000) /* Show filenames only */ |
| 36 | #define DIFF_INLINE ((u64)0x00000000) /* Inline (not side-by-side) diff */ |
| 37 | #define DIFF_HTML ((u64)0x10000000) /* Render for HTML */ |
| 38 | #define DIFF_LINENO ((u64)0x20000000) /* Show line numbers */ |
| 39 | #define DIFF_WS_WARNING ((u64)0x40000000) /* Warn about whitespace */ |
| 40 | #define DIFF_NOOPT (((u64)0x01)<<32) /* Suppress optimizations (debug) */ |
| 41 | #define DIFF_INVERT (((u64)0x02)<<32) /* Invert the diff (debug) */ |
| 42 | |
| 43 | #endif /* INTERFACE */ |
| 44 | |
| 45 | /* |
| 46 | ** Maximum length of a line in a text file. (8192) |
| @@ -1427,21 +1428,21 @@ | |
| 1428 | |
| 1429 | /* |
| 1430 | ** Extract the number of lines of context from diffFlags. Supply an |
| 1431 | ** appropriate default if no context width is specified. |
| 1432 | */ |
| 1433 | int diff_context_lines(u64 diffFlags){ |
| 1434 | int n = diffFlags & DIFF_CONTEXT_MASK; |
| 1435 | if( n==0 ) n = 5; |
| 1436 | return n; |
| 1437 | } |
| 1438 | |
| 1439 | /* |
| 1440 | ** Extract the width of columns for side-by-side diff. Supply an |
| 1441 | ** appropriate default if no width is given. |
| 1442 | */ |
| 1443 | int diff_width(u64 diffFlags){ |
| 1444 | int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1); |
| 1445 | if( w==0 ) w = 80; |
| 1446 | return w; |
| 1447 | } |
| 1448 | |
| @@ -1461,11 +1462,11 @@ | |
| 1462 | */ |
| 1463 | int *text_diff( |
| 1464 | Blob *pA_Blob, /* FROM file */ |
| 1465 | Blob *pB_Blob, /* TO file */ |
| 1466 | Blob *pOut, /* Write diff here if not NULL */ |
| 1467 | u64 diffFlags /* DIFF_* flags defined above */ |
| 1468 | ){ |
| 1469 | int ignoreEolWs; /* Ignore whitespace at the end of lines */ |
| 1470 | int nContext; /* Amount of context to display */ |
| 1471 | DContext c; |
| 1472 | |
| @@ -1532,11 +1533,11 @@ | |
| 1533 | ** --noopt Disable optimization DIFF_NOOPT |
| 1534 | ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE |
| 1535 | ** --width|-W N N character lines. DIFF_WIDTH_MASK |
| 1536 | */ |
| 1537 | int diff_options(void){ |
| 1538 | u64 diffFlags = 0; |
| 1539 | const char *z; |
| 1540 | int f; |
| 1541 | if( find_option("side-by-side","y",0)!=0 ) diffFlags |= DIFF_SIDEBYSIDE; |
| 1542 | if( (z = find_option("context","c",1))!=0 && (f = atoi(z))>0 ){ |
| 1543 | if( f > DIFF_CONTEXT_MASK ) f = DIFF_CONTEXT_MASK; |
| @@ -1561,11 +1562,11 @@ | |
| 1562 | void test_rawdiff_cmd(void){ |
| 1563 | Blob a, b; |
| 1564 | int r; |
| 1565 | int i; |
| 1566 | int *R; |
| 1567 | u64 diffFlags = diff_options(); |
| 1568 | if( g.argc<4 ) usage("FILE1 FILE2 ..."); |
| 1569 | blob_read_from_file(&a, g.argv[2]); |
| 1570 | for(i=3; i<g.argc; i++){ |
| 1571 | if( i>3 ) fossil_print("-------------------------------\n"); |
| 1572 | blob_read_from_file(&b, g.argv[i]); |
| @@ -1583,11 +1584,11 @@ | |
| 1584 | ** |
| 1585 | ** Print the difference between two files. The usual diff options apply. |
| 1586 | */ |
| 1587 | void test_udiff_cmd(void){ |
| 1588 | Blob a, b, out; |
| 1589 | u64 diffFlag = diff_options(); |
| 1590 | |
| 1591 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 1592 | blob_read_from_file(&a, g.argv[2]); |
| 1593 | blob_read_from_file(&b, g.argv[3]); |
| 1594 | blob_zero(&out); |
| 1595 |
+10
-10
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -31,11 +31,11 @@ | ||
| 31 | 31 | #endif |
| 32 | 32 | |
| 33 | 33 | /* |
| 34 | 34 | ** Print the "Index:" message that patches wants to see at the top of a diff. |
| 35 | 35 | */ |
| 36 | -void diff_print_index(const char *zFile, int diffFlags){ | |
| 36 | +void diff_print_index(const char *zFile, u64 diffFlags){ | |
| 37 | 37 | if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){ |
| 38 | 38 | char *z = mprintf("Index: %s\n%.66c\n", zFile, '='); |
| 39 | 39 | fossil_print("%s", z); |
| 40 | 40 | fossil_free(z); |
| 41 | 41 | } |
| @@ -42,11 +42,11 @@ | ||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /* |
| 45 | 45 | ** Print the +++/--- filename lines for a diff operation. |
| 46 | 46 | */ |
| 47 | -void diff_print_filenames(const char *zLeft, const char *zRight, int diffFlags){ | |
| 47 | +void diff_print_filenames(const char *zLeft, const char *zRight, u64 diffFlags){ | |
| 48 | 48 | char *z = 0; |
| 49 | 49 | if( diffFlags & DIFF_BRIEF ){ |
| 50 | 50 | /* no-op */ |
| 51 | 51 | }else if( diffFlags & DIFF_SIDEBYSIDE ){ |
| 52 | 52 | int w = diff_width(diffFlags); |
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | void diff_file( |
| 76 | 76 | Blob *pFile1, /* In memory content to compare from */ |
| 77 | 77 | const char *zFile2, /* On disk content to compare to */ |
| 78 | 78 | const char *zName, /* Display name of the file */ |
| 79 | 79 | const char *zDiffCmd, /* Command for comparison */ |
| 80 | - int diffFlags /* Flags to control the diff */ | |
| 80 | + u64 diffFlags /* Flags to control the diff */ | |
| 81 | 81 | ){ |
| 82 | 82 | if( zDiffCmd==0 ){ |
| 83 | 83 | Blob out; /* Diff output text */ |
| 84 | 84 | Blob file2; /* Content of zFile2 */ |
| 85 | 85 | const char *zName2; /* Name of zFile2 for display */ |
| @@ -157,11 +157,11 @@ | ||
| 157 | 157 | void diff_file_mem( |
| 158 | 158 | Blob *pFile1, /* In memory content to compare from */ |
| 159 | 159 | Blob *pFile2, /* In memory content to compare to */ |
| 160 | 160 | const char *zName, /* Display name of the file */ |
| 161 | 161 | const char *zDiffCmd, /* Command for comparison */ |
| 162 | - int diffFlags /* Diff flags */ | |
| 162 | + u64 diffFlags /* Diff flags */ | |
| 163 | 163 | ){ |
| 164 | 164 | if( diffFlags & DIFF_BRIEF ) return; |
| 165 | 165 | if( zDiffCmd==0 ){ |
| 166 | 166 | Blob out; /* Diff output text */ |
| 167 | 167 | |
| @@ -205,11 +205,11 @@ | ||
| 205 | 205 | ** against the same file on disk. |
| 206 | 206 | */ |
| 207 | 207 | static void diff_one_against_disk( |
| 208 | 208 | const char *zFrom, /* Name of file */ |
| 209 | 209 | const char *zDiffCmd, /* Use this "diff" command */ |
| 210 | - int diffFlags, /* Diff control flags */ | |
| 210 | + u64 diffFlags, /* Diff control flags */ | |
| 211 | 211 | const char *zFileTreeName |
| 212 | 212 | ){ |
| 213 | 213 | Blob fname; |
| 214 | 214 | Blob content; |
| 215 | 215 | int isLink; |
| @@ -231,11 +231,11 @@ | ||
| 231 | 231 | ** files on disk and the check-out on which they are based. |
| 232 | 232 | */ |
| 233 | 233 | static void diff_all_against_disk( |
| 234 | 234 | const char *zFrom, /* Version to difference from */ |
| 235 | 235 | const char *zDiffCmd, /* Use this diff command. NULL for built-in */ |
| 236 | - int diffFlags /* Flags controlling diff output */ | |
| 236 | + u64 diffFlags /* Flags controlling diff output */ | |
| 237 | 237 | ){ |
| 238 | 238 | int vid; |
| 239 | 239 | Blob sql; |
| 240 | 240 | Stmt q; |
| 241 | 241 | int asNewFile; /* Treat non-existant files as empty files */ |
| @@ -337,11 +337,11 @@ | ||
| 337 | 337 | */ |
| 338 | 338 | static void diff_one_two_versions( |
| 339 | 339 | const char *zFrom, |
| 340 | 340 | const char *zTo, |
| 341 | 341 | const char *zDiffCmd, |
| 342 | - int diffFlags, | |
| 342 | + u64 diffFlags, | |
| 343 | 343 | const char *zFileTreeName |
| 344 | 344 | ){ |
| 345 | 345 | char *zName; |
| 346 | 346 | Blob fname; |
| 347 | 347 | Blob v1, v2; |
| @@ -369,11 +369,11 @@ | ||
| 369 | 369 | */ |
| 370 | 370 | static void diff_manifest_entry( |
| 371 | 371 | struct ManifestFile *pFrom, |
| 372 | 372 | struct ManifestFile *pTo, |
| 373 | 373 | const char *zDiffCmd, |
| 374 | - int diffFlags | |
| 374 | + u64 diffFlags | |
| 375 | 375 | ){ |
| 376 | 376 | Blob f1, f2; |
| 377 | 377 | int rid; |
| 378 | 378 | const char *zName = pFrom ? pFrom->zName : pTo->zName; |
| 379 | 379 | if( diffFlags & DIFF_BRIEF ) return; |
| @@ -400,11 +400,11 @@ | ||
| 400 | 400 | */ |
| 401 | 401 | static void diff_all_two_versions( |
| 402 | 402 | const char *zFrom, |
| 403 | 403 | const char *zTo, |
| 404 | 404 | const char *zDiffCmd, |
| 405 | - int diffFlags | |
| 405 | + u64 diffFlags | |
| 406 | 406 | ){ |
| 407 | 407 | Manifest *pFrom, *pTo; |
| 408 | 408 | ManifestFile *pFromFile, *pToFile; |
| 409 | 409 | int asNewFlag = (diffFlags & DIFF_NEWFILE)!=0 ? 1 : 0; |
| 410 | 410 | |
| @@ -499,11 +499,11 @@ | ||
| 499 | 499 | int hasNFlag; /* True if -N or --new-file flag is used */ |
| 500 | 500 | const char *zFrom; /* Source version number */ |
| 501 | 501 | const char *zTo; /* Target version number */ |
| 502 | 502 | const char *zBranch; /* Branch to diff */ |
| 503 | 503 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 504 | - int diffFlags = 0; /* Flags to control the DIFF */ | |
| 504 | + u64 diffFlags = 0; /* Flags to control the DIFF */ | |
| 505 | 505 | int f; |
| 506 | 506 | |
| 507 | 507 | isGDiff = g.argv[1][0]=='g'; |
| 508 | 508 | isInternDiff = find_option("internal","i",0)!=0; |
| 509 | 509 | zFrom = find_option("from", "r", 1); |
| 510 | 510 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -31,11 +31,11 @@ | |
| 31 | #endif |
| 32 | |
| 33 | /* |
| 34 | ** Print the "Index:" message that patches wants to see at the top of a diff. |
| 35 | */ |
| 36 | void diff_print_index(const char *zFile, int diffFlags){ |
| 37 | if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){ |
| 38 | char *z = mprintf("Index: %s\n%.66c\n", zFile, '='); |
| 39 | fossil_print("%s", z); |
| 40 | fossil_free(z); |
| 41 | } |
| @@ -42,11 +42,11 @@ | |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | ** Print the +++/--- filename lines for a diff operation. |
| 46 | */ |
| 47 | void diff_print_filenames(const char *zLeft, const char *zRight, int diffFlags){ |
| 48 | char *z = 0; |
| 49 | if( diffFlags & DIFF_BRIEF ){ |
| 50 | /* no-op */ |
| 51 | }else if( diffFlags & DIFF_SIDEBYSIDE ){ |
| 52 | int w = diff_width(diffFlags); |
| @@ -75,11 +75,11 @@ | |
| 75 | void diff_file( |
| 76 | Blob *pFile1, /* In memory content to compare from */ |
| 77 | const char *zFile2, /* On disk content to compare to */ |
| 78 | const char *zName, /* Display name of the file */ |
| 79 | const char *zDiffCmd, /* Command for comparison */ |
| 80 | int diffFlags /* Flags to control the diff */ |
| 81 | ){ |
| 82 | if( zDiffCmd==0 ){ |
| 83 | Blob out; /* Diff output text */ |
| 84 | Blob file2; /* Content of zFile2 */ |
| 85 | const char *zName2; /* Name of zFile2 for display */ |
| @@ -157,11 +157,11 @@ | |
| 157 | void diff_file_mem( |
| 158 | Blob *pFile1, /* In memory content to compare from */ |
| 159 | Blob *pFile2, /* In memory content to compare to */ |
| 160 | const char *zName, /* Display name of the file */ |
| 161 | const char *zDiffCmd, /* Command for comparison */ |
| 162 | int diffFlags /* Diff flags */ |
| 163 | ){ |
| 164 | if( diffFlags & DIFF_BRIEF ) return; |
| 165 | if( zDiffCmd==0 ){ |
| 166 | Blob out; /* Diff output text */ |
| 167 | |
| @@ -205,11 +205,11 @@ | |
| 205 | ** against the same file on disk. |
| 206 | */ |
| 207 | static void diff_one_against_disk( |
| 208 | const char *zFrom, /* Name of file */ |
| 209 | const char *zDiffCmd, /* Use this "diff" command */ |
| 210 | int diffFlags, /* Diff control flags */ |
| 211 | const char *zFileTreeName |
| 212 | ){ |
| 213 | Blob fname; |
| 214 | Blob content; |
| 215 | int isLink; |
| @@ -231,11 +231,11 @@ | |
| 231 | ** files on disk and the check-out on which they are based. |
| 232 | */ |
| 233 | static void diff_all_against_disk( |
| 234 | const char *zFrom, /* Version to difference from */ |
| 235 | const char *zDiffCmd, /* Use this diff command. NULL for built-in */ |
| 236 | int diffFlags /* Flags controlling diff output */ |
| 237 | ){ |
| 238 | int vid; |
| 239 | Blob sql; |
| 240 | Stmt q; |
| 241 | int asNewFile; /* Treat non-existant files as empty files */ |
| @@ -337,11 +337,11 @@ | |
| 337 | */ |
| 338 | static void diff_one_two_versions( |
| 339 | const char *zFrom, |
| 340 | const char *zTo, |
| 341 | const char *zDiffCmd, |
| 342 | int diffFlags, |
| 343 | const char *zFileTreeName |
| 344 | ){ |
| 345 | char *zName; |
| 346 | Blob fname; |
| 347 | Blob v1, v2; |
| @@ -369,11 +369,11 @@ | |
| 369 | */ |
| 370 | static void diff_manifest_entry( |
| 371 | struct ManifestFile *pFrom, |
| 372 | struct ManifestFile *pTo, |
| 373 | const char *zDiffCmd, |
| 374 | int diffFlags |
| 375 | ){ |
| 376 | Blob f1, f2; |
| 377 | int rid; |
| 378 | const char *zName = pFrom ? pFrom->zName : pTo->zName; |
| 379 | if( diffFlags & DIFF_BRIEF ) return; |
| @@ -400,11 +400,11 @@ | |
| 400 | */ |
| 401 | static void diff_all_two_versions( |
| 402 | const char *zFrom, |
| 403 | const char *zTo, |
| 404 | const char *zDiffCmd, |
| 405 | int diffFlags |
| 406 | ){ |
| 407 | Manifest *pFrom, *pTo; |
| 408 | ManifestFile *pFromFile, *pToFile; |
| 409 | int asNewFlag = (diffFlags & DIFF_NEWFILE)!=0 ? 1 : 0; |
| 410 | |
| @@ -499,11 +499,11 @@ | |
| 499 | int hasNFlag; /* True if -N or --new-file flag is used */ |
| 500 | const char *zFrom; /* Source version number */ |
| 501 | const char *zTo; /* Target version number */ |
| 502 | const char *zBranch; /* Branch to diff */ |
| 503 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 504 | int diffFlags = 0; /* Flags to control the DIFF */ |
| 505 | int f; |
| 506 | |
| 507 | isGDiff = g.argv[1][0]=='g'; |
| 508 | isInternDiff = find_option("internal","i",0)!=0; |
| 509 | zFrom = find_option("from", "r", 1); |
| 510 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -31,11 +31,11 @@ | |
| 31 | #endif |
| 32 | |
| 33 | /* |
| 34 | ** Print the "Index:" message that patches wants to see at the top of a diff. |
| 35 | */ |
| 36 | void diff_print_index(const char *zFile, u64 diffFlags){ |
| 37 | if( (diffFlags & (DIFF_SIDEBYSIDE|DIFF_BRIEF))==0 ){ |
| 38 | char *z = mprintf("Index: %s\n%.66c\n", zFile, '='); |
| 39 | fossil_print("%s", z); |
| 40 | fossil_free(z); |
| 41 | } |
| @@ -42,11 +42,11 @@ | |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | ** Print the +++/--- filename lines for a diff operation. |
| 46 | */ |
| 47 | void diff_print_filenames(const char *zLeft, const char *zRight, u64 diffFlags){ |
| 48 | char *z = 0; |
| 49 | if( diffFlags & DIFF_BRIEF ){ |
| 50 | /* no-op */ |
| 51 | }else if( diffFlags & DIFF_SIDEBYSIDE ){ |
| 52 | int w = diff_width(diffFlags); |
| @@ -75,11 +75,11 @@ | |
| 75 | void diff_file( |
| 76 | Blob *pFile1, /* In memory content to compare from */ |
| 77 | const char *zFile2, /* On disk content to compare to */ |
| 78 | const char *zName, /* Display name of the file */ |
| 79 | const char *zDiffCmd, /* Command for comparison */ |
| 80 | u64 diffFlags /* Flags to control the diff */ |
| 81 | ){ |
| 82 | if( zDiffCmd==0 ){ |
| 83 | Blob out; /* Diff output text */ |
| 84 | Blob file2; /* Content of zFile2 */ |
| 85 | const char *zName2; /* Name of zFile2 for display */ |
| @@ -157,11 +157,11 @@ | |
| 157 | void diff_file_mem( |
| 158 | Blob *pFile1, /* In memory content to compare from */ |
| 159 | Blob *pFile2, /* In memory content to compare to */ |
| 160 | const char *zName, /* Display name of the file */ |
| 161 | const char *zDiffCmd, /* Command for comparison */ |
| 162 | u64 diffFlags /* Diff flags */ |
| 163 | ){ |
| 164 | if( diffFlags & DIFF_BRIEF ) return; |
| 165 | if( zDiffCmd==0 ){ |
| 166 | Blob out; /* Diff output text */ |
| 167 | |
| @@ -205,11 +205,11 @@ | |
| 205 | ** against the same file on disk. |
| 206 | */ |
| 207 | static void diff_one_against_disk( |
| 208 | const char *zFrom, /* Name of file */ |
| 209 | const char *zDiffCmd, /* Use this "diff" command */ |
| 210 | u64 diffFlags, /* Diff control flags */ |
| 211 | const char *zFileTreeName |
| 212 | ){ |
| 213 | Blob fname; |
| 214 | Blob content; |
| 215 | int isLink; |
| @@ -231,11 +231,11 @@ | |
| 231 | ** files on disk and the check-out on which they are based. |
| 232 | */ |
| 233 | static void diff_all_against_disk( |
| 234 | const char *zFrom, /* Version to difference from */ |
| 235 | const char *zDiffCmd, /* Use this diff command. NULL for built-in */ |
| 236 | u64 diffFlags /* Flags controlling diff output */ |
| 237 | ){ |
| 238 | int vid; |
| 239 | Blob sql; |
| 240 | Stmt q; |
| 241 | int asNewFile; /* Treat non-existant files as empty files */ |
| @@ -337,11 +337,11 @@ | |
| 337 | */ |
| 338 | static void diff_one_two_versions( |
| 339 | const char *zFrom, |
| 340 | const char *zTo, |
| 341 | const char *zDiffCmd, |
| 342 | u64 diffFlags, |
| 343 | const char *zFileTreeName |
| 344 | ){ |
| 345 | char *zName; |
| 346 | Blob fname; |
| 347 | Blob v1, v2; |
| @@ -369,11 +369,11 @@ | |
| 369 | */ |
| 370 | static void diff_manifest_entry( |
| 371 | struct ManifestFile *pFrom, |
| 372 | struct ManifestFile *pTo, |
| 373 | const char *zDiffCmd, |
| 374 | u64 diffFlags |
| 375 | ){ |
| 376 | Blob f1, f2; |
| 377 | int rid; |
| 378 | const char *zName = pFrom ? pFrom->zName : pTo->zName; |
| 379 | if( diffFlags & DIFF_BRIEF ) return; |
| @@ -400,11 +400,11 @@ | |
| 400 | */ |
| 401 | static void diff_all_two_versions( |
| 402 | const char *zFrom, |
| 403 | const char *zTo, |
| 404 | const char *zDiffCmd, |
| 405 | u64 diffFlags |
| 406 | ){ |
| 407 | Manifest *pFrom, *pTo; |
| 408 | ManifestFile *pFromFile, *pToFile; |
| 409 | int asNewFlag = (diffFlags & DIFF_NEWFILE)!=0 ? 1 : 0; |
| 410 | |
| @@ -499,11 +499,11 @@ | |
| 499 | int hasNFlag; /* True if -N or --new-file flag is used */ |
| 500 | const char *zFrom; /* Source version number */ |
| 501 | const char *zTo; /* Target version number */ |
| 502 | const char *zBranch; /* Branch to diff */ |
| 503 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 504 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 505 | int f; |
| 506 | |
| 507 | isGDiff = g.argv[1][0]=='g'; |
| 508 | isInternDiff = find_option("internal","i",0)!=0; |
| 509 | zFrom = find_option("from", "r", 1); |
| 510 |
+7
-7
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -289,11 +289,11 @@ | ||
| 289 | 289 | |
| 290 | 290 | |
| 291 | 291 | /* |
| 292 | 292 | ** Append the difference between two RIDs to the output |
| 293 | 293 | */ |
| 294 | -static void append_diff(const char *zFrom, const char *zTo, int diffFlags){ | |
| 294 | +static void append_diff(const char *zFrom, const char *zTo, u64 diffFlags){ | |
| 295 | 295 | int fromid; |
| 296 | 296 | int toid; |
| 297 | 297 | Blob from, to, out; |
| 298 | 298 | if( zFrom ){ |
| 299 | 299 | fromid = uuid_to_rid(zFrom, 0); |
| @@ -332,11 +332,11 @@ | ||
| 332 | 332 | static void append_file_change_line( |
| 333 | 333 | const char *zName, /* Name of the file that has changed */ |
| 334 | 334 | const char *zOld, /* blob.uuid before change. NULL for added files */ |
| 335 | 335 | const char *zNew, /* blob.uuid after change. NULL for deletes */ |
| 336 | 336 | const char *zOldName, /* Prior name. NULL if no name change. */ |
| 337 | - int diffFlags, /* Flags for text_diff(). Zero to omit diffs */ | |
| 337 | + u64 diffFlags, /* Flags for text_diff(). Zero to omit diffs */ | |
| 338 | 338 | int mperm /* executable or symlink permission for zNew */ |
| 339 | 339 | ){ |
| 340 | 340 | if( !g.perm.Hyperlink ){ |
| 341 | 341 | if( zNew==0 ){ |
| 342 | 342 | @ <p>Deleted %h(zName)</p> |
| @@ -390,12 +390,12 @@ | ||
| 390 | 390 | |
| 391 | 391 | /* |
| 392 | 392 | ** Construct an appropriate diffFlag for text_diff() based on query |
| 393 | 393 | ** parameters and the to boolean arguments. |
| 394 | 394 | */ |
| 395 | -int construct_diff_flags(int showDiff, int sideBySide){ | |
| 396 | - int diffFlags; | |
| 395 | +u64 construct_diff_flags(int showDiff, int sideBySide){ | |
| 396 | + u64 diffFlags; | |
| 397 | 397 | if( showDiff==0 ){ |
| 398 | 398 | diffFlags = 0; /* Zero means do not show any diff */ |
| 399 | 399 | }else{ |
| 400 | 400 | int x; |
| 401 | 401 | if( sideBySide ){ |
| @@ -440,11 +440,11 @@ | ||
| 440 | 440 | Stmt q; |
| 441 | 441 | int rid; |
| 442 | 442 | int isLeaf; |
| 443 | 443 | int showDiff; /* True to show diffs */ |
| 444 | 444 | int sideBySide; /* True for side-by-side diffs */ |
| 445 | - int diffFlags; /* Flag parameter for text_diff() */ | |
| 445 | + u64 diffFlags; /* Flag parameter for text_diff() */ | |
| 446 | 446 | const char *zName; /* Name of the checkin to be displayed */ |
| 447 | 447 | const char *zUuid; /* UUID of zName */ |
| 448 | 448 | const char *zParent; /* UUID of the parent checkin (if any) */ |
| 449 | 449 | |
| 450 | 450 | login_check_credentials(); |
| @@ -822,11 +822,11 @@ | ||
| 822 | 822 | */ |
| 823 | 823 | void vdiff_page(void){ |
| 824 | 824 | int ridFrom, ridTo; |
| 825 | 825 | int showDetail = 0; |
| 826 | 826 | int sideBySide = 0; |
| 827 | - int diffFlags = 0; | |
| 827 | + u64 diffFlags = 0; | |
| 828 | 828 | Manifest *pFrom, *pTo; |
| 829 | 829 | ManifestFile *pFileFrom, *pFileTo; |
| 830 | 830 | const char *zBranch; |
| 831 | 831 | |
| 832 | 832 | login_check_credentials(); |
| @@ -1126,11 +1126,11 @@ | ||
| 1126 | 1126 | int isPatch; |
| 1127 | 1127 | int sideBySide; |
| 1128 | 1128 | Blob c1, c2, diff, *pOut; |
| 1129 | 1129 | char *zV1; |
| 1130 | 1130 | char *zV2; |
| 1131 | - int diffFlags; | |
| 1131 | + u64 diffFlags; | |
| 1132 | 1132 | const char *zStyle = "sbsdiff"; |
| 1133 | 1133 | |
| 1134 | 1134 | login_check_credentials(); |
| 1135 | 1135 | if( !g.perm.Read ){ login_needed(); return; } |
| 1136 | 1136 | v1 = name_to_rid_www("v1"); |
| 1137 | 1137 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -289,11 +289,11 @@ | |
| 289 | |
| 290 | |
| 291 | /* |
| 292 | ** Append the difference between two RIDs to the output |
| 293 | */ |
| 294 | static void append_diff(const char *zFrom, const char *zTo, int diffFlags){ |
| 295 | int fromid; |
| 296 | int toid; |
| 297 | Blob from, to, out; |
| 298 | if( zFrom ){ |
| 299 | fromid = uuid_to_rid(zFrom, 0); |
| @@ -332,11 +332,11 @@ | |
| 332 | static void append_file_change_line( |
| 333 | const char *zName, /* Name of the file that has changed */ |
| 334 | const char *zOld, /* blob.uuid before change. NULL for added files */ |
| 335 | const char *zNew, /* blob.uuid after change. NULL for deletes */ |
| 336 | const char *zOldName, /* Prior name. NULL if no name change. */ |
| 337 | int diffFlags, /* Flags for text_diff(). Zero to omit diffs */ |
| 338 | int mperm /* executable or symlink permission for zNew */ |
| 339 | ){ |
| 340 | if( !g.perm.Hyperlink ){ |
| 341 | if( zNew==0 ){ |
| 342 | @ <p>Deleted %h(zName)</p> |
| @@ -390,12 +390,12 @@ | |
| 390 | |
| 391 | /* |
| 392 | ** Construct an appropriate diffFlag for text_diff() based on query |
| 393 | ** parameters and the to boolean arguments. |
| 394 | */ |
| 395 | int construct_diff_flags(int showDiff, int sideBySide){ |
| 396 | int diffFlags; |
| 397 | if( showDiff==0 ){ |
| 398 | diffFlags = 0; /* Zero means do not show any diff */ |
| 399 | }else{ |
| 400 | int x; |
| 401 | if( sideBySide ){ |
| @@ -440,11 +440,11 @@ | |
| 440 | Stmt q; |
| 441 | int rid; |
| 442 | int isLeaf; |
| 443 | int showDiff; /* True to show diffs */ |
| 444 | int sideBySide; /* True for side-by-side diffs */ |
| 445 | int diffFlags; /* Flag parameter for text_diff() */ |
| 446 | const char *zName; /* Name of the checkin to be displayed */ |
| 447 | const char *zUuid; /* UUID of zName */ |
| 448 | const char *zParent; /* UUID of the parent checkin (if any) */ |
| 449 | |
| 450 | login_check_credentials(); |
| @@ -822,11 +822,11 @@ | |
| 822 | */ |
| 823 | void vdiff_page(void){ |
| 824 | int ridFrom, ridTo; |
| 825 | int showDetail = 0; |
| 826 | int sideBySide = 0; |
| 827 | int diffFlags = 0; |
| 828 | Manifest *pFrom, *pTo; |
| 829 | ManifestFile *pFileFrom, *pFileTo; |
| 830 | const char *zBranch; |
| 831 | |
| 832 | login_check_credentials(); |
| @@ -1126,11 +1126,11 @@ | |
| 1126 | int isPatch; |
| 1127 | int sideBySide; |
| 1128 | Blob c1, c2, diff, *pOut; |
| 1129 | char *zV1; |
| 1130 | char *zV2; |
| 1131 | int diffFlags; |
| 1132 | const char *zStyle = "sbsdiff"; |
| 1133 | |
| 1134 | login_check_credentials(); |
| 1135 | if( !g.perm.Read ){ login_needed(); return; } |
| 1136 | v1 = name_to_rid_www("v1"); |
| 1137 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -289,11 +289,11 @@ | |
| 289 | |
| 290 | |
| 291 | /* |
| 292 | ** Append the difference between two RIDs to the output |
| 293 | */ |
| 294 | static void append_diff(const char *zFrom, const char *zTo, u64 diffFlags){ |
| 295 | int fromid; |
| 296 | int toid; |
| 297 | Blob from, to, out; |
| 298 | if( zFrom ){ |
| 299 | fromid = uuid_to_rid(zFrom, 0); |
| @@ -332,11 +332,11 @@ | |
| 332 | static void append_file_change_line( |
| 333 | const char *zName, /* Name of the file that has changed */ |
| 334 | const char *zOld, /* blob.uuid before change. NULL for added files */ |
| 335 | const char *zNew, /* blob.uuid after change. NULL for deletes */ |
| 336 | const char *zOldName, /* Prior name. NULL if no name change. */ |
| 337 | u64 diffFlags, /* Flags for text_diff(). Zero to omit diffs */ |
| 338 | int mperm /* executable or symlink permission for zNew */ |
| 339 | ){ |
| 340 | if( !g.perm.Hyperlink ){ |
| 341 | if( zNew==0 ){ |
| 342 | @ <p>Deleted %h(zName)</p> |
| @@ -390,12 +390,12 @@ | |
| 390 | |
| 391 | /* |
| 392 | ** Construct an appropriate diffFlag for text_diff() based on query |
| 393 | ** parameters and the to boolean arguments. |
| 394 | */ |
| 395 | u64 construct_diff_flags(int showDiff, int sideBySide){ |
| 396 | u64 diffFlags; |
| 397 | if( showDiff==0 ){ |
| 398 | diffFlags = 0; /* Zero means do not show any diff */ |
| 399 | }else{ |
| 400 | int x; |
| 401 | if( sideBySide ){ |
| @@ -440,11 +440,11 @@ | |
| 440 | Stmt q; |
| 441 | int rid; |
| 442 | int isLeaf; |
| 443 | int showDiff; /* True to show diffs */ |
| 444 | int sideBySide; /* True for side-by-side diffs */ |
| 445 | u64 diffFlags; /* Flag parameter for text_diff() */ |
| 446 | const char *zName; /* Name of the checkin to be displayed */ |
| 447 | const char *zUuid; /* UUID of zName */ |
| 448 | const char *zParent; /* UUID of the parent checkin (if any) */ |
| 449 | |
| 450 | login_check_credentials(); |
| @@ -822,11 +822,11 @@ | |
| 822 | */ |
| 823 | void vdiff_page(void){ |
| 824 | int ridFrom, ridTo; |
| 825 | int showDetail = 0; |
| 826 | int sideBySide = 0; |
| 827 | u64 diffFlags = 0; |
| 828 | Manifest *pFrom, *pTo; |
| 829 | ManifestFile *pFileFrom, *pFileTo; |
| 830 | const char *zBranch; |
| 831 | |
| 832 | login_check_credentials(); |
| @@ -1126,11 +1126,11 @@ | |
| 1126 | int isPatch; |
| 1127 | int sideBySide; |
| 1128 | Blob c1, c2, diff, *pOut; |
| 1129 | char *zV1; |
| 1130 | char *zV2; |
| 1131 | u64 diffFlags; |
| 1132 | const char *zStyle = "sbsdiff"; |
| 1133 | |
| 1134 | login_check_credentials(); |
| 1135 | if( !g.perm.Read ){ login_needed(); return; } |
| 1136 | v1 = name_to_rid_www("v1"); |
| 1137 |
+1
-1
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -494,11 +494,11 @@ | ||
| 494 | 494 | int argPos = g.json.dispatchDepth; |
| 495 | 495 | int r1 = 0, r2 = 0; |
| 496 | 496 | Manifest * pW1 = NULL, *pW2 = NULL; |
| 497 | 497 | Blob w1 = empty_blob, w2 = empty_blob, d = empty_blob; |
| 498 | 498 | char const * zErrTag = NULL; |
| 499 | - int diffFlags; | |
| 499 | + u64 diffFlags; | |
| 500 | 500 | char * zUuid = NULL; |
| 501 | 501 | if( !g.perm.Hyperlink ){ |
| 502 | 502 | json_set_err(FSL_JSON_E_DENIED, |
| 503 | 503 | "Requires 'h' permissions."); |
| 504 | 504 | return NULL; |
| 505 | 505 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -494,11 +494,11 @@ | |
| 494 | int argPos = g.json.dispatchDepth; |
| 495 | int r1 = 0, r2 = 0; |
| 496 | Manifest * pW1 = NULL, *pW2 = NULL; |
| 497 | Blob w1 = empty_blob, w2 = empty_blob, d = empty_blob; |
| 498 | char const * zErrTag = NULL; |
| 499 | int diffFlags; |
| 500 | char * zUuid = NULL; |
| 501 | if( !g.perm.Hyperlink ){ |
| 502 | json_set_err(FSL_JSON_E_DENIED, |
| 503 | "Requires 'h' permissions."); |
| 504 | return NULL; |
| 505 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -494,11 +494,11 @@ | |
| 494 | int argPos = g.json.dispatchDepth; |
| 495 | int r1 = 0, r2 = 0; |
| 496 | Manifest * pW1 = NULL, *pW2 = NULL; |
| 497 | Blob w1 = empty_blob, w2 = empty_blob, d = empty_blob; |
| 498 | char const * zErrTag = NULL; |
| 499 | u64 diffFlags; |
| 500 | char * zUuid = NULL; |
| 501 | if( !g.perm.Hyperlink ){ |
| 502 | json_set_err(FSL_JSON_E_DENIED, |
| 503 | "Requires 'h' permissions."); |
| 504 | return NULL; |
| 505 |
+3
-3
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -267,11 +267,11 @@ | ||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /* |
| 270 | 270 | ** Show the diffs associate with a single stash. |
| 271 | 271 | */ |
| 272 | -static void stash_diff(int stashid, const char *zDiffCmd, int diffFlags){ | |
| 272 | +static void stash_diff(int stashid, const char *zDiffCmd, u64 diffFlags){ | |
| 273 | 273 | Stmt q; |
| 274 | 274 | Blob empty; |
| 275 | 275 | blob_zero(&empty); |
| 276 | 276 | db_prepare(&q, |
| 277 | 277 | "SELECT rid, isRemoved, isExec, isLink, origname, newname, delta" |
| @@ -550,18 +550,18 @@ | ||
| 550 | 550 | stashid); |
| 551 | 551 | undo_finish(); |
| 552 | 552 | }else |
| 553 | 553 | if( memcmp(zCmd, "diff", nCmd)==0 ){ |
| 554 | 554 | const char *zDiffCmd = db_get("diff-command", 0); |
| 555 | - int diffFlags = diff_options(); | |
| 555 | + u64 diffFlags = diff_options(); | |
| 556 | 556 | if( g.argc>4 ) usage("diff STASHID"); |
| 557 | 557 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 558 | 558 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 559 | 559 | }else |
| 560 | 560 | if( memcmp(zCmd, "gdiff", nCmd)==0 ){ |
| 561 | 561 | const char *zDiffCmd = db_get("gdiff-command", 0); |
| 562 | - int diffFlags = diff_options(); | |
| 562 | + u64 diffFlags = diff_options(); | |
| 563 | 563 | if( g.argc>4 ) usage("diff STASHID"); |
| 564 | 564 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 565 | 565 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 566 | 566 | }else |
| 567 | 567 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 568 | 568 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | } |
| 268 | |
| 269 | /* |
| 270 | ** Show the diffs associate with a single stash. |
| 271 | */ |
| 272 | static void stash_diff(int stashid, const char *zDiffCmd, int diffFlags){ |
| 273 | Stmt q; |
| 274 | Blob empty; |
| 275 | blob_zero(&empty); |
| 276 | db_prepare(&q, |
| 277 | "SELECT rid, isRemoved, isExec, isLink, origname, newname, delta" |
| @@ -550,18 +550,18 @@ | |
| 550 | stashid); |
| 551 | undo_finish(); |
| 552 | }else |
| 553 | if( memcmp(zCmd, "diff", nCmd)==0 ){ |
| 554 | const char *zDiffCmd = db_get("diff-command", 0); |
| 555 | int diffFlags = diff_options(); |
| 556 | if( g.argc>4 ) usage("diff STASHID"); |
| 557 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 558 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 559 | }else |
| 560 | if( memcmp(zCmd, "gdiff", nCmd)==0 ){ |
| 561 | const char *zDiffCmd = db_get("gdiff-command", 0); |
| 562 | int diffFlags = diff_options(); |
| 563 | if( g.argc>4 ) usage("diff STASHID"); |
| 564 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 565 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 566 | }else |
| 567 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 568 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | } |
| 268 | |
| 269 | /* |
| 270 | ** Show the diffs associate with a single stash. |
| 271 | */ |
| 272 | static void stash_diff(int stashid, const char *zDiffCmd, u64 diffFlags){ |
| 273 | Stmt q; |
| 274 | Blob empty; |
| 275 | blob_zero(&empty); |
| 276 | db_prepare(&q, |
| 277 | "SELECT rid, isRemoved, isExec, isLink, origname, newname, delta" |
| @@ -550,18 +550,18 @@ | |
| 550 | stashid); |
| 551 | undo_finish(); |
| 552 | }else |
| 553 | if( memcmp(zCmd, "diff", nCmd)==0 ){ |
| 554 | const char *zDiffCmd = db_get("diff-command", 0); |
| 555 | u64 diffFlags = diff_options(); |
| 556 | if( g.argc>4 ) usage("diff STASHID"); |
| 557 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 558 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 559 | }else |
| 560 | if( memcmp(zCmd, "gdiff", nCmd)==0 ){ |
| 561 | const char *zDiffCmd = db_get("gdiff-command", 0); |
| 562 | u64 diffFlags = diff_options(); |
| 563 | if( g.argc>4 ) usage("diff STASHID"); |
| 564 | stashid = stash_get_id(g.argc==4 ? g.argv[3] : 0); |
| 565 | stash_diff(stashid, zDiffCmd, diffFlags); |
| 566 | }else |
| 567 | if( memcmp(zCmd, "help", nCmd)==0 ){ |
| 568 |
+1
-1
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -637,11 +637,11 @@ | ||
| 637 | 637 | char *zTitle; |
| 638 | 638 | int rid1, rid2; |
| 639 | 639 | const char *zPageName; |
| 640 | 640 | Manifest *pW1, *pW2 = 0; |
| 641 | 641 | Blob w1, w2, d; |
| 642 | - int diffFlags; | |
| 642 | + u64 diffFlags; | |
| 643 | 643 | |
| 644 | 644 | login_check_credentials(); |
| 645 | 645 | rid1 = atoi(PD("a","0")); |
| 646 | 646 | if( !g.perm.Hyperlink ){ login_needed(); return; } |
| 647 | 647 | if( rid1==0 ) fossil_redirect_home(); |
| 648 | 648 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -637,11 +637,11 @@ | |
| 637 | char *zTitle; |
| 638 | int rid1, rid2; |
| 639 | const char *zPageName; |
| 640 | Manifest *pW1, *pW2 = 0; |
| 641 | Blob w1, w2, d; |
| 642 | int diffFlags; |
| 643 | |
| 644 | login_check_credentials(); |
| 645 | rid1 = atoi(PD("a","0")); |
| 646 | if( !g.perm.Hyperlink ){ login_needed(); return; } |
| 647 | if( rid1==0 ) fossil_redirect_home(); |
| 648 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -637,11 +637,11 @@ | |
| 637 | char *zTitle; |
| 638 | int rid1, rid2; |
| 639 | const char *zPageName; |
| 640 | Manifest *pW1, *pW2 = 0; |
| 641 | Blob w1, w2, d; |
| 642 | u64 diffFlags; |
| 643 | |
| 644 | login_check_credentials(); |
| 645 | rid1 = atoi(PD("a","0")); |
| 646 | if( !g.perm.Hyperlink ){ login_needed(); return; } |
| 647 | if( rid1==0 ) fossil_redirect_home(); |
| 648 |