Fossil SCM
merge trunk. Add fallback mechanism for MinGW
Commit
2459ee7b71172d70c3c167620f95f3527090c352
Parent
bac4b248f50b313…
11 files changed
+1
-1
+5
-3
+4
+5
-1
+5
-1
+67
-4
+2
-7
+7
+46
-5
+7
-1
+7
-1
+1
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -523,11 +523,11 @@ | ||
| 523 | 523 | /* Unicode character in the range U+D800 - U+DFFF are for |
| 524 | 524 | * surrogate pairs, they shouldn't occur in filenames. */ |
| 525 | 525 | return 0; |
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | - if( c=='\\' || c=='*' || c=='[' || c==']' || c=='?' ){ | |
| 528 | + if( c=='\\' ){ | |
| 529 | 529 | return 0; |
| 530 | 530 | } |
| 531 | 531 | if( c=='/' ){ |
| 532 | 532 | if( z[i+1]=='/' ) return 0; |
| 533 | 533 | if( z[i+1]=='.' ){ |
| 534 | 534 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -523,11 +523,11 @@ | |
| 523 | /* Unicode character in the range U+D800 - U+DFFF are for |
| 524 | * surrogate pairs, they shouldn't occur in filenames. */ |
| 525 | return 0; |
| 526 | } |
| 527 | } |
| 528 | if( c=='\\' || c=='*' || c=='[' || c==']' || c=='?' ){ |
| 529 | return 0; |
| 530 | } |
| 531 | if( c=='/' ){ |
| 532 | if( z[i+1]=='/' ) return 0; |
| 533 | if( z[i+1]=='.' ){ |
| 534 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -523,11 +523,11 @@ | |
| 523 | /* Unicode character in the range U+D800 - U+DFFF are for |
| 524 | * surrogate pairs, they shouldn't occur in filenames. */ |
| 525 | return 0; |
| 526 | } |
| 527 | } |
| 528 | if( c=='\\' ){ |
| 529 | return 0; |
| 530 | } |
| 531 | if( c=='/' ){ |
| 532 | if( z[i+1]=='/' ) return 0; |
| 533 | if( z[i+1]=='.' ){ |
| 534 |
+5
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -345,11 +345,12 @@ | ||
| 345 | 345 | blob_appendf(&title, "History of "); |
| 346 | 346 | hyperlinked_path(zFilename, &title, 0); |
| 347 | 347 | @ <h2>%b(&title)</h2> |
| 348 | 348 | blob_reset(&title); |
| 349 | 349 | pGraph = graph_init(); |
| 350 | - @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> | |
| 350 | + @ <div id="canvas" style="position:relative;width:1px;height:1px;" | |
| 351 | + @ onclick="clickOnGraph(event)"></div> | |
| 351 | 352 | @ <table id="timelineTable" class="timelineTable"> |
| 352 | 353 | while( db_step(&q)==SQLITE_ROW ){ |
| 353 | 354 | const char *zDate = db_column_text(&q, 0); |
| 354 | 355 | const char *zCom = db_column_text(&q, 1); |
| 355 | 356 | const char *zUser = db_column_text(&q, 2); |
| @@ -370,11 +371,12 @@ | ||
| 370 | 371 | if( uBg ){ |
| 371 | 372 | zBgClr = hash_color(zUser); |
| 372 | 373 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 373 | 374 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 374 | 375 | } |
| 375 | - gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0); | |
| 376 | + gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, | |
| 377 | + zUuid, 0); | |
| 376 | 378 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 377 | 379 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 378 | 380 | @ <tr><td> |
| 379 | 381 | @ <div class="divider">%s(zPrevDate)</div> |
| 380 | 382 | @ </td><td></td><td></td></tr> |
| @@ -446,8 +448,8 @@ | ||
| 446 | 448 | @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 447 | 449 | @ </td><td></td></tr> |
| 448 | 450 | } |
| 449 | 451 | } |
| 450 | 452 | @ </table> |
| 451 | - timeline_output_graph_javascript(pGraph, 0); | |
| 453 | + timeline_output_graph_javascript(pGraph, 0, 1); | |
| 452 | 454 | style_footer(); |
| 453 | 455 | } |
| 454 | 456 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -345,11 +345,12 @@ | |
| 345 | blob_appendf(&title, "History of "); |
| 346 | hyperlinked_path(zFilename, &title, 0); |
| 347 | @ <h2>%b(&title)</h2> |
| 348 | blob_reset(&title); |
| 349 | pGraph = graph_init(); |
| 350 | @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> |
| 351 | @ <table id="timelineTable" class="timelineTable"> |
| 352 | while( db_step(&q)==SQLITE_ROW ){ |
| 353 | const char *zDate = db_column_text(&q, 0); |
| 354 | const char *zCom = db_column_text(&q, 1); |
| 355 | const char *zUser = db_column_text(&q, 2); |
| @@ -370,11 +371,12 @@ | |
| 370 | if( uBg ){ |
| 371 | zBgClr = hash_color(zUser); |
| 372 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 373 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 374 | } |
| 375 | gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0); |
| 376 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 377 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 378 | @ <tr><td> |
| 379 | @ <div class="divider">%s(zPrevDate)</div> |
| 380 | @ </td><td></td><td></td></tr> |
| @@ -446,8 +448,8 @@ | |
| 446 | @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 447 | @ </td><td></td></tr> |
| 448 | } |
| 449 | } |
| 450 | @ </table> |
| 451 | timeline_output_graph_javascript(pGraph, 0); |
| 452 | style_footer(); |
| 453 | } |
| 454 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -345,11 +345,12 @@ | |
| 345 | blob_appendf(&title, "History of "); |
| 346 | hyperlinked_path(zFilename, &title, 0); |
| 347 | @ <h2>%b(&title)</h2> |
| 348 | blob_reset(&title); |
| 349 | pGraph = graph_init(); |
| 350 | @ <div id="canvas" style="position:relative;width:1px;height:1px;" |
| 351 | @ onclick="clickOnGraph(event)"></div> |
| 352 | @ <table id="timelineTable" class="timelineTable"> |
| 353 | while( db_step(&q)==SQLITE_ROW ){ |
| 354 | const char *zDate = db_column_text(&q, 0); |
| 355 | const char *zCom = db_column_text(&q, 1); |
| 356 | const char *zUser = db_column_text(&q, 2); |
| @@ -370,11 +371,12 @@ | |
| 371 | if( uBg ){ |
| 372 | zBgClr = hash_color(zUser); |
| 373 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 374 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 375 | } |
| 376 | gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, |
| 377 | zUuid, 0); |
| 378 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 379 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 380 | @ <tr><td> |
| 381 | @ <div class="divider">%s(zPrevDate)</div> |
| 382 | @ </td><td></td><td></td></tr> |
| @@ -446,8 +448,8 @@ | |
| 448 | @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 449 | @ </td><td></td></tr> |
| 450 | } |
| 451 | } |
| 452 | @ </table> |
| 453 | timeline_output_graph_javascript(pGraph, 0, 1); |
| 454 | style_footer(); |
| 455 | } |
| 456 |
+4
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -34,10 +34,11 @@ | ||
| 34 | 34 | int rid; /* The rid for the check-in */ |
| 35 | 35 | i8 nParent; /* Number of parents */ |
| 36 | 36 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 37 | 37 | char *zBranch; /* Branch name */ |
| 38 | 38 | char *zBgClr; /* Background Color */ |
| 39 | + char zUuid[17]; /* Check-in for file ID */ | |
| 39 | 40 | |
| 40 | 41 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 41 | 42 | GraphRow *pPrev; /* Previous row */ |
| 42 | 43 | |
| 43 | 44 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| @@ -175,10 +176,11 @@ | ||
| 175 | 176 | int rid, /* RID for the check-in */ |
| 176 | 177 | int nParent, /* Number of parents */ |
| 177 | 178 | int *aParent, /* Array of parents */ |
| 178 | 179 | const char *zBranch, /* Branch for this check-in */ |
| 179 | 180 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 181 | + const char *zUuid, /* SHA1 hash of the object being graphed */ | |
| 180 | 182 | int isLeaf /* True if this row is a leaf */ |
| 181 | 183 | ){ |
| 182 | 184 | GraphRow *pRow; |
| 183 | 185 | int nByte; |
| 184 | 186 | |
| @@ -188,10 +190,12 @@ | ||
| 188 | 190 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 189 | 191 | pRow->aParent = (int*)&pRow[1]; |
| 190 | 192 | pRow->rid = rid; |
| 191 | 193 | pRow->nParent = nParent; |
| 192 | 194 | pRow->zBranch = persistBranchName(p, zBranch); |
| 195 | + if( zUuid==0 ) zUuid = ""; | |
| 196 | + sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid); | |
| 193 | 197 | pRow->isLeaf = isLeaf; |
| 194 | 198 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| 195 | 199 | if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white"; |
| 196 | 200 | pRow->zBgClr = persistBranchName(p, zBgClr); |
| 197 | 201 | memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent); |
| 198 | 202 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -34,10 +34,11 @@ | |
| 34 | int rid; /* The rid for the check-in */ |
| 35 | i8 nParent; /* Number of parents */ |
| 36 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 37 | char *zBranch; /* Branch name */ |
| 38 | char *zBgClr; /* Background Color */ |
| 39 | |
| 40 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 41 | GraphRow *pPrev; /* Previous row */ |
| 42 | |
| 43 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| @@ -175,10 +176,11 @@ | |
| 175 | int rid, /* RID for the check-in */ |
| 176 | int nParent, /* Number of parents */ |
| 177 | int *aParent, /* Array of parents */ |
| 178 | const char *zBranch, /* Branch for this check-in */ |
| 179 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 180 | int isLeaf /* True if this row is a leaf */ |
| 181 | ){ |
| 182 | GraphRow *pRow; |
| 183 | int nByte; |
| 184 | |
| @@ -188,10 +190,12 @@ | |
| 188 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 189 | pRow->aParent = (int*)&pRow[1]; |
| 190 | pRow->rid = rid; |
| 191 | pRow->nParent = nParent; |
| 192 | pRow->zBranch = persistBranchName(p, zBranch); |
| 193 | pRow->isLeaf = isLeaf; |
| 194 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| 195 | if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white"; |
| 196 | pRow->zBgClr = persistBranchName(p, zBgClr); |
| 197 | memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent); |
| 198 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -34,10 +34,11 @@ | |
| 34 | int rid; /* The rid for the check-in */ |
| 35 | i8 nParent; /* Number of parents */ |
| 36 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 37 | char *zBranch; /* Branch name */ |
| 38 | char *zBgClr; /* Background Color */ |
| 39 | char zUuid[17]; /* Check-in for file ID */ |
| 40 | |
| 41 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 42 | GraphRow *pPrev; /* Previous row */ |
| 43 | |
| 44 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| @@ -175,10 +176,11 @@ | |
| 176 | int rid, /* RID for the check-in */ |
| 177 | int nParent, /* Number of parents */ |
| 178 | int *aParent, /* Array of parents */ |
| 179 | const char *zBranch, /* Branch for this check-in */ |
| 180 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 181 | const char *zUuid, /* SHA1 hash of the object being graphed */ |
| 182 | int isLeaf /* True if this row is a leaf */ |
| 183 | ){ |
| 184 | GraphRow *pRow; |
| 185 | int nByte; |
| 186 | |
| @@ -188,10 +190,12 @@ | |
| 190 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 191 | pRow->aParent = (int*)&pRow[1]; |
| 192 | pRow->rid = rid; |
| 193 | pRow->nParent = nParent; |
| 194 | pRow->zBranch = persistBranchName(p, zBranch); |
| 195 | if( zUuid==0 ) zUuid = ""; |
| 196 | sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid); |
| 197 | pRow->isLeaf = isLeaf; |
| 198 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| 199 | if( zBgClr==0 || zBgClr[0]==0 ) zBgClr = "white"; |
| 200 | pRow->zBgClr = persistBranchName(p, zBgClr); |
| 201 | memcpy(pRow->aParent, aParent, sizeof(aParent[0])*nParent); |
| 202 |
+5
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -372,11 +372,15 @@ | ||
| 372 | 372 | WCHAR buf[MAX_PATH]; |
| 373 | 373 | #endif |
| 374 | 374 | |
| 375 | 375 | g.argc = argc; |
| 376 | 376 | g.argv = argv; |
| 377 | +#if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) | |
| 378 | + for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); | |
| 379 | +#else | |
| 377 | 380 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 381 | +#endif | |
| 378 | 382 | #if defined(_WIN32) |
| 379 | 383 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 380 | 384 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 381 | 385 | #else |
| 382 | 386 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | ||
| 454 | 458 | |
| 455 | 459 | |
| 456 | 460 | /* |
| 457 | 461 | ** This procedure runs first. |
| 458 | 462 | */ |
| 459 | -#ifdef _WIN32 | |
| 463 | +#if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) | |
| 460 | 464 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 461 | 465 | int wmain(int argc, wchar_t **argv) |
| 462 | 466 | #else |
| 463 | 467 | int main(int argc, char **argv) |
| 464 | 468 | #endif |
| 465 | 469 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -372,11 +372,15 @@ | |
| 372 | WCHAR buf[MAX_PATH]; |
| 373 | #endif |
| 374 | |
| 375 | g.argc = argc; |
| 376 | g.argv = argv; |
| 377 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 378 | #if defined(_WIN32) |
| 379 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 380 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 381 | #else |
| 382 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | |
| 454 | |
| 455 | |
| 456 | /* |
| 457 | ** This procedure runs first. |
| 458 | */ |
| 459 | #ifdef _WIN32 |
| 460 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 461 | int wmain(int argc, wchar_t **argv) |
| 462 | #else |
| 463 | int main(int argc, char **argv) |
| 464 | #endif |
| 465 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -372,11 +372,15 @@ | |
| 372 | WCHAR buf[MAX_PATH]; |
| 373 | #endif |
| 374 | |
| 375 | g.argc = argc; |
| 376 | g.argv = argv; |
| 377 | #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| 378 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); |
| 379 | #else |
| 380 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 381 | #endif |
| 382 | #if defined(_WIN32) |
| 383 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 384 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 385 | #else |
| 386 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | |
| 458 | |
| 459 | |
| 460 | /* |
| 461 | ** This procedure runs first. |
| 462 | */ |
| 463 | #if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) |
| 464 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 465 | int wmain(int argc, wchar_t **argv) |
| 466 | #else |
| 467 | int main(int argc, char **argv) |
| 468 | #endif |
| 469 |
+5
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -372,11 +372,15 @@ | ||
| 372 | 372 | WCHAR buf[MAX_PATH]; |
| 373 | 373 | #endif |
| 374 | 374 | |
| 375 | 375 | g.argc = argc; |
| 376 | 376 | g.argv = argv; |
| 377 | +#if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) | |
| 378 | + for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); | |
| 379 | +#else | |
| 377 | 380 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 381 | +#endif | |
| 378 | 382 | #if defined(_WIN32) |
| 379 | 383 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 380 | 384 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 381 | 385 | #else |
| 382 | 386 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | ||
| 454 | 458 | |
| 455 | 459 | |
| 456 | 460 | /* |
| 457 | 461 | ** This procedure runs first. |
| 458 | 462 | */ |
| 459 | -#ifdef _WIN32 | |
| 463 | +#if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) | |
| 460 | 464 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 461 | 465 | int wmain(int argc, wchar_t **argv) |
| 462 | 466 | #else |
| 463 | 467 | int main(int argc, char **argv) |
| 464 | 468 | #endif |
| 465 | 469 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -372,11 +372,15 @@ | |
| 372 | WCHAR buf[MAX_PATH]; |
| 373 | #endif |
| 374 | |
| 375 | g.argc = argc; |
| 376 | g.argv = argv; |
| 377 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 378 | #if defined(_WIN32) |
| 379 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 380 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 381 | #else |
| 382 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | |
| 454 | |
| 455 | |
| 456 | /* |
| 457 | ** This procedure runs first. |
| 458 | */ |
| 459 | #ifdef _WIN32 |
| 460 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 461 | int wmain(int argc, wchar_t **argv) |
| 462 | #else |
| 463 | int main(int argc, char **argv) |
| 464 | #endif |
| 465 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -372,11 +372,15 @@ | |
| 372 | WCHAR buf[MAX_PATH]; |
| 373 | #endif |
| 374 | |
| 375 | g.argc = argc; |
| 376 | g.argv = argv; |
| 377 | #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| 378 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); |
| 379 | #else |
| 380 | for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); |
| 381 | #endif |
| 382 | #if defined(_WIN32) |
| 383 | GetModuleFileNameW(NULL, buf, MAX_PATH); |
| 384 | g.nameOfExe = fossil_filename_to_utf8(buf); |
| 385 | #else |
| 386 | g.nameOfExe = g.argv[0]; |
| @@ -454,11 +458,11 @@ | |
| 458 | |
| 459 | |
| 460 | /* |
| 461 | ** This procedure runs first. |
| 462 | */ |
| 463 | #if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) |
| 464 | int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ |
| 465 | int wmain(int argc, wchar_t **argv) |
| 466 | #else |
| 467 | int main(int argc, char **argv) |
| 468 | #endif |
| 469 |
+67
-4
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -694,11 +694,11 @@ | ||
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | /* The first time this routine is called, output a table header |
| 698 | 698 | */ |
| 699 | - @ <tr> | |
| 699 | + @ <thead><tr> | |
| 700 | 700 | zTid = 0; |
| 701 | 701 | for(i=0; i<nArg; i++){ |
| 702 | 702 | char *zName = azName[i]; |
| 703 | 703 | if( i==pState->iBg ) continue; |
| 704 | 704 | if( pState->iNewRow>=0 && i>=pState->iNewRow ){ |
| @@ -716,11 +716,11 @@ | ||
| 716 | 716 | } |
| 717 | 717 | } |
| 718 | 718 | if( g.perm.Write && zTid ){ |
| 719 | 719 | @ <th> </th> |
| 720 | 720 | } |
| 721 | - @ </tr> | |
| 721 | + @ </tr></thead><tbody> | |
| 722 | 722 | } |
| 723 | 723 | if( azArg==0 ){ |
| 724 | 724 | @ <tr><td colspan="%d(pState->nCol)"> |
| 725 | 725 | @ <i>No records match the report criteria</i> |
| 726 | 726 | @ </td></tr> |
| @@ -914,10 +914,71 @@ | ||
| 914 | 914 | rc = sqlite3_finalize(pStmt); |
| 915 | 915 | fossil_free(azVals); |
| 916 | 916 | return rc; |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | +/* | |
| 920 | +** Output Javascript code that will enables sorting of the table with | |
| 921 | +** the id zTableId by clicking. | |
| 922 | +** | |
| 923 | +** The javascript is derived from: | |
| 924 | +** | |
| 925 | +** http://www.webtoolkit.info/sortable-html-table.html | |
| 926 | +** | |
| 927 | +*/ | |
| 928 | +static void output_table_sorting_javascript(const char *zTableId){ | |
| 929 | + @ <script> | |
| 930 | + @ function SortableTable(tableEl){ | |
| 931 | + @ this.tbody = tableEl.getElementsByTagName('tbody'); | |
| 932 | + @ this.sort = function (cell) { | |
| 933 | + @ var column = cell.cellIndex; | |
| 934 | + @ this.sortIndex = column; | |
| 935 | + @ var newRows = new Array(); | |
| 936 | + @ for (j = 0; j < this.tbody[0].rows.length; j++) { | |
| 937 | + @ newRows[j] = this.tbody[0].rows[j]; | |
| 938 | + @ } | |
| 939 | + @ newRows.sort(this.sortText); | |
| 940 | + @ if (cell.getAttribute("sortdir") == 'down') { | |
| 941 | + @ newRows.reverse(); | |
| 942 | + @ cell.setAttribute('sortdir','up'); | |
| 943 | + @ } else { | |
| 944 | + @ cell.setAttribute('sortdir','down'); | |
| 945 | + @ } | |
| 946 | + @ for (i=0;i<newRows.length;i++) { | |
| 947 | + @ this.tbody[0].appendChild(newRows[i]); | |
| 948 | + @ } | |
| 949 | + @ } | |
| 950 | + @ this.sortText = function(a,b) { | |
| 951 | + @ var i = thisObject.sortIndex; | |
| 952 | + @ aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); | |
| 953 | + @ bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); | |
| 954 | + @ if(aa==bb) return 0; | |
| 955 | + @ if(aa<bb) return -1; | |
| 956 | + @ return 1; | |
| 957 | + @ } | |
| 958 | + @ var thisObject = this; | |
| 959 | + @ var x = tableEl.getElementsByTagName('thead'); | |
| 960 | + @ if(!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length>0)){ | |
| 961 | + @ return; | |
| 962 | + @ } | |
| 963 | + @ if(x && x[0].rows && x[0].rows.length > 0) { | |
| 964 | + @ var sortRow = x[0].rows[0]; | |
| 965 | + @ } else { | |
| 966 | + @ return; | |
| 967 | + @ } | |
| 968 | + @ for (var i=0; i<sortRow.cells.length; i++) { | |
| 969 | + @ sortRow.cells[i].sTable = this; | |
| 970 | + @ sortRow.cells[i].onclick = function () { | |
| 971 | + @ this.sTable.sort(this); | |
| 972 | + @ return false; | |
| 973 | + @ } | |
| 974 | + @ } | |
| 975 | + @ } | |
| 976 | + @ var t = new SortableTable(gebi("%s(zTableId)")); | |
| 977 | + @ </script> | |
| 978 | +} | |
| 979 | + | |
| 919 | 980 | |
| 920 | 981 | /* |
| 921 | 982 | ** WEBPAGE: /rptview |
| 922 | 983 | ** |
| 923 | 984 | ** Generate a report. The rn query parameter is the report number |
| @@ -992,22 +1053,24 @@ | ||
| 992 | 1053 | "%s/tktnew", g.zTop); |
| 993 | 1054 | } |
| 994 | 1055 | style_header(zTitle); |
| 995 | 1056 | output_color_key(zClrKey, 1, |
| 996 | 1057 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 997 | - @ <table border="1" cellpadding="2" cellspacing="0" class="report"> | |
| 1058 | + @ <table border="1" cellpadding="2" cellspacing="0" class="report" | |
| 1059 | + @ id="reportTable"> | |
| 998 | 1060 | sState.rn = rn; |
| 999 | 1061 | sState.nCount = 0; |
| 1000 | 1062 | report_restrict_sql(&zErr1); |
| 1001 | 1063 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 1002 | 1064 | report_unrestrict_sql(); |
| 1003 | - @ </table> | |
| 1065 | + @ </tbody></table> | |
| 1004 | 1066 | if( zErr1 ){ |
| 1005 | 1067 | @ <p class="reportError">Error: %h(zErr1)</p> |
| 1006 | 1068 | }else if( zErr2 ){ |
| 1007 | 1069 | @ <p class="reportError">Error: %h(zErr2)</p> |
| 1008 | 1070 | } |
| 1071 | + output_table_sorting_javascript("reportTable"); | |
| 1009 | 1072 | style_footer(); |
| 1010 | 1073 | }else{ |
| 1011 | 1074 | report_restrict_sql(&zErr1); |
| 1012 | 1075 | sqlite3_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2); |
| 1013 | 1076 | report_unrestrict_sql(); |
| 1014 | 1077 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -694,11 +694,11 @@ | |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | /* The first time this routine is called, output a table header |
| 698 | */ |
| 699 | @ <tr> |
| 700 | zTid = 0; |
| 701 | for(i=0; i<nArg; i++){ |
| 702 | char *zName = azName[i]; |
| 703 | if( i==pState->iBg ) continue; |
| 704 | if( pState->iNewRow>=0 && i>=pState->iNewRow ){ |
| @@ -716,11 +716,11 @@ | |
| 716 | } |
| 717 | } |
| 718 | if( g.perm.Write && zTid ){ |
| 719 | @ <th> </th> |
| 720 | } |
| 721 | @ </tr> |
| 722 | } |
| 723 | if( azArg==0 ){ |
| 724 | @ <tr><td colspan="%d(pState->nCol)"> |
| 725 | @ <i>No records match the report criteria</i> |
| 726 | @ </td></tr> |
| @@ -914,10 +914,71 @@ | |
| 914 | rc = sqlite3_finalize(pStmt); |
| 915 | fossil_free(azVals); |
| 916 | return rc; |
| 917 | } |
| 918 | |
| 919 | |
| 920 | /* |
| 921 | ** WEBPAGE: /rptview |
| 922 | ** |
| 923 | ** Generate a report. The rn query parameter is the report number |
| @@ -992,22 +1053,24 @@ | |
| 992 | "%s/tktnew", g.zTop); |
| 993 | } |
| 994 | style_header(zTitle); |
| 995 | output_color_key(zClrKey, 1, |
| 996 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 997 | @ <table border="1" cellpadding="2" cellspacing="0" class="report"> |
| 998 | sState.rn = rn; |
| 999 | sState.nCount = 0; |
| 1000 | report_restrict_sql(&zErr1); |
| 1001 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 1002 | report_unrestrict_sql(); |
| 1003 | @ </table> |
| 1004 | if( zErr1 ){ |
| 1005 | @ <p class="reportError">Error: %h(zErr1)</p> |
| 1006 | }else if( zErr2 ){ |
| 1007 | @ <p class="reportError">Error: %h(zErr2)</p> |
| 1008 | } |
| 1009 | style_footer(); |
| 1010 | }else{ |
| 1011 | report_restrict_sql(&zErr1); |
| 1012 | sqlite3_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2); |
| 1013 | report_unrestrict_sql(); |
| 1014 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -694,11 +694,11 @@ | |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | /* The first time this routine is called, output a table header |
| 698 | */ |
| 699 | @ <thead><tr> |
| 700 | zTid = 0; |
| 701 | for(i=0; i<nArg; i++){ |
| 702 | char *zName = azName[i]; |
| 703 | if( i==pState->iBg ) continue; |
| 704 | if( pState->iNewRow>=0 && i>=pState->iNewRow ){ |
| @@ -716,11 +716,11 @@ | |
| 716 | } |
| 717 | } |
| 718 | if( g.perm.Write && zTid ){ |
| 719 | @ <th> </th> |
| 720 | } |
| 721 | @ </tr></thead><tbody> |
| 722 | } |
| 723 | if( azArg==0 ){ |
| 724 | @ <tr><td colspan="%d(pState->nCol)"> |
| 725 | @ <i>No records match the report criteria</i> |
| 726 | @ </td></tr> |
| @@ -914,10 +914,71 @@ | |
| 914 | rc = sqlite3_finalize(pStmt); |
| 915 | fossil_free(azVals); |
| 916 | return rc; |
| 917 | } |
| 918 | |
| 919 | /* |
| 920 | ** Output Javascript code that will enables sorting of the table with |
| 921 | ** the id zTableId by clicking. |
| 922 | ** |
| 923 | ** The javascript is derived from: |
| 924 | ** |
| 925 | ** http://www.webtoolkit.info/sortable-html-table.html |
| 926 | ** |
| 927 | */ |
| 928 | static void output_table_sorting_javascript(const char *zTableId){ |
| 929 | @ <script> |
| 930 | @ function SortableTable(tableEl){ |
| 931 | @ this.tbody = tableEl.getElementsByTagName('tbody'); |
| 932 | @ this.sort = function (cell) { |
| 933 | @ var column = cell.cellIndex; |
| 934 | @ this.sortIndex = column; |
| 935 | @ var newRows = new Array(); |
| 936 | @ for (j = 0; j < this.tbody[0].rows.length; j++) { |
| 937 | @ newRows[j] = this.tbody[0].rows[j]; |
| 938 | @ } |
| 939 | @ newRows.sort(this.sortText); |
| 940 | @ if (cell.getAttribute("sortdir") == 'down') { |
| 941 | @ newRows.reverse(); |
| 942 | @ cell.setAttribute('sortdir','up'); |
| 943 | @ } else { |
| 944 | @ cell.setAttribute('sortdir','down'); |
| 945 | @ } |
| 946 | @ for (i=0;i<newRows.length;i++) { |
| 947 | @ this.tbody[0].appendChild(newRows[i]); |
| 948 | @ } |
| 949 | @ } |
| 950 | @ this.sortText = function(a,b) { |
| 951 | @ var i = thisObject.sortIndex; |
| 952 | @ aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 953 | @ bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 954 | @ if(aa==bb) return 0; |
| 955 | @ if(aa<bb) return -1; |
| 956 | @ return 1; |
| 957 | @ } |
| 958 | @ var thisObject = this; |
| 959 | @ var x = tableEl.getElementsByTagName('thead'); |
| 960 | @ if(!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length>0)){ |
| 961 | @ return; |
| 962 | @ } |
| 963 | @ if(x && x[0].rows && x[0].rows.length > 0) { |
| 964 | @ var sortRow = x[0].rows[0]; |
| 965 | @ } else { |
| 966 | @ return; |
| 967 | @ } |
| 968 | @ for (var i=0; i<sortRow.cells.length; i++) { |
| 969 | @ sortRow.cells[i].sTable = this; |
| 970 | @ sortRow.cells[i].onclick = function () { |
| 971 | @ this.sTable.sort(this); |
| 972 | @ return false; |
| 973 | @ } |
| 974 | @ } |
| 975 | @ } |
| 976 | @ var t = new SortableTable(gebi("%s(zTableId)")); |
| 977 | @ </script> |
| 978 | } |
| 979 | |
| 980 | |
| 981 | /* |
| 982 | ** WEBPAGE: /rptview |
| 983 | ** |
| 984 | ** Generate a report. The rn query parameter is the report number |
| @@ -992,22 +1053,24 @@ | |
| 1053 | "%s/tktnew", g.zTop); |
| 1054 | } |
| 1055 | style_header(zTitle); |
| 1056 | output_color_key(zClrKey, 1, |
| 1057 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 1058 | @ <table border="1" cellpadding="2" cellspacing="0" class="report" |
| 1059 | @ id="reportTable"> |
| 1060 | sState.rn = rn; |
| 1061 | sState.nCount = 0; |
| 1062 | report_restrict_sql(&zErr1); |
| 1063 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 1064 | report_unrestrict_sql(); |
| 1065 | @ </tbody></table> |
| 1066 | if( zErr1 ){ |
| 1067 | @ <p class="reportError">Error: %h(zErr1)</p> |
| 1068 | }else if( zErr2 ){ |
| 1069 | @ <p class="reportError">Error: %h(zErr2)</p> |
| 1070 | } |
| 1071 | output_table_sorting_javascript("reportTable"); |
| 1072 | style_footer(); |
| 1073 | }else{ |
| 1074 | report_restrict_sql(&zErr1); |
| 1075 | sqlite3_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2); |
| 1076 | report_unrestrict_sql(); |
| 1077 |
+2
-7
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -852,24 +852,19 @@ | ||
| 852 | 852 | @ vertical-align: top; |
| 853 | 853 | @ text-align: right; |
| 854 | 854 | @ padding: 0.2ex 2ex; |
| 855 | 855 | @ } |
| 856 | 856 | @ |
| 857 | -@ | |
| 858 | -@ table.report { | |
| 859 | -@ border-collapse:collapse; | |
| 860 | -@ border: 1px solid #999; | |
| 861 | -@ margin: 1em 0 1em 0; | |
| 862 | -@ } | |
| 863 | -@ | |
| 864 | 857 | @ table.report tr th { |
| 865 | 858 | @ padding: 3px 5px; |
| 866 | 859 | @ text-transform: capitalize; |
| 860 | +@ cursor: pointer; | |
| 867 | 861 | @ } |
| 868 | 862 | @ |
| 869 | 863 | @ table.report tr td { |
| 870 | 864 | @ padding: 3px 5px; |
| 865 | +@ cursor: pointer; | |
| 871 | 866 | @ } |
| 872 | 867 | @ |
| 873 | 868 | @ textarea { |
| 874 | 869 | @ font-size: 1em; |
| 875 | 870 | @ }'); |
| 876 | 871 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -852,24 +852,19 @@ | |
| 852 | @ vertical-align: top; |
| 853 | @ text-align: right; |
| 854 | @ padding: 0.2ex 2ex; |
| 855 | @ } |
| 856 | @ |
| 857 | @ |
| 858 | @ table.report { |
| 859 | @ border-collapse:collapse; |
| 860 | @ border: 1px solid #999; |
| 861 | @ margin: 1em 0 1em 0; |
| 862 | @ } |
| 863 | @ |
| 864 | @ table.report tr th { |
| 865 | @ padding: 3px 5px; |
| 866 | @ text-transform: capitalize; |
| 867 | @ } |
| 868 | @ |
| 869 | @ table.report tr td { |
| 870 | @ padding: 3px 5px; |
| 871 | @ } |
| 872 | @ |
| 873 | @ textarea { |
| 874 | @ font-size: 1em; |
| 875 | @ }'); |
| 876 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -852,24 +852,19 @@ | |
| 852 | @ vertical-align: top; |
| 853 | @ text-align: right; |
| 854 | @ padding: 0.2ex 2ex; |
| 855 | @ } |
| 856 | @ |
| 857 | @ table.report tr th { |
| 858 | @ padding: 3px 5px; |
| 859 | @ text-transform: capitalize; |
| 860 | @ cursor: pointer; |
| 861 | @ } |
| 862 | @ |
| 863 | @ table.report tr td { |
| 864 | @ padding: 3px 5px; |
| 865 | @ cursor: pointer; |
| 866 | @ } |
| 867 | @ |
| 868 | @ textarea { |
| 869 | @ font-size: 1em; |
| 870 | @ }'); |
| 871 |
+7
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -867,10 +867,17 @@ | ||
| 867 | 867 | @ width: 125px; |
| 868 | 868 | @ text-align: center; |
| 869 | 869 | @ border-collapse: collapse; |
| 870 | 870 | @ border-spacing: 0; |
| 871 | 871 | }, |
| 872 | + { "table.report", | |
| 873 | + "Ticket report table formatting", | |
| 874 | + @ border-collapse:collapse; | |
| 875 | + @ border: 1px solid #999; | |
| 876 | + @ margin: 1em 0 1em 0; | |
| 877 | + @ cursor: pointer; | |
| 878 | + }, | |
| 872 | 879 | { "td.rpteditex", |
| 873 | 880 | "format for example table cells on the report edit page", |
| 874 | 881 | @ border-width: thin; |
| 875 | 882 | @ border-color: #000000; |
| 876 | 883 | @ border-style: solid; |
| 877 | 884 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -867,10 +867,17 @@ | |
| 867 | @ width: 125px; |
| 868 | @ text-align: center; |
| 869 | @ border-collapse: collapse; |
| 870 | @ border-spacing: 0; |
| 871 | }, |
| 872 | { "td.rpteditex", |
| 873 | "format for example table cells on the report edit page", |
| 874 | @ border-width: thin; |
| 875 | @ border-color: #000000; |
| 876 | @ border-style: solid; |
| 877 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -867,10 +867,17 @@ | |
| 867 | @ width: 125px; |
| 868 | @ text-align: center; |
| 869 | @ border-collapse: collapse; |
| 870 | @ border-spacing: 0; |
| 871 | }, |
| 872 | { "table.report", |
| 873 | "Ticket report table formatting", |
| 874 | @ border-collapse:collapse; |
| 875 | @ border: 1px solid #999; |
| 876 | @ margin: 1em 0 1em 0; |
| 877 | @ cursor: pointer; |
| 878 | }, |
| 879 | { "td.rpteditex", |
| 880 | "format for example table cells on the report edit page", |
| 881 | @ border-width: thin; |
| 882 | @ border-color: #000000; |
| 883 | @ border-style: solid; |
| 884 |
+46
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -211,11 +211,12 @@ | ||
| 211 | 211 | if( tmFlags & TIMELINE_GRAPH ){ |
| 212 | 212 | pGraph = graph_init(); |
| 213 | 213 | /* style is not moved to css, because this is |
| 214 | 214 | ** a technical div for the timeline graph |
| 215 | 215 | */ |
| 216 | - @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> | |
| 216 | + @ <div id="canvas" style="position:relative;width:1px;height:1px;" | |
| 217 | + @ onclick="clickOnGraph(event)"></div> | |
| 217 | 218 | } |
| 218 | 219 | db_static_prepare(&qbranch, |
| 219 | 220 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid", |
| 220 | 221 | TAG_BRANCH |
| 221 | 222 | ); |
| @@ -311,11 +312,12 @@ | ||
| 311 | 312 | db_bind_int(&qparent, ":rid", rid); |
| 312 | 313 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 313 | 314 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 314 | 315 | } |
| 315 | 316 | db_reset(&qparent); |
| 316 | - gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, isLeaf); | |
| 317 | + gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, | |
| 318 | + zUuid, isLeaf); | |
| 317 | 319 | db_reset(&qbranch); |
| 318 | 320 | @ <div id="m%d(gidx)"></div> |
| 319 | 321 | } |
| 320 | 322 | @</td> |
| 321 | 323 | if( zBgClr && zBgClr[0] ){ |
| @@ -491,18 +493,22 @@ | ||
| 491 | 493 | @ </td><td></td></tr> |
| 492 | 494 | } |
| 493 | 495 | } |
| 494 | 496 | @ </table> |
| 495 | 497 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 496 | - timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0); | |
| 498 | + timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0); | |
| 497 | 499 | } |
| 498 | 500 | |
| 499 | 501 | /* |
| 500 | 502 | ** Generate all of the necessary javascript to generate a timeline |
| 501 | 503 | ** graph. |
| 502 | 504 | */ |
| 503 | -void timeline_output_graph_javascript(GraphContext *pGraph, int omitDescenders){ | |
| 505 | +void timeline_output_graph_javascript( | |
| 506 | + GraphContext *pGraph, /* The graph to be displayed */ | |
| 507 | + int omitDescenders, /* True to omit descenders */ | |
| 508 | + int fileDiff /* True for file diff. False for check-in diff */ | |
| 509 | +){ | |
| 504 | 510 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 505 | 511 | GraphRow *pRow; |
| 506 | 512 | int i; |
| 507 | 513 | char cSep; |
| 508 | 514 | @ <script type="text/JavaScript"> |
| @@ -535,10 +541,11 @@ | ||
| 535 | 541 | ** mi: "merge-in". An array of integer x-coordinates from which |
| 536 | 542 | ** merge arrows should be drawn into this node. If the value is |
| 537 | 543 | ** negative, then the x-coordinate is the absolute value of mi[] |
| 538 | 544 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 539 | 545 | ** the screen. |
| 546 | + ** h: The SHA1 hash of the object being graphed | |
| 540 | 547 | */ |
| 541 | 548 | cgi_printf("var rowinfo = [\n"); |
| 542 | 549 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 543 | 550 | int mo = pRow->mergeOut; |
| 544 | 551 | if( mo<0 ){ |
| @@ -576,11 +583,11 @@ | ||
| 576 | 583 | cgi_printf("%c%d", cSep, mi); |
| 577 | 584 | cSep = ','; |
| 578 | 585 | } |
| 579 | 586 | } |
| 580 | 587 | if( cSep=='[' ) cgi_printf("["); |
| 581 | - cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n"); | |
| 588 | + cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n"); | |
| 582 | 589 | } |
| 583 | 590 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 584 | 591 | graph_free(pGraph); |
| 585 | 592 | @ var canvasDiv = gebi("canvas"); |
| 586 | 593 | #if 0 |
| @@ -598,10 +605,11 @@ | ||
| 598 | 605 | @ n.style.top = y0+"px"; |
| 599 | 606 | @ n.style.width = w+"px"; |
| 600 | 607 | @ n.style.height = h+"px"; |
| 601 | 608 | @ n.style.backgroundColor = color; |
| 602 | 609 | @ canvasDiv.appendChild(n); |
| 610 | + @ return n; | |
| 603 | 611 | @ } |
| 604 | 612 | @ function absoluteY(id){ |
| 605 | 613 | @ var obj = gebi(id); |
| 606 | 614 | @ if( !obj ) return; |
| 607 | 615 | @ var top = 0; |
| @@ -699,10 +707,12 @@ | ||
| 699 | 707 | @ }else{ |
| 700 | 708 | @ drawThinArrow(y0,mx,p.x-5); |
| 701 | 709 | @ } |
| 702 | 710 | @ } |
| 703 | 711 | @ } |
| 712 | + @ var selBox = null; | |
| 713 | + @ var selRow = null; | |
| 704 | 714 | @ function renderGraph(){ |
| 705 | 715 | @ var canvasDiv = gebi("canvas"); |
| 706 | 716 | @ while( canvasDiv.hasChildNodes() ){ |
| 707 | 717 | @ canvasDiv.removeChild(canvasDiv.firstChild); |
| 708 | 718 | @ } |
| @@ -736,10 +746,41 @@ | ||
| 736 | 746 | @ }; |
| 737 | 747 | @ } |
| 738 | 748 | #endif |
| 739 | 749 | @ for(var i in rowinfo){ |
| 740 | 750 | @ drawNode(rowinfo[i], left, btm); |
| 751 | + @ } | |
| 752 | + @ if( selRow!=null ) clickOnRow(selRow); | |
| 753 | + @ } | |
| 754 | + @ function clickOnGraph(event){ | |
| 755 | + @ var x=event.clientX-absoluteX("canvas")+window.pageXOffset; | |
| 756 | + @ var y=event.clientY-absoluteY("canvas")+window.pageYOffset; | |
| 757 | + @ for(var i in rowinfo){ | |
| 758 | + @ p = rowinfo[i]; | |
| 759 | + @ if( p.y<y-10 ) continue; | |
| 760 | + @ if( p.y>y+10 ) break; | |
| 761 | + @ if( p.x>x-10 && p.x<x+10 ){ | |
| 762 | + @ clickOnRow(p); | |
| 763 | + @ break; | |
| 764 | + @ } | |
| 765 | + @ } | |
| 766 | + @ } | |
| 767 | + @ function clickOnRow(p){ | |
| 768 | + @ if( selRow==null ){ | |
| 769 | + @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3); | |
| 770 | + @ selRow = p; | |
| 771 | + @ }else if( selRow==p ){ | |
| 772 | + @ var canvasDiv = gebi("canvas"); | |
| 773 | + @ canvasDiv.removeChild(selBox); | |
| 774 | + @ selBox = null; | |
| 775 | + @ selRow = null; | |
| 776 | + @ }else{ | |
| 777 | + if( fileDiff ){ | |
| 778 | + @ location.href="%R/fdiff?v1="+selRow.h+"&v2="+p.h; | |
| 779 | + }else{ | |
| 780 | + @ location.href="%R/vdiff?from="+selRow.h+"&to="+p.h; | |
| 781 | + } | |
| 741 | 782 | @ } |
| 742 | 783 | @ } |
| 743 | 784 | @ var lastId = "m"+rowinfo[rowinfo.length-1].id; |
| 744 | 785 | @ var lastY = 0; |
| 745 | 786 | @ function checkHeight(){ |
| 746 | 787 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -211,11 +211,12 @@ | |
| 211 | if( tmFlags & TIMELINE_GRAPH ){ |
| 212 | pGraph = graph_init(); |
| 213 | /* style is not moved to css, because this is |
| 214 | ** a technical div for the timeline graph |
| 215 | */ |
| 216 | @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div> |
| 217 | } |
| 218 | db_static_prepare(&qbranch, |
| 219 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid", |
| 220 | TAG_BRANCH |
| 221 | ); |
| @@ -311,11 +312,12 @@ | |
| 311 | db_bind_int(&qparent, ":rid", rid); |
| 312 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 313 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 314 | } |
| 315 | db_reset(&qparent); |
| 316 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, isLeaf); |
| 317 | db_reset(&qbranch); |
| 318 | @ <div id="m%d(gidx)"></div> |
| 319 | } |
| 320 | @</td> |
| 321 | if( zBgClr && zBgClr[0] ){ |
| @@ -491,18 +493,22 @@ | |
| 491 | @ </td><td></td></tr> |
| 492 | } |
| 493 | } |
| 494 | @ </table> |
| 495 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 496 | timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0); |
| 497 | } |
| 498 | |
| 499 | /* |
| 500 | ** Generate all of the necessary javascript to generate a timeline |
| 501 | ** graph. |
| 502 | */ |
| 503 | void timeline_output_graph_javascript(GraphContext *pGraph, int omitDescenders){ |
| 504 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 505 | GraphRow *pRow; |
| 506 | int i; |
| 507 | char cSep; |
| 508 | @ <script type="text/JavaScript"> |
| @@ -535,10 +541,11 @@ | |
| 535 | ** mi: "merge-in". An array of integer x-coordinates from which |
| 536 | ** merge arrows should be drawn into this node. If the value is |
| 537 | ** negative, then the x-coordinate is the absolute value of mi[] |
| 538 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 539 | ** the screen. |
| 540 | */ |
| 541 | cgi_printf("var rowinfo = [\n"); |
| 542 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 543 | int mo = pRow->mergeOut; |
| 544 | if( mo<0 ){ |
| @@ -576,11 +583,11 @@ | |
| 576 | cgi_printf("%c%d", cSep, mi); |
| 577 | cSep = ','; |
| 578 | } |
| 579 | } |
| 580 | if( cSep=='[' ) cgi_printf("["); |
| 581 | cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n"); |
| 582 | } |
| 583 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 584 | graph_free(pGraph); |
| 585 | @ var canvasDiv = gebi("canvas"); |
| 586 | #if 0 |
| @@ -598,10 +605,11 @@ | |
| 598 | @ n.style.top = y0+"px"; |
| 599 | @ n.style.width = w+"px"; |
| 600 | @ n.style.height = h+"px"; |
| 601 | @ n.style.backgroundColor = color; |
| 602 | @ canvasDiv.appendChild(n); |
| 603 | @ } |
| 604 | @ function absoluteY(id){ |
| 605 | @ var obj = gebi(id); |
| 606 | @ if( !obj ) return; |
| 607 | @ var top = 0; |
| @@ -699,10 +707,12 @@ | |
| 699 | @ }else{ |
| 700 | @ drawThinArrow(y0,mx,p.x-5); |
| 701 | @ } |
| 702 | @ } |
| 703 | @ } |
| 704 | @ function renderGraph(){ |
| 705 | @ var canvasDiv = gebi("canvas"); |
| 706 | @ while( canvasDiv.hasChildNodes() ){ |
| 707 | @ canvasDiv.removeChild(canvasDiv.firstChild); |
| 708 | @ } |
| @@ -736,10 +746,41 @@ | |
| 736 | @ }; |
| 737 | @ } |
| 738 | #endif |
| 739 | @ for(var i in rowinfo){ |
| 740 | @ drawNode(rowinfo[i], left, btm); |
| 741 | @ } |
| 742 | @ } |
| 743 | @ var lastId = "m"+rowinfo[rowinfo.length-1].id; |
| 744 | @ var lastY = 0; |
| 745 | @ function checkHeight(){ |
| 746 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -211,11 +211,12 @@ | |
| 211 | if( tmFlags & TIMELINE_GRAPH ){ |
| 212 | pGraph = graph_init(); |
| 213 | /* style is not moved to css, because this is |
| 214 | ** a technical div for the timeline graph |
| 215 | */ |
| 216 | @ <div id="canvas" style="position:relative;width:1px;height:1px;" |
| 217 | @ onclick="clickOnGraph(event)"></div> |
| 218 | } |
| 219 | db_static_prepare(&qbranch, |
| 220 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid", |
| 221 | TAG_BRANCH |
| 222 | ); |
| @@ -311,11 +312,12 @@ | |
| 312 | db_bind_int(&qparent, ":rid", rid); |
| 313 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 314 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 315 | } |
| 316 | db_reset(&qparent); |
| 317 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 318 | zUuid, isLeaf); |
| 319 | db_reset(&qbranch); |
| 320 | @ <div id="m%d(gidx)"></div> |
| 321 | } |
| 322 | @</td> |
| 323 | if( zBgClr && zBgClr[0] ){ |
| @@ -491,18 +493,22 @@ | |
| 493 | @ </td><td></td></tr> |
| 494 | } |
| 495 | } |
| 496 | @ </table> |
| 497 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 498 | timeline_output_graph_javascript(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0, 0); |
| 499 | } |
| 500 | |
| 501 | /* |
| 502 | ** Generate all of the necessary javascript to generate a timeline |
| 503 | ** graph. |
| 504 | */ |
| 505 | void timeline_output_graph_javascript( |
| 506 | GraphContext *pGraph, /* The graph to be displayed */ |
| 507 | int omitDescenders, /* True to omit descenders */ |
| 508 | int fileDiff /* True for file diff. False for check-in diff */ |
| 509 | ){ |
| 510 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 511 | GraphRow *pRow; |
| 512 | int i; |
| 513 | char cSep; |
| 514 | @ <script type="text/JavaScript"> |
| @@ -535,10 +541,11 @@ | |
| 541 | ** mi: "merge-in". An array of integer x-coordinates from which |
| 542 | ** merge arrows should be drawn into this node. If the value is |
| 543 | ** negative, then the x-coordinate is the absolute value of mi[] |
| 544 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 545 | ** the screen. |
| 546 | ** h: The SHA1 hash of the object being graphed |
| 547 | */ |
| 548 | cgi_printf("var rowinfo = [\n"); |
| 549 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 550 | int mo = pRow->mergeOut; |
| 551 | if( mo<0 ){ |
| @@ -576,11 +583,11 @@ | |
| 583 | cgi_printf("%c%d", cSep, mi); |
| 584 | cSep = ','; |
| 585 | } |
| 586 | } |
| 587 | if( cSep=='[' ) cgi_printf("["); |
| 588 | cgi_printf("],h:\"%s\"}%s", pRow->zUuid, pRow->pNext ? ",\n" : "];\n"); |
| 589 | } |
| 590 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 591 | graph_free(pGraph); |
| 592 | @ var canvasDiv = gebi("canvas"); |
| 593 | #if 0 |
| @@ -598,10 +605,11 @@ | |
| 605 | @ n.style.top = y0+"px"; |
| 606 | @ n.style.width = w+"px"; |
| 607 | @ n.style.height = h+"px"; |
| 608 | @ n.style.backgroundColor = color; |
| 609 | @ canvasDiv.appendChild(n); |
| 610 | @ return n; |
| 611 | @ } |
| 612 | @ function absoluteY(id){ |
| 613 | @ var obj = gebi(id); |
| 614 | @ if( !obj ) return; |
| 615 | @ var top = 0; |
| @@ -699,10 +707,12 @@ | |
| 707 | @ }else{ |
| 708 | @ drawThinArrow(y0,mx,p.x-5); |
| 709 | @ } |
| 710 | @ } |
| 711 | @ } |
| 712 | @ var selBox = null; |
| 713 | @ var selRow = null; |
| 714 | @ function renderGraph(){ |
| 715 | @ var canvasDiv = gebi("canvas"); |
| 716 | @ while( canvasDiv.hasChildNodes() ){ |
| 717 | @ canvasDiv.removeChild(canvasDiv.firstChild); |
| 718 | @ } |
| @@ -736,10 +746,41 @@ | |
| 746 | @ }; |
| 747 | @ } |
| 748 | #endif |
| 749 | @ for(var i in rowinfo){ |
| 750 | @ drawNode(rowinfo[i], left, btm); |
| 751 | @ } |
| 752 | @ if( selRow!=null ) clickOnRow(selRow); |
| 753 | @ } |
| 754 | @ function clickOnGraph(event){ |
| 755 | @ var x=event.clientX-absoluteX("canvas")+window.pageXOffset; |
| 756 | @ var y=event.clientY-absoluteY("canvas")+window.pageYOffset; |
| 757 | @ for(var i in rowinfo){ |
| 758 | @ p = rowinfo[i]; |
| 759 | @ if( p.y<y-10 ) continue; |
| 760 | @ if( p.y>y+10 ) break; |
| 761 | @ if( p.x>x-10 && p.x<x+10 ){ |
| 762 | @ clickOnRow(p); |
| 763 | @ break; |
| 764 | @ } |
| 765 | @ } |
| 766 | @ } |
| 767 | @ function clickOnRow(p){ |
| 768 | @ if( selRow==null ){ |
| 769 | @ selBox = drawBox("red",p.x-2,p.y-2,p.x+3,p.y+3); |
| 770 | @ selRow = p; |
| 771 | @ }else if( selRow==p ){ |
| 772 | @ var canvasDiv = gebi("canvas"); |
| 773 | @ canvasDiv.removeChild(selBox); |
| 774 | @ selBox = null; |
| 775 | @ selRow = null; |
| 776 | @ }else{ |
| 777 | if( fileDiff ){ |
| 778 | @ location.href="%R/fdiff?v1="+selRow.h+"&v2="+p.h; |
| 779 | }else{ |
| 780 | @ location.href="%R/vdiff?from="+selRow.h+"&to="+p.h; |
| 781 | } |
| 782 | @ } |
| 783 | @ } |
| 784 | @ var lastId = "m"+rowinfo[rowinfo.length-1].id; |
| 785 | @ var lastY = 0; |
| 786 | @ function checkHeight(){ |
| 787 |
+7
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -173,11 +173,17 @@ | ||
| 173 | 173 | endif |
| 174 | 174 | |
| 175 | 175 | #### We add the -static option here so that we can build a static |
| 176 | 176 | # executable that will run in a chroot jail. |
| 177 | 177 | # |
| 178 | -LIB = -static -municode | |
| 178 | +LIB = -static | |
| 179 | + | |
| 180 | +ifeq ($(PREFIX),) | |
| 181 | +TCC += -DBROKEN_MINGW_CMDLINE | |
| 182 | +else | |
| 183 | +LIB += -municode | |
| 184 | +endif | |
| 179 | 185 | |
| 180 | 186 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 181 | 187 | ifdef FOSSIL_ENABLE_SSL |
| 182 | 188 | LIB += -lssl -lcrypto -lgdi32 |
| 183 | 189 | endif |
| 184 | 190 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -173,11 +173,17 @@ | |
| 173 | endif |
| 174 | |
| 175 | #### We add the -static option here so that we can build a static |
| 176 | # executable that will run in a chroot jail. |
| 177 | # |
| 178 | LIB = -static -municode |
| 179 | |
| 180 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 181 | ifdef FOSSIL_ENABLE_SSL |
| 182 | LIB += -lssl -lcrypto -lgdi32 |
| 183 | endif |
| 184 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -173,11 +173,17 @@ | |
| 173 | endif |
| 174 | |
| 175 | #### We add the -static option here so that we can build a static |
| 176 | # executable that will run in a chroot jail. |
| 177 | # |
| 178 | LIB = -static |
| 179 | |
| 180 | ifeq ($(PREFIX),) |
| 181 | TCC += -DBROKEN_MINGW_CMDLINE |
| 182 | else |
| 183 | LIB += -municode |
| 184 | endif |
| 185 | |
| 186 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 187 | ifdef FOSSIL_ENABLE_SSL |
| 188 | LIB += -lssl -lcrypto -lgdi32 |
| 189 | endif |
| 190 |
+7
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -173,11 +173,17 @@ | ||
| 173 | 173 | endif |
| 174 | 174 | |
| 175 | 175 | #### We add the -static option here so that we can build a static |
| 176 | 176 | # executable that will run in a chroot jail. |
| 177 | 177 | # |
| 178 | -LIB = -static -municode | |
| 178 | +LIB = -static | |
| 179 | + | |
| 180 | +ifeq ($(PREFIX),) | |
| 181 | +TCC += -DBROKEN_MINGW_CMDLINE | |
| 182 | +else | |
| 183 | +LIB += -municode | |
| 184 | +endif | |
| 179 | 185 | |
| 180 | 186 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 181 | 187 | ifdef FOSSIL_ENABLE_SSL |
| 182 | 188 | LIB += -lssl -lcrypto -lgdi32 |
| 183 | 189 | endif |
| 184 | 190 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -173,11 +173,17 @@ | |
| 173 | endif |
| 174 | |
| 175 | #### We add the -static option here so that we can build a static |
| 176 | # executable that will run in a chroot jail. |
| 177 | # |
| 178 | LIB = -static -municode |
| 179 | |
| 180 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 181 | ifdef FOSSIL_ENABLE_SSL |
| 182 | LIB += -lssl -lcrypto -lgdi32 |
| 183 | endif |
| 184 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -173,11 +173,17 @@ | |
| 173 | endif |
| 174 | |
| 175 | #### We add the -static option here so that we can build a static |
| 176 | # executable that will run in a chroot jail. |
| 177 | # |
| 178 | LIB = -static |
| 179 | |
| 180 | ifeq ($(PREFIX),) |
| 181 | TCC += -DBROKEN_MINGW_CMDLINE |
| 182 | else |
| 183 | LIB += -municode |
| 184 | endif |
| 185 | |
| 186 | # OpenSSL: Add the necessary libraries required, if enabled. |
| 187 | ifdef FOSSIL_ENABLE_SSL |
| 188 | LIB += -lssl -lcrypto -lgdi32 |
| 189 | endif |
| 190 |