Fossil SCM
Comment improvements in the schema. Attempt to get the /finfo page to show merge arrows.
Commit
7d5a85bba8db9f2398a61fa4709a96651eaa6595
Parent
a241444d8f5225c…
2 files changed
+24
-2
+10
+24
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -303,10 +303,11 @@ | ||
| 303 | 303 | GraphContext *pGraph; |
| 304 | 304 | int brBg = P("brbg")!=0; |
| 305 | 305 | int uBg = P("ubg")!=0; |
| 306 | 306 | int firstChngOnly = atoi(PD("fco","1"))!=0; |
| 307 | 307 | int fDebug = atoi(PD("debug","0")); |
| 308 | + int fShowId = P("showid")!=0; | |
| 308 | 309 | |
| 309 | 310 | login_check_credentials(); |
| 310 | 311 | if( !g.perm.Read ){ login_needed(); return; } |
| 311 | 312 | style_header("File History"); |
| 312 | 313 | login_anonymous_available(); |
| @@ -422,17 +423,31 @@ | ||
| 422 | 423 | const char *zBr = db_column_text(&q, 9); |
| 423 | 424 | int fmid = db_column_int(&q, 10); |
| 424 | 425 | int pfnid = db_column_int(&q, 11); |
| 425 | 426 | int gidx; |
| 426 | 427 | char zTime[10]; |
| 428 | + int nParent = 0; | |
| 429 | + int aParent[32]; | |
| 430 | + static Stmt qparent; | |
| 431 | + db_static_prepare(&qparent, | |
| 432 | + "SELECT DISTINCT pid FROM mlink" | |
| 433 | + " WHERE fid=:fid AND mid=:mid" | |
| 434 | + " ORDER BY isaux /*sort*/" | |
| 435 | + ); | |
| 436 | + db_bind_int(&qparent, ":fid", frid); | |
| 437 | + db_bind_int(&qparent, ":mid", fmid); | |
| 438 | + while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ | |
| 439 | + aParent[nParent++] = db_column_int(&qparent, 0); | |
| 440 | + } | |
| 441 | + db_reset(&qparent); | |
| 427 | 442 | if( zBr==0 ) zBr = "trunk"; |
| 428 | 443 | if( uBg ){ |
| 429 | 444 | zBgClr = hash_color(zUser); |
| 430 | 445 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 431 | 446 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 432 | 447 | } |
| 433 | - gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, | |
| 448 | + gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr, | |
| 434 | 449 | zUuid, 0); |
| 435 | 450 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 436 | 451 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 437 | 452 | @ <tr><td> |
| 438 | 453 | @ <div class="divider">%s(zPrevDate)</div> |
| @@ -455,11 +470,15 @@ | ||
| 455 | 470 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 456 | 471 | pfnid); |
| 457 | 472 | @ <b>Renamed</b> from |
| 458 | 473 | @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a> |
| 459 | 474 | } |
| 460 | - @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in | |
| 475 | + @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> | |
| 476 | + if( fShowId ){ | |
| 477 | + @ (%d(frid)) | |
| 478 | + } | |
| 479 | + @ part of check-in | |
| 461 | 480 | }else{ |
| 462 | 481 | char *zNewName; |
| 463 | 482 | zNewName = db_text(0, |
| 464 | 483 | "SELECT name FROM filename WHERE fnid = " |
| 465 | 484 | " (SELECT fnid FROM mlink" |
| @@ -473,10 +492,13 @@ | ||
| 473 | 492 | }else{ |
| 474 | 493 | @ <b>Deleted</b> by check-in |
| 475 | 494 | } |
| 476 | 495 | } |
| 477 | 496 | hyperlink_to_uuid(zCkin); |
| 497 | + if( fShowId ){ | |
| 498 | + @ (%d(fmid)) | |
| 499 | + } | |
| 478 | 500 | @ %W(zCom) (user: |
| 479 | 501 | hyperlink_to_user(zUser, zDate, ""); |
| 480 | 502 | @ branch: %h(zBr)) |
| 481 | 503 | if( g.perm.Hyperlink && zUuid ){ |
| 482 | 504 | const char *z = zFilename; |
| 483 | 505 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -303,10 +303,11 @@ | |
| 303 | GraphContext *pGraph; |
| 304 | int brBg = P("brbg")!=0; |
| 305 | int uBg = P("ubg")!=0; |
| 306 | int firstChngOnly = atoi(PD("fco","1"))!=0; |
| 307 | int fDebug = atoi(PD("debug","0")); |
| 308 | |
| 309 | login_check_credentials(); |
| 310 | if( !g.perm.Read ){ login_needed(); return; } |
| 311 | style_header("File History"); |
| 312 | login_anonymous_available(); |
| @@ -422,17 +423,31 @@ | |
| 422 | const char *zBr = db_column_text(&q, 9); |
| 423 | int fmid = db_column_int(&q, 10); |
| 424 | int pfnid = db_column_int(&q, 11); |
| 425 | int gidx; |
| 426 | char zTime[10]; |
| 427 | if( zBr==0 ) zBr = "trunk"; |
| 428 | if( uBg ){ |
| 429 | zBgClr = hash_color(zUser); |
| 430 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 431 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 432 | } |
| 433 | gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, |
| 434 | zUuid, 0); |
| 435 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 436 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 437 | @ <tr><td> |
| 438 | @ <div class="divider">%s(zPrevDate)</div> |
| @@ -455,11 +470,15 @@ | |
| 455 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 456 | pfnid); |
| 457 | @ <b>Renamed</b> from |
| 458 | @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a> |
| 459 | } |
| 460 | @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in |
| 461 | }else{ |
| 462 | char *zNewName; |
| 463 | zNewName = db_text(0, |
| 464 | "SELECT name FROM filename WHERE fnid = " |
| 465 | " (SELECT fnid FROM mlink" |
| @@ -473,10 +492,13 @@ | |
| 473 | }else{ |
| 474 | @ <b>Deleted</b> by check-in |
| 475 | } |
| 476 | } |
| 477 | hyperlink_to_uuid(zCkin); |
| 478 | @ %W(zCom) (user: |
| 479 | hyperlink_to_user(zUser, zDate, ""); |
| 480 | @ branch: %h(zBr)) |
| 481 | if( g.perm.Hyperlink && zUuid ){ |
| 482 | const char *z = zFilename; |
| 483 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -303,10 +303,11 @@ | |
| 303 | GraphContext *pGraph; |
| 304 | int brBg = P("brbg")!=0; |
| 305 | int uBg = P("ubg")!=0; |
| 306 | int firstChngOnly = atoi(PD("fco","1"))!=0; |
| 307 | int fDebug = atoi(PD("debug","0")); |
| 308 | int fShowId = P("showid")!=0; |
| 309 | |
| 310 | login_check_credentials(); |
| 311 | if( !g.perm.Read ){ login_needed(); return; } |
| 312 | style_header("File History"); |
| 313 | login_anonymous_available(); |
| @@ -422,17 +423,31 @@ | |
| 423 | const char *zBr = db_column_text(&q, 9); |
| 424 | int fmid = db_column_int(&q, 10); |
| 425 | int pfnid = db_column_int(&q, 11); |
| 426 | int gidx; |
| 427 | char zTime[10]; |
| 428 | int nParent = 0; |
| 429 | int aParent[32]; |
| 430 | static Stmt qparent; |
| 431 | db_static_prepare(&qparent, |
| 432 | "SELECT DISTINCT pid FROM mlink" |
| 433 | " WHERE fid=:fid AND mid=:mid" |
| 434 | " ORDER BY isaux /*sort*/" |
| 435 | ); |
| 436 | db_bind_int(&qparent, ":fid", frid); |
| 437 | db_bind_int(&qparent, ":mid", fmid); |
| 438 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 439 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 440 | } |
| 441 | db_reset(&qparent); |
| 442 | if( zBr==0 ) zBr = "trunk"; |
| 443 | if( uBg ){ |
| 444 | zBgClr = hash_color(zUser); |
| 445 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 446 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 447 | } |
| 448 | gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr, |
| 449 | zUuid, 0); |
| 450 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 451 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 452 | @ <tr><td> |
| 453 | @ <div class="divider">%s(zPrevDate)</div> |
| @@ -455,11 +470,15 @@ | |
| 470 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 471 | pfnid); |
| 472 | @ <b>Renamed</b> from |
| 473 | @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a> |
| 474 | } |
| 475 | @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> |
| 476 | if( fShowId ){ |
| 477 | @ (%d(frid)) |
| 478 | } |
| 479 | @ part of check-in |
| 480 | }else{ |
| 481 | char *zNewName; |
| 482 | zNewName = db_text(0, |
| 483 | "SELECT name FROM filename WHERE fnid = " |
| 484 | " (SELECT fnid FROM mlink" |
| @@ -473,10 +492,13 @@ | |
| 492 | }else{ |
| 493 | @ <b>Deleted</b> by check-in |
| 494 | } |
| 495 | } |
| 496 | hyperlink_to_uuid(zCkin); |
| 497 | if( fShowId ){ |
| 498 | @ (%d(fmid)) |
| 499 | } |
| 500 | @ %W(zCom) (user: |
| 501 | hyperlink_to_user(zUser, zDate, ""); |
| 502 | @ branch: %h(zBr)) |
| 503 | if( g.perm.Hyperlink && zUuid ){ |
| 504 | const char *z = zFilename; |
| 505 |
+10
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -247,10 +247,20 @@ | ||
| 247 | 247 | @ |
| 248 | 248 | @ -- There can be multiple entries for (mid,fid) if the mid checkin was |
| 249 | 249 | @ -- a merge. Entries with isaux==0 are from the primary parent. Merge |
| 250 | 250 | @ -- parents have isaux set to true. |
| 251 | 251 | @ -- |
| 252 | +@ -- Field name mnemonics: | |
| 253 | +@ -- mid = Manifest ID. (Each check-in is stored as a "Manifest") | |
| 254 | +@ -- fid = File ID. | |
| 255 | +@ -- pmid = Parent Manifest ID. | |
| 256 | +@ -- pid = Parent file ID. | |
| 257 | +@ -- fnid = File Name ID. | |
| 258 | +@ -- pfnid = Parent File Name ID. | |
| 259 | +@ -- fclass = FileCLASS id. | |
| 260 | +@ -- isaux = pmid IS AUXiliary parent, not primary parent | |
| 261 | +@ -- | |
| 252 | 262 | @ -- pid==0 if the file is added by checkin mid. |
| 253 | 263 | @ -- fid==0 if the file is removed by checkin mid. |
| 254 | 264 | @ -- |
| 255 | 265 | @ CREATE TABLE mlink( |
| 256 | 266 | @ mid INTEGER REFERENCES plink(cid), -- Checkin that contains fid |
| 257 | 267 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -247,10 +247,20 @@ | |
| 247 | @ |
| 248 | @ -- There can be multiple entries for (mid,fid) if the mid checkin was |
| 249 | @ -- a merge. Entries with isaux==0 are from the primary parent. Merge |
| 250 | @ -- parents have isaux set to true. |
| 251 | @ -- |
| 252 | @ -- pid==0 if the file is added by checkin mid. |
| 253 | @ -- fid==0 if the file is removed by checkin mid. |
| 254 | @ -- |
| 255 | @ CREATE TABLE mlink( |
| 256 | @ mid INTEGER REFERENCES plink(cid), -- Checkin that contains fid |
| 257 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -247,10 +247,20 @@ | |
| 247 | @ |
| 248 | @ -- There can be multiple entries for (mid,fid) if the mid checkin was |
| 249 | @ -- a merge. Entries with isaux==0 are from the primary parent. Merge |
| 250 | @ -- parents have isaux set to true. |
| 251 | @ -- |
| 252 | @ -- Field name mnemonics: |
| 253 | @ -- mid = Manifest ID. (Each check-in is stored as a "Manifest") |
| 254 | @ -- fid = File ID. |
| 255 | @ -- pmid = Parent Manifest ID. |
| 256 | @ -- pid = Parent file ID. |
| 257 | @ -- fnid = File Name ID. |
| 258 | @ -- pfnid = Parent File Name ID. |
| 259 | @ -- fclass = FileCLASS id. |
| 260 | @ -- isaux = pmid IS AUXiliary parent, not primary parent |
| 261 | @ -- |
| 262 | @ -- pid==0 if the file is added by checkin mid. |
| 263 | @ -- fid==0 if the file is removed by checkin mid. |
| 264 | @ -- |
| 265 | @ CREATE TABLE mlink( |
| 266 | @ mid INTEGER REFERENCES plink(cid), -- Checkin that contains fid |
| 267 |