Fossil SCM
An experiment in trying to improve the file history timelines. A schema change is necessary for this improvement, which the present check-in captures. However, the file history timelines have not yet been improved, and in fact are slightly broken at this point.
Commit
e1e9c3a300f795f5d541569c76fa6943d5d8a240
Parent
494b2a4c9202007…
16 files changed
+1
-1
+3
-3
+2
-2
+22
-3
-1
+7
-7
+1
-1
+1
-1
+28
-33
+1
-1
+3
-3
+3
-3
+2
-2
+5
-4
+1
-1
+2
-2
+1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -771,11 +771,11 @@ | ||
| 771 | 771 | db_finalize(&ins); |
| 772 | 772 | manifest_destroy(pManifest); |
| 773 | 773 | db_prepare(&q1,"SELECT fid FROM mlink WHERE mid=:mid"); |
| 774 | 774 | db_prepare(&upd, "UPDATE fileage SET mid=:mid, mtime=:vmtime" |
| 775 | 775 | " WHERE fid=:fid AND mid IS NULL"); |
| 776 | - db_prepare(&q2,"SELECT pid FROM plink WHERE cid=:vid AND isprim"); | |
| 776 | + db_prepare(&q2,"SELECT pid FROM plink WHERE cid=:vid AND mseq=0"); | |
| 777 | 777 | db_prepare(&q3,"SELECT mtime FROM event WHERE objid=:vid"); |
| 778 | 778 | while( nFile>0 && vid>0 ){ |
| 779 | 779 | db_bind_int(&q3, ":vid", vid); |
| 780 | 780 | if( db_step(&q3)==SQLITE_ROW ){ |
| 781 | 781 | vmtime = db_column_double(&q3, 0); |
| 782 | 782 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -771,11 +771,11 @@ | |
| 771 | db_finalize(&ins); |
| 772 | manifest_destroy(pManifest); |
| 773 | db_prepare(&q1,"SELECT fid FROM mlink WHERE mid=:mid"); |
| 774 | db_prepare(&upd, "UPDATE fileage SET mid=:mid, mtime=:vmtime" |
| 775 | " WHERE fid=:fid AND mid IS NULL"); |
| 776 | db_prepare(&q2,"SELECT pid FROM plink WHERE cid=:vid AND isprim"); |
| 777 | db_prepare(&q3,"SELECT mtime FROM event WHERE objid=:vid"); |
| 778 | while( nFile>0 && vid>0 ){ |
| 779 | db_bind_int(&q3, ":vid", vid); |
| 780 | if( db_step(&q3)==SQLITE_ROW ){ |
| 781 | vmtime = db_column_double(&q3, 0); |
| 782 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -771,11 +771,11 @@ | |
| 771 | db_finalize(&ins); |
| 772 | manifest_destroy(pManifest); |
| 773 | db_prepare(&q1,"SELECT fid FROM mlink WHERE mid=:mid"); |
| 774 | db_prepare(&upd, "UPDATE fileage SET mid=:mid, mtime=:vmtime" |
| 775 | " WHERE fid=:fid AND mid IS NULL"); |
| 776 | db_prepare(&q2,"SELECT pid FROM plink WHERE cid=:vid AND mseq=0"); |
| 777 | db_prepare(&q3,"SELECT mtime FROM event WHERE objid=:vid"); |
| 778 | while( nFile>0 && vid>0 ){ |
| 779 | db_bind_int(&q3, ":vid", vid); |
| 780 | if( db_step(&q3)==SQLITE_ROW ){ |
| 781 | vmtime = db_column_double(&q3, 0); |
| 782 |
+3
-3
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -77,11 +77,11 @@ | ||
| 77 | 77 | ** returned. Only merge children in different branches are excluded. |
| 78 | 78 | */ |
| 79 | 79 | db_prepare(&q1, |
| 80 | 80 | "SELECT cid FROM plink" |
| 81 | 81 | " WHERE pid=:rid" |
| 82 | - " AND (isprim" | |
| 82 | + " AND (mseq=0" | |
| 83 | 83 | " OR coalesce((SELECT value FROM tagxref" |
| 84 | 84 | " WHERE tagid=%d AND rid=plink.pid), 'trunk')" |
| 85 | 85 | "=coalesce((SELECT value FROM tagxref" |
| 86 | 86 | " WHERE tagid=%d AND rid=plink.cid), 'trunk'))", |
| 87 | 87 | TAG_BRANCH, TAG_BRANCH |
| @@ -199,11 +199,11 @@ | ||
| 199 | 199 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 200 | 200 | ); |
| 201 | 201 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 202 | 202 | db_prepare(&q, |
| 203 | 203 | "SELECT pid FROM plink" |
| 204 | - " WHERE cid=:rid AND isprim" | |
| 204 | + " WHERE cid=:rid AND mseq=0" | |
| 205 | 205 | ); |
| 206 | 206 | while( (N--)>0 ){ |
| 207 | 207 | db_bind_int(&q, ":rid", rid); |
| 208 | 208 | if( db_step(&q)!=SQLITE_ROW ) break; |
| 209 | 209 | rid = db_column_int(&q, 0); |
| @@ -531,11 +531,11 @@ | ||
| 531 | 531 | db_step(&ins); |
| 532 | 532 | db_reset(&ins); |
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | db_finalize(&q); |
| 536 | - db_prepare(&q, "SELECT cid FROM plink WHERE pid=:rid AND isprim"); | |
| 536 | + db_prepare(&q, "SELECT cid FROM plink WHERE pid=:rid AND mseq=0"); | |
| 537 | 537 | |
| 538 | 538 | while( (rid = bag_first(&pending))!=0 ){ |
| 539 | 539 | bag_remove(&pending, rid); |
| 540 | 540 | db_bind_int(&q, ":rid", rid); |
| 541 | 541 | while( db_step(&q)==SQLITE_ROW ){ |
| 542 | 542 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | ** returned. Only merge children in different branches are excluded. |
| 78 | */ |
| 79 | db_prepare(&q1, |
| 80 | "SELECT cid FROM plink" |
| 81 | " WHERE pid=:rid" |
| 82 | " AND (isprim" |
| 83 | " OR coalesce((SELECT value FROM tagxref" |
| 84 | " WHERE tagid=%d AND rid=plink.pid), 'trunk')" |
| 85 | "=coalesce((SELECT value FROM tagxref" |
| 86 | " WHERE tagid=%d AND rid=plink.cid), 'trunk'))", |
| 87 | TAG_BRANCH, TAG_BRANCH |
| @@ -199,11 +199,11 @@ | |
| 199 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 200 | ); |
| 201 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 202 | db_prepare(&q, |
| 203 | "SELECT pid FROM plink" |
| 204 | " WHERE cid=:rid AND isprim" |
| 205 | ); |
| 206 | while( (N--)>0 ){ |
| 207 | db_bind_int(&q, ":rid", rid); |
| 208 | if( db_step(&q)!=SQLITE_ROW ) break; |
| 209 | rid = db_column_int(&q, 0); |
| @@ -531,11 +531,11 @@ | |
| 531 | db_step(&ins); |
| 532 | db_reset(&ins); |
| 533 | } |
| 534 | } |
| 535 | db_finalize(&q); |
| 536 | db_prepare(&q, "SELECT cid FROM plink WHERE pid=:rid AND isprim"); |
| 537 | |
| 538 | while( (rid = bag_first(&pending))!=0 ){ |
| 539 | bag_remove(&pending, rid); |
| 540 | db_bind_int(&q, ":rid", rid); |
| 541 | while( db_step(&q)==SQLITE_ROW ){ |
| 542 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | ** returned. Only merge children in different branches are excluded. |
| 78 | */ |
| 79 | db_prepare(&q1, |
| 80 | "SELECT cid FROM plink" |
| 81 | " WHERE pid=:rid" |
| 82 | " AND (mseq=0" |
| 83 | " OR coalesce((SELECT value FROM tagxref" |
| 84 | " WHERE tagid=%d AND rid=plink.pid), 'trunk')" |
| 85 | "=coalesce((SELECT value FROM tagxref" |
| 86 | " WHERE tagid=%d AND rid=plink.cid), 'trunk'))", |
| 87 | TAG_BRANCH, TAG_BRANCH |
| @@ -199,11 +199,11 @@ | |
| 199 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 200 | ); |
| 201 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 202 | db_prepare(&q, |
| 203 | "SELECT pid FROM plink" |
| 204 | " WHERE cid=:rid AND mseq=0" |
| 205 | ); |
| 206 | while( (N--)>0 ){ |
| 207 | db_bind_int(&q, ":rid", rid); |
| 208 | if( db_step(&q)!=SQLITE_ROW ) break; |
| 209 | rid = db_column_int(&q, 0); |
| @@ -531,11 +531,11 @@ | |
| 531 | db_step(&ins); |
| 532 | db_reset(&ins); |
| 533 | } |
| 534 | } |
| 535 | db_finalize(&q); |
| 536 | db_prepare(&q, "SELECT cid FROM plink WHERE pid=:rid AND mseq=0"); |
| 537 | |
| 538 | while( (rid = bag_first(&pending))!=0 ){ |
| 539 | bag_remove(&pending, rid); |
| 540 | db_bind_int(&q, ":rid", rid); |
| 541 | while( db_step(&q)==SQLITE_ROW ){ |
| 542 |
+2
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -268,19 +268,19 @@ | ||
| 268 | 268 | printf(" %s +0000\n", zSecondsSince1970); |
| 269 | 269 | if( zComment==0 ) zComment = "null comment"; |
| 270 | 270 | printf("data %d\n%s\n", (int)strlen(zComment), zComment); |
| 271 | 271 | db_prepare(&q3, |
| 272 | 272 | "SELECT pid FROM plink" |
| 273 | - " WHERE cid=%d AND isprim" | |
| 273 | + " WHERE cid=%d AND mseq=0" | |
| 274 | 274 | " AND pid IN (SELECT objid FROM event)", |
| 275 | 275 | ckinId |
| 276 | 276 | ); |
| 277 | 277 | if( db_step(&q3) == SQLITE_ROW ){ |
| 278 | 278 | printf("from :%d\n", COMMITMARK(db_column_int(&q3, 0))); |
| 279 | 279 | db_prepare(&q4, |
| 280 | 280 | "SELECT pid FROM plink" |
| 281 | - " WHERE cid=%d AND NOT isprim" | |
| 281 | + " WHERE cid=%d AND mseq>0" | |
| 282 | 282 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 283 | 283 | " ORDER BY pid", |
| 284 | 284 | ckinId); |
| 285 | 285 | while( db_step(&q4)==SQLITE_ROW ){ |
| 286 | 286 | printf("merge :%d\n", COMMITMARK(db_column_int(&q4,0))); |
| 287 | 287 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -268,19 +268,19 @@ | |
| 268 | printf(" %s +0000\n", zSecondsSince1970); |
| 269 | if( zComment==0 ) zComment = "null comment"; |
| 270 | printf("data %d\n%s\n", (int)strlen(zComment), zComment); |
| 271 | db_prepare(&q3, |
| 272 | "SELECT pid FROM plink" |
| 273 | " WHERE cid=%d AND isprim" |
| 274 | " AND pid IN (SELECT objid FROM event)", |
| 275 | ckinId |
| 276 | ); |
| 277 | if( db_step(&q3) == SQLITE_ROW ){ |
| 278 | printf("from :%d\n", COMMITMARK(db_column_int(&q3, 0))); |
| 279 | db_prepare(&q4, |
| 280 | "SELECT pid FROM plink" |
| 281 | " WHERE cid=%d AND NOT isprim" |
| 282 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 283 | " ORDER BY pid", |
| 284 | ckinId); |
| 285 | while( db_step(&q4)==SQLITE_ROW ){ |
| 286 | printf("merge :%d\n", COMMITMARK(db_column_int(&q4,0))); |
| 287 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -268,19 +268,19 @@ | |
| 268 | printf(" %s +0000\n", zSecondsSince1970); |
| 269 | if( zComment==0 ) zComment = "null comment"; |
| 270 | printf("data %d\n%s\n", (int)strlen(zComment), zComment); |
| 271 | db_prepare(&q3, |
| 272 | "SELECT pid FROM plink" |
| 273 | " WHERE cid=%d AND mseq=0" |
| 274 | " AND pid IN (SELECT objid FROM event)", |
| 275 | ckinId |
| 276 | ); |
| 277 | if( db_step(&q3) == SQLITE_ROW ){ |
| 278 | printf("from :%d\n", COMMITMARK(db_column_int(&q3, 0))); |
| 279 | db_prepare(&q4, |
| 280 | "SELECT pid FROM plink" |
| 281 | " WHERE cid=%d AND mseq>0" |
| 282 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 283 | " ORDER BY pid", |
| 284 | ckinId); |
| 285 | while( db_step(&q4)==SQLITE_ROW ){ |
| 286 | printf("merge :%d\n", COMMITMARK(db_column_int(&q4,0))); |
| 287 |
+22
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -350,11 +350,12 @@ | ||
| 350 | 350 | TAG_BRANCH); |
| 351 | 351 | #endif |
| 352 | 352 | } |
| 353 | 353 | blob_append_sql(&sql, |
| 354 | 354 | " FROM mlink, event" |
| 355 | - " WHERE mlink.fnid IN (SELECT fnid FROM filename WHERE name=%Q)" | |
| 355 | + " WHERE mlink.fnid=(SELECT fnid FROM filename WHERE name=%Q)" | |
| 356 | + " AND mlink.mseq=0" | |
| 356 | 357 | " AND event.objid=mlink.mid", |
| 357 | 358 | zFilename |
| 358 | 359 | ); |
| 359 | 360 | if( baseCheckin ){ |
| 360 | 361 | compute_direct_ancestors(baseCheckin, 10000000); |
| @@ -422,17 +423,35 @@ | ||
| 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; | |
| 429 | + int aParent[32]; | |
| 430 | + static Stmt qpx; | |
| 427 | 431 | if( zBr==0 ) zBr = "trunk"; |
| 428 | 432 | if( uBg ){ |
| 429 | 433 | zBgClr = hash_color(zUser); |
| 430 | 434 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 431 | 435 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 432 | 436 | } |
| 433 | - gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, | |
| 437 | + if( fpid>0 ){ | |
| 438 | + db_static_prepare(&qpx, "SELECT DISTINCT pid FROM mlink" | |
| 439 | + " WHERE mid=:mid AND fid=:fid AND mseq>0"); | |
| 440 | + db_bind_int(&qpx, ":mid", fmid); | |
| 441 | + db_bind_int(&qpx, ":fid", frid); | |
| 442 | + nParent = 1; | |
| 443 | + aParent[0] = fpid; | |
| 444 | + while( nParent<32 && db_step(&qpx)==SQLITE_ROW ){ | |
| 445 | + int x = db_column_int(&qpx, 0); | |
| 446 | + if( x!=fpid ) aParent[nParent++] = x; | |
| 447 | + } | |
| 448 | + db_reset(&qpx); | |
| 449 | + }else{ | |
| 450 | + nParent = 0; | |
| 451 | + } | |
| 452 | + gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr, | |
| 434 | 453 | zUuid, 0); |
| 435 | 454 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 436 | 455 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 437 | 456 | @ <tr><td> |
| 438 | 457 | @ <div class="divider">%s(zPrevDate)</div> |
| @@ -475,11 +494,11 @@ | ||
| 475 | 494 | } |
| 476 | 495 | } |
| 477 | 496 | hyperlink_to_uuid(zCkin); |
| 478 | 497 | @ %W(zCom) (user: |
| 479 | 498 | hyperlink_to_user(zUser, zDate, ""); |
| 480 | - @ branch: %h(zBr)) | |
| 499 | + @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a> | |
| 481 | 500 | if( g.perm.Hyperlink && zUuid ){ |
| 482 | 501 | const char *z = zFilename; |
| 483 | 502 | @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) |
| 484 | 503 | @ [annotate]</a> |
| 485 | 504 | @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) |
| 486 | 505 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -350,11 +350,12 @@ | |
| 350 | TAG_BRANCH); |
| 351 | #endif |
| 352 | } |
| 353 | blob_append_sql(&sql, |
| 354 | " FROM mlink, event" |
| 355 | " WHERE mlink.fnid IN (SELECT fnid FROM filename WHERE name=%Q)" |
| 356 | " AND event.objid=mlink.mid", |
| 357 | zFilename |
| 358 | ); |
| 359 | if( baseCheckin ){ |
| 360 | compute_direct_ancestors(baseCheckin, 10000000); |
| @@ -422,17 +423,35 @@ | |
| 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> |
| @@ -475,11 +494,11 @@ | |
| 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 | @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) |
| 484 | @ [annotate]</a> |
| 485 | @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) |
| 486 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -350,11 +350,12 @@ | |
| 350 | TAG_BRANCH); |
| 351 | #endif |
| 352 | } |
| 353 | blob_append_sql(&sql, |
| 354 | " FROM mlink, event" |
| 355 | " WHERE mlink.fnid=(SELECT fnid FROM filename WHERE name=%Q)" |
| 356 | " AND mlink.mseq=0" |
| 357 | " AND event.objid=mlink.mid", |
| 358 | zFilename |
| 359 | ); |
| 360 | if( baseCheckin ){ |
| 361 | compute_direct_ancestors(baseCheckin, 10000000); |
| @@ -422,17 +423,35 @@ | |
| 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; |
| 429 | int aParent[32]; |
| 430 | static Stmt qpx; |
| 431 | if( zBr==0 ) zBr = "trunk"; |
| 432 | if( uBg ){ |
| 433 | zBgClr = hash_color(zUser); |
| 434 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 435 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 436 | } |
| 437 | if( fpid>0 ){ |
| 438 | db_static_prepare(&qpx, "SELECT DISTINCT pid FROM mlink" |
| 439 | " WHERE mid=:mid AND fid=:fid AND mseq>0"); |
| 440 | db_bind_int(&qpx, ":mid", fmid); |
| 441 | db_bind_int(&qpx, ":fid", frid); |
| 442 | nParent = 1; |
| 443 | aParent[0] = fpid; |
| 444 | while( nParent<32 && db_step(&qpx)==SQLITE_ROW ){ |
| 445 | int x = db_column_int(&qpx, 0); |
| 446 | if( x!=fpid ) aParent[nParent++] = x; |
| 447 | } |
| 448 | db_reset(&qpx); |
| 449 | }else{ |
| 450 | nParent = 0; |
| 451 | } |
| 452 | gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr, |
| 453 | zUuid, 0); |
| 454 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 455 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 456 | @ <tr><td> |
| 457 | @ <div class="divider">%s(zPrevDate)</div> |
| @@ -475,11 +494,11 @@ | |
| 494 | } |
| 495 | } |
| 496 | hyperlink_to_uuid(zCkin); |
| 497 | @ %W(zCom) (user: |
| 498 | hyperlink_to_user(zUser, zDate, ""); |
| 499 | @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a> |
| 500 | if( g.perm.Hyperlink && zUuid ){ |
| 501 | const char *z = zFilename; |
| 502 | @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) |
| 503 | @ [annotate]</a> |
| 504 | @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) |
| 505 |
-1
| --- src/fusefs.c | ||
| +++ src/fusefs.c | ||
| @@ -319,11 +319,10 @@ | ||
| 319 | 319 | #ifndef FOSSIL_HAVE_FUSEFS |
| 320 | 320 | fossil_fatal("this build of fossil does not support the fuse filesystem"); |
| 321 | 321 | #else |
| 322 | 322 | char *zMountPoint; |
| 323 | 323 | char *azNewArgv[5]; |
| 324 | - int i; | |
| 325 | 324 | int doDebug = find_option("debug","d",0)!=0; |
| 326 | 325 | |
| 327 | 326 | db_find_and_open_repository(0,0); |
| 328 | 327 | verify_all_options(); |
| 329 | 328 | blob_init(&fusefs.content, 0, 0); |
| 330 | 329 |
| --- src/fusefs.c | |
| +++ src/fusefs.c | |
| @@ -319,11 +319,10 @@ | |
| 319 | #ifndef FOSSIL_HAVE_FUSEFS |
| 320 | fossil_fatal("this build of fossil does not support the fuse filesystem"); |
| 321 | #else |
| 322 | char *zMountPoint; |
| 323 | char *azNewArgv[5]; |
| 324 | int i; |
| 325 | int doDebug = find_option("debug","d",0)!=0; |
| 326 | |
| 327 | db_find_and_open_repository(0,0); |
| 328 | verify_all_options(); |
| 329 | blob_init(&fusefs.content, 0, 0); |
| 330 |
| --- src/fusefs.c | |
| +++ src/fusefs.c | |
| @@ -319,11 +319,10 @@ | |
| 319 | #ifndef FOSSIL_HAVE_FUSEFS |
| 320 | fossil_fatal("this build of fossil does not support the fuse filesystem"); |
| 321 | #else |
| 322 | char *zMountPoint; |
| 323 | char *azNewArgv[5]; |
| 324 | int doDebug = find_option("debug","d",0)!=0; |
| 325 | |
| 326 | db_find_and_open_repository(0,0); |
| 327 | verify_all_options(); |
| 328 | blob_init(&fusefs.content, 0, 0); |
| 329 |
+7
-7
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -80,30 +80,30 @@ | ||
| 80 | 80 | " FROM event WHERE objid=%d", |
| 81 | 81 | rid |
| 82 | 82 | ); |
| 83 | 83 | } |
| 84 | 84 | if( showFamily ){ |
| 85 | - db_prepare(&q, "SELECT uuid, pid, isprim FROM plink JOIN blob ON pid=rid " | |
| 85 | + db_prepare(&q, "SELECT uuid, pid, mseq FROM plink JOIN blob ON pid=rid " | |
| 86 | 86 | " WHERE cid=%d" |
| 87 | - " ORDER BY isprim DESC, mtime DESC /*sort*/", rid); | |
| 87 | + " ORDER BY mseq>0, mtime DESC /*sort*/", rid); | |
| 88 | 88 | while( db_step(&q)==SQLITE_ROW ){ |
| 89 | 89 | const char *zUuid = db_column_text(&q, 0); |
| 90 | - const char *zType = db_column_int(&q, 2) ? "parent:" : "merged-from:"; | |
| 90 | + const char *zType = db_column_int(&q, 2) ? "merged-from:" : "parent:"; | |
| 91 | 91 | zDate = db_text("", |
| 92 | 92 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 93 | 93 | db_column_int(&q, 1) |
| 94 | 94 | ); |
| 95 | 95 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| 96 | 96 | free(zDate); |
| 97 | 97 | } |
| 98 | 98 | db_finalize(&q); |
| 99 | - db_prepare(&q, "SELECT uuid, cid, isprim FROM plink JOIN blob ON cid=rid " | |
| 99 | + db_prepare(&q, "SELECT uuid, cid, mseq FROM plink JOIN blob ON cid=rid " | |
| 100 | 100 | " WHERE pid=%d" |
| 101 | - " ORDER BY isprim DESC, mtime DESC /*sort*/", rid); | |
| 101 | + " ORDER BY mseq>0, mtime DESC /*sort*/", rid); | |
| 102 | 102 | while( db_step(&q)==SQLITE_ROW ){ |
| 103 | 103 | const char *zUuid = db_column_text(&q, 0); |
| 104 | - const char *zType = db_column_int(&q, 2) ? "child:" : "merged-into:"; | |
| 104 | + const char *zType = db_column_int(&q, 2) ? "merged-into:" : "child:"; | |
| 105 | 105 | zDate = db_text("", |
| 106 | 106 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 107 | 107 | db_column_int(&q, 1) |
| 108 | 108 | ); |
| 109 | 109 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| @@ -520,11 +520,11 @@ | ||
| 520 | 520 | zRe = P("regex"); |
| 521 | 521 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 522 | 522 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 523 | 523 | zParent = db_text(0, |
| 524 | 524 | "SELECT uuid FROM plink, blob" |
| 525 | - " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim", | |
| 525 | + " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.mseq=0", | |
| 526 | 526 | rid |
| 527 | 527 | ); |
| 528 | 528 | isLeaf = is_a_leaf(rid); |
| 529 | 529 | db_prepare(&q1, |
| 530 | 530 | "SELECT uuid, datetime(mtime%s), user, comment," |
| 531 | 531 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -80,30 +80,30 @@ | |
| 80 | " FROM event WHERE objid=%d", |
| 81 | rid |
| 82 | ); |
| 83 | } |
| 84 | if( showFamily ){ |
| 85 | db_prepare(&q, "SELECT uuid, pid, isprim FROM plink JOIN blob ON pid=rid " |
| 86 | " WHERE cid=%d" |
| 87 | " ORDER BY isprim DESC, mtime DESC /*sort*/", rid); |
| 88 | while( db_step(&q)==SQLITE_ROW ){ |
| 89 | const char *zUuid = db_column_text(&q, 0); |
| 90 | const char *zType = db_column_int(&q, 2) ? "parent:" : "merged-from:"; |
| 91 | zDate = db_text("", |
| 92 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 93 | db_column_int(&q, 1) |
| 94 | ); |
| 95 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| 96 | free(zDate); |
| 97 | } |
| 98 | db_finalize(&q); |
| 99 | db_prepare(&q, "SELECT uuid, cid, isprim FROM plink JOIN blob ON cid=rid " |
| 100 | " WHERE pid=%d" |
| 101 | " ORDER BY isprim DESC, mtime DESC /*sort*/", rid); |
| 102 | while( db_step(&q)==SQLITE_ROW ){ |
| 103 | const char *zUuid = db_column_text(&q, 0); |
| 104 | const char *zType = db_column_int(&q, 2) ? "child:" : "merged-into:"; |
| 105 | zDate = db_text("", |
| 106 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 107 | db_column_int(&q, 1) |
| 108 | ); |
| 109 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| @@ -520,11 +520,11 @@ | |
| 520 | zRe = P("regex"); |
| 521 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 522 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 523 | zParent = db_text(0, |
| 524 | "SELECT uuid FROM plink, blob" |
| 525 | " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim", |
| 526 | rid |
| 527 | ); |
| 528 | isLeaf = is_a_leaf(rid); |
| 529 | db_prepare(&q1, |
| 530 | "SELECT uuid, datetime(mtime%s), user, comment," |
| 531 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -80,30 +80,30 @@ | |
| 80 | " FROM event WHERE objid=%d", |
| 81 | rid |
| 82 | ); |
| 83 | } |
| 84 | if( showFamily ){ |
| 85 | db_prepare(&q, "SELECT uuid, pid, mseq FROM plink JOIN blob ON pid=rid " |
| 86 | " WHERE cid=%d" |
| 87 | " ORDER BY mseq>0, mtime DESC /*sort*/", rid); |
| 88 | while( db_step(&q)==SQLITE_ROW ){ |
| 89 | const char *zUuid = db_column_text(&q, 0); |
| 90 | const char *zType = db_column_int(&q, 2) ? "merged-from:" : "parent:"; |
| 91 | zDate = db_text("", |
| 92 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 93 | db_column_int(&q, 1) |
| 94 | ); |
| 95 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| 96 | free(zDate); |
| 97 | } |
| 98 | db_finalize(&q); |
| 99 | db_prepare(&q, "SELECT uuid, cid, mseq FROM plink JOIN blob ON cid=rid " |
| 100 | " WHERE pid=%d" |
| 101 | " ORDER BY mseq>0, mtime DESC /*sort*/", rid); |
| 102 | while( db_step(&q)==SQLITE_ROW ){ |
| 103 | const char *zUuid = db_column_text(&q, 0); |
| 104 | const char *zType = db_column_int(&q, 2) ? "merged-into:" : "child:"; |
| 105 | zDate = db_text("", |
| 106 | "SELECT datetime(mtime) || ' UTC' FROM event WHERE objid=%d", |
| 107 | db_column_int(&q, 1) |
| 108 | ); |
| 109 | fossil_print("%-13s %s %s\n", zType, zUuid, zDate); |
| @@ -520,11 +520,11 @@ | |
| 520 | zRe = P("regex"); |
| 521 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 522 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 523 | zParent = db_text(0, |
| 524 | "SELECT uuid FROM plink, blob" |
| 525 | " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.mseq=0", |
| 526 | rid |
| 527 | ); |
| 528 | isLeaf = is_a_leaf(rid); |
| 529 | db_prepare(&q1, |
| 530 | "SELECT uuid, datetime(mtime%s), user, comment," |
| 531 |
+1
-1
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | Stmt q = empty_Stmt; |
| 66 | 66 | cson_array * pParents = NULL; |
| 67 | 67 | db_prepare( &q, |
| 68 | 68 | "SELECT uuid FROM plink, blob" |
| 69 | 69 | " WHERE plink.cid=%d AND blob.rid=plink.pid" |
| 70 | - " ORDER BY plink.isprim DESC", | |
| 70 | + " ORDER BY plink.mseq>0", | |
| 71 | 71 | rid ); |
| 72 | 72 | while( SQLITE_ROW==db_step(&q) ){ |
| 73 | 73 | if(!pParents) { |
| 74 | 74 | pParents = cson_new_array(); |
| 75 | 75 | } |
| 76 | 76 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | Stmt q = empty_Stmt; |
| 66 | cson_array * pParents = NULL; |
| 67 | db_prepare( &q, |
| 68 | "SELECT uuid FROM plink, blob" |
| 69 | " WHERE plink.cid=%d AND blob.rid=plink.pid" |
| 70 | " ORDER BY plink.isprim DESC", |
| 71 | rid ); |
| 72 | while( SQLITE_ROW==db_step(&q) ){ |
| 73 | if(!pParents) { |
| 74 | pParents = cson_new_array(); |
| 75 | } |
| 76 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | Stmt q = empty_Stmt; |
| 66 | cson_array * pParents = NULL; |
| 67 | db_prepare( &q, |
| 68 | "SELECT uuid FROM plink, blob" |
| 69 | " WHERE plink.cid=%d AND blob.rid=plink.pid" |
| 70 | " ORDER BY plink.mseq>0", |
| 71 | rid ); |
| 72 | while( SQLITE_ROW==db_step(&q) ){ |
| 73 | if(!pParents) { |
| 74 | pParents = cson_new_array(); |
| 75 | } |
| 76 |
+1
-1
| --- src/leaf.c | ||
| +++ src/leaf.c | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | int count_nonbranch_children(int pid){ |
| 59 | 59 | int nNonBranch = 0; |
| 60 | 60 | static Stmt q; |
| 61 | 61 | static const char zSql[] = |
| 62 | 62 | @ SELECT count(*) FROM plink |
| 63 | - @ WHERE pid=:pid AND isprim | |
| 63 | + @ WHERE pid=:pid AND mseq=0 | |
| 64 | 64 | @ AND coalesce((SELECT value FROM tagxref |
| 65 | 65 | @ WHERE tagid=%d AND rid=plink.pid), 'trunk') |
| 66 | 66 | @ =coalesce((SELECT value FROM tagxref |
| 67 | 67 | @ WHERE tagid=%d AND rid=plink.cid), 'trunk') |
| 68 | 68 | ; |
| 69 | 69 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | int count_nonbranch_children(int pid){ |
| 59 | int nNonBranch = 0; |
| 60 | static Stmt q; |
| 61 | static const char zSql[] = |
| 62 | @ SELECT count(*) FROM plink |
| 63 | @ WHERE pid=:pid AND isprim |
| 64 | @ AND coalesce((SELECT value FROM tagxref |
| 65 | @ WHERE tagid=%d AND rid=plink.pid), 'trunk') |
| 66 | @ =coalesce((SELECT value FROM tagxref |
| 67 | @ WHERE tagid=%d AND rid=plink.cid), 'trunk') |
| 68 | ; |
| 69 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | int count_nonbranch_children(int pid){ |
| 59 | int nNonBranch = 0; |
| 60 | static Stmt q; |
| 61 | static const char zSql[] = |
| 62 | @ SELECT count(*) FROM plink |
| 63 | @ WHERE pid=:pid AND mseq=0 |
| 64 | @ AND coalesce((SELECT value FROM tagxref |
| 65 | @ WHERE tagid=%d AND rid=plink.pid), 'trunk') |
| 66 | @ =coalesce((SELECT value FROM tagxref |
| 67 | @ WHERE tagid=%d AND rid=plink.cid), 'trunk') |
| 68 | ; |
| 69 |
+28
-33
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1188,10 +1188,11 @@ | ||
| 1188 | 1188 | ** Add a single entry to the mlink table. Also add the filename to |
| 1189 | 1189 | ** the filename table if it is not there already. |
| 1190 | 1190 | */ |
| 1191 | 1191 | static void add_one_mlink( |
| 1192 | 1192 | int mid, /* The record ID of the manifest */ |
| 1193 | + int mseq, /* 0 for primary parent, 1 or more for merges */ | |
| 1193 | 1194 | const char *zFromUuid, /* UUID for the mlink.pid. "" to add file */ |
| 1194 | 1195 | const char *zToUuid, /* UUID for the mlink.fid. "" to delete */ |
| 1195 | 1196 | const char *zFilename, /* Filename */ |
| 1196 | 1197 | const char *zPrior, /* Previous filename. NULL if unchanged */ |
| 1197 | 1198 | int isPublic, /* True if mid is not a private manifest */ |
| @@ -1216,14 +1217,15 @@ | ||
| 1216 | 1217 | }else{ |
| 1217 | 1218 | fid = uuid_to_rid(zToUuid, 1); |
| 1218 | 1219 | if( isPublic ) content_make_public(fid); |
| 1219 | 1220 | } |
| 1220 | 1221 | db_static_prepare(&s1, |
| 1221 | - "INSERT INTO mlink(mid,pid,fid,fnid,pfnid,mperm)" | |
| 1222 | - "VALUES(:m,:p,:f,:n,:pfn,:mp)" | |
| 1222 | + "INSERT INTO mlink(mid,mseq,pid,fid,fnid,pfnid,mperm)" | |
| 1223 | + "VALUES(:m,:s,:p,:f,:n,:pfn,:mp)" | |
| 1223 | 1224 | ); |
| 1224 | 1225 | db_bind_int(&s1, ":m", mid); |
| 1226 | + db_bind_int(&s1, ":s", mseq); | |
| 1225 | 1227 | db_bind_int(&s1, ":p", pid); |
| 1226 | 1228 | db_bind_int(&s1, ":f", fid); |
| 1227 | 1229 | db_bind_int(&s1, ":n", fnid); |
| 1228 | 1230 | db_bind_int(&s1, ":pfn", pfnid); |
| 1229 | 1231 | db_bind_int(&s1, ":mp", mperm); |
| @@ -1342,11 +1344,15 @@ | ||
| 1342 | 1344 | ** |
| 1343 | 1345 | ** Deleted files have mlink.fid=0. |
| 1344 | 1346 | ** Added files have mlink.pid=0. |
| 1345 | 1347 | ** Edited files have both mlink.pid!=0 and mlink.fid!=0 |
| 1346 | 1348 | */ |
| 1347 | -static void add_mlink(int pid, Manifest *pParent, int cid, Manifest *pChild){ | |
| 1349 | +static void add_mlink( | |
| 1350 | + int pid, Manifest *pParent, /* Parent checkin */ | |
| 1351 | + int cid, Manifest *pChild, /* Child checkin */ | |
| 1352 | + int mseq /* 0 for primary parent, 1 or more for merges */ | |
| 1353 | +){ | |
| 1348 | 1354 | Blob otherContent; |
| 1349 | 1355 | int otherRid; |
| 1350 | 1356 | int i, rc; |
| 1351 | 1357 | ManifestFile *pChildFile, *pParentFile; |
| 1352 | 1358 | Manifest **ppOther; |
| @@ -1354,12 +1360,13 @@ | ||
| 1354 | 1360 | int isPublic; /* True if pChild is non-private */ |
| 1355 | 1361 | |
| 1356 | 1362 | /* If mlink table entires are already set for cid, then abort early |
| 1357 | 1363 | ** doing no work. |
| 1358 | 1364 | */ |
| 1359 | - db_static_prepare(&eq, "SELECT 1 FROM mlink WHERE mid=:mid"); | |
| 1365 | + db_static_prepare(&eq, "SELECT 1 FROM mlink WHERE mid=:mid AND mseq=:mseq"); | |
| 1360 | 1366 | db_bind_int(&eq, ":mid", cid); |
| 1367 | + db_bind_int(&eq, ":mseq", mseq); | |
| 1361 | 1368 | rc = db_step(&eq); |
| 1362 | 1369 | db_reset(&eq); |
| 1363 | 1370 | if( rc==SQLITE_ROW ) return; |
| 1364 | 1371 | |
| 1365 | 1372 | /* Compute the value of the missing pParent or pChild parameter. |
| @@ -1414,30 +1421,30 @@ | ||
| 1414 | 1421 | int mperm = manifest_file_mperm(pChildFile); |
| 1415 | 1422 | if( pChildFile->zPrior ){ |
| 1416 | 1423 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0); |
| 1417 | 1424 | if( pParentFile ){ |
| 1418 | 1425 | /* File with name change */ |
| 1419 | - add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, | |
| 1426 | + add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, | |
| 1420 | 1427 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1421 | 1428 | }else{ |
| 1422 | 1429 | /* File name changed, but the old name is not found in the parent! |
| 1423 | 1430 | ** Treat this like a new file. */ |
| 1424 | - add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1431 | + add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1425 | 1432 | isPublic, mperm); |
| 1426 | 1433 | } |
| 1427 | 1434 | }else{ |
| 1428 | 1435 | pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0); |
| 1429 | 1436 | if( pParentFile==0 ){ |
| 1430 | 1437 | if( pChildFile->zUuid ){ |
| 1431 | 1438 | /* A new file */ |
| 1432 | - add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1439 | + add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1433 | 1440 | isPublic, mperm); |
| 1434 | 1441 | } |
| 1435 | 1442 | }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 |
| 1436 | 1443 | || manifest_file_mperm(pParentFile)!=mperm ){ |
| 1437 | 1444 | /* Changes in file content or permissions */ |
| 1438 | - add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, | |
| 1445 | + add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, | |
| 1439 | 1446 | pChildFile->zName, 0, isPublic, mperm); |
| 1440 | 1447 | } |
| 1441 | 1448 | } |
| 1442 | 1449 | } |
| 1443 | 1450 | if( pParent->zBaseline && pChild->zBaseline ){ |
| @@ -1450,21 +1457,21 @@ | ||
| 1450 | 1457 | pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0); |
| 1451 | 1458 | if( pChildFile==0 ){ |
| 1452 | 1459 | /* The child file reverts to baseline. Show this as a change */ |
| 1453 | 1460 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1454 | 1461 | if( pChildFile ){ |
| 1455 | - add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, | |
| 1462 | + add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, | |
| 1456 | 1463 | pChildFile->zName, 0, isPublic, |
| 1457 | 1464 | manifest_file_mperm(pChildFile)); |
| 1458 | 1465 | } |
| 1459 | 1466 | } |
| 1460 | 1467 | }else{ |
| 1461 | 1468 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1462 | 1469 | if( pChildFile ){ |
| 1463 | 1470 | /* File resurrected in the child after having been deleted in |
| 1464 | 1471 | ** the parent. Show this as an added file. */ |
| 1465 | - add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1472 | + add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, | |
| 1466 | 1473 | isPublic, manifest_file_mperm(pChildFile)); |
| 1467 | 1474 | } |
| 1468 | 1475 | } |
| 1469 | 1476 | } |
| 1470 | 1477 | }else if( pChild->zBaseline==0 ){ |
| @@ -1472,11 +1479,11 @@ | ||
| 1472 | 1479 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1473 | 1480 | manifest_file_rewind(pParent); |
| 1474 | 1481 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1475 | 1482 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1476 | 1483 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1477 | - add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, | |
| 1484 | + add_one_mlink(cid, mseq, pParentFile->zUuid, 0, pParentFile->zName, 0, | |
| 1478 | 1485 | isPublic, 0); |
| 1479 | 1486 | } |
| 1480 | 1487 | } |
| 1481 | 1488 | } |
| 1482 | 1489 | manifest_cache_insert(*ppOther); |
| @@ -1784,41 +1791,29 @@ | ||
| 1784 | 1791 | sqlite3_snprintf(sizeof(zBaseId), zBaseId, "NULL"); |
| 1785 | 1792 | } |
| 1786 | 1793 | (void)db_schema_is_outofdate(); /* Make sure g.zAuxSchema is initialized */ |
| 1787 | 1794 | for(i=0; i<p->nParent; i++){ |
| 1788 | 1795 | int pid = uuid_to_rid(p->azParent[i], 1); |
| 1789 | - if( strcmp(g.zAuxSchema,"2014-11-24 20:35")>=0 ){ | |
| 1790 | - /* Support for PLINK.BASEID added on 2014-11-24 */ | |
| 1791 | - db_multi_exec( | |
| 1792 | - "INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime, baseid)" | |
| 1793 | - "VALUES(%d, %d, %d, %.17g, %s)", | |
| 1794 | - pid, rid, i==0, p->rDate, zBaseId/*safe-for-%s*/); | |
| 1795 | - }else{ | |
| 1796 | - /* Continue to work with older schema to avoid an unnecessary | |
| 1797 | - ** rebuild */ | |
| 1798 | - db_multi_exec( | |
| 1799 | - "INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime)" | |
| 1800 | - "VALUES(%d, %d, %d, %.17g)", | |
| 1801 | - pid, rid, i==0, p->rDate); | |
| 1802 | - } | |
| 1803 | - if( i==0 ){ | |
| 1804 | - add_mlink(pid, 0, rid, p); | |
| 1805 | - parentid = pid; | |
| 1806 | - } | |
| 1807 | - } | |
| 1808 | - db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d AND isprim", rid); | |
| 1796 | + db_multi_exec( | |
| 1797 | + "INSERT OR IGNORE INTO plink(pid, cid, mseq, mtime, baseid)" | |
| 1798 | + "VALUES(%d, %d, %d, %.17g, %s)", | |
| 1799 | + pid, rid, i, p->rDate, zBaseId/*safe-for-%s*/); | |
| 1800 | + if( i==0 ) parentid = pid; | |
| 1801 | + add_mlink(pid, 0, rid, p, i); | |
| 1802 | + } | |
| 1803 | + db_prepare(&q, "SELECT cid, mseq FROM plink WHERE pid=%d", rid); | |
| 1809 | 1804 | while( db_step(&q)==SQLITE_ROW ){ |
| 1810 | 1805 | int cid = db_column_int(&q, 0); |
| 1811 | - add_mlink(rid, p, cid, 0); | |
| 1806 | + add_mlink(rid, p, cid, 0, db_column_int(&q,1)); | |
| 1812 | 1807 | } |
| 1813 | 1808 | db_finalize(&q); |
| 1814 | 1809 | if( p->nParent==0 ){ |
| 1815 | 1810 | /* For root files (files without parents) add mlink entries |
| 1816 | 1811 | ** showing all content as new. */ |
| 1817 | 1812 | int isPublic = !content_is_private(rid); |
| 1818 | 1813 | for(i=0; i<p->nFile; i++){ |
| 1819 | - add_one_mlink(rid, 0, p->aFile[i].zUuid, p->aFile[i].zName, 0, | |
| 1814 | + add_one_mlink(rid, 0, 0, p->aFile[i].zUuid, p->aFile[i].zName, 0, | |
| 1820 | 1815 | isPublic, manifest_file_mperm(&p->aFile[i])); |
| 1821 | 1816 | } |
| 1822 | 1817 | } |
| 1823 | 1818 | db_multi_exec( |
| 1824 | 1819 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 1825 | 1820 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1188,10 +1188,11 @@ | |
| 1188 | ** Add a single entry to the mlink table. Also add the filename to |
| 1189 | ** the filename table if it is not there already. |
| 1190 | */ |
| 1191 | static void add_one_mlink( |
| 1192 | int mid, /* The record ID of the manifest */ |
| 1193 | const char *zFromUuid, /* UUID for the mlink.pid. "" to add file */ |
| 1194 | const char *zToUuid, /* UUID for the mlink.fid. "" to delete */ |
| 1195 | const char *zFilename, /* Filename */ |
| 1196 | const char *zPrior, /* Previous filename. NULL if unchanged */ |
| 1197 | int isPublic, /* True if mid is not a private manifest */ |
| @@ -1216,14 +1217,15 @@ | |
| 1216 | }else{ |
| 1217 | fid = uuid_to_rid(zToUuid, 1); |
| 1218 | if( isPublic ) content_make_public(fid); |
| 1219 | } |
| 1220 | db_static_prepare(&s1, |
| 1221 | "INSERT INTO mlink(mid,pid,fid,fnid,pfnid,mperm)" |
| 1222 | "VALUES(:m,:p,:f,:n,:pfn,:mp)" |
| 1223 | ); |
| 1224 | db_bind_int(&s1, ":m", mid); |
| 1225 | db_bind_int(&s1, ":p", pid); |
| 1226 | db_bind_int(&s1, ":f", fid); |
| 1227 | db_bind_int(&s1, ":n", fnid); |
| 1228 | db_bind_int(&s1, ":pfn", pfnid); |
| 1229 | db_bind_int(&s1, ":mp", mperm); |
| @@ -1342,11 +1344,15 @@ | |
| 1342 | ** |
| 1343 | ** Deleted files have mlink.fid=0. |
| 1344 | ** Added files have mlink.pid=0. |
| 1345 | ** Edited files have both mlink.pid!=0 and mlink.fid!=0 |
| 1346 | */ |
| 1347 | static void add_mlink(int pid, Manifest *pParent, int cid, Manifest *pChild){ |
| 1348 | Blob otherContent; |
| 1349 | int otherRid; |
| 1350 | int i, rc; |
| 1351 | ManifestFile *pChildFile, *pParentFile; |
| 1352 | Manifest **ppOther; |
| @@ -1354,12 +1360,13 @@ | |
| 1354 | int isPublic; /* True if pChild is non-private */ |
| 1355 | |
| 1356 | /* If mlink table entires are already set for cid, then abort early |
| 1357 | ** doing no work. |
| 1358 | */ |
| 1359 | db_static_prepare(&eq, "SELECT 1 FROM mlink WHERE mid=:mid"); |
| 1360 | db_bind_int(&eq, ":mid", cid); |
| 1361 | rc = db_step(&eq); |
| 1362 | db_reset(&eq); |
| 1363 | if( rc==SQLITE_ROW ) return; |
| 1364 | |
| 1365 | /* Compute the value of the missing pParent or pChild parameter. |
| @@ -1414,30 +1421,30 @@ | |
| 1414 | int mperm = manifest_file_mperm(pChildFile); |
| 1415 | if( pChildFile->zPrior ){ |
| 1416 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0); |
| 1417 | if( pParentFile ){ |
| 1418 | /* File with name change */ |
| 1419 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1420 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1421 | }else{ |
| 1422 | /* File name changed, but the old name is not found in the parent! |
| 1423 | ** Treat this like a new file. */ |
| 1424 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1425 | isPublic, mperm); |
| 1426 | } |
| 1427 | }else{ |
| 1428 | pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0); |
| 1429 | if( pParentFile==0 ){ |
| 1430 | if( pChildFile->zUuid ){ |
| 1431 | /* A new file */ |
| 1432 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1433 | isPublic, mperm); |
| 1434 | } |
| 1435 | }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 |
| 1436 | || manifest_file_mperm(pParentFile)!=mperm ){ |
| 1437 | /* Changes in file content or permissions */ |
| 1438 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1439 | pChildFile->zName, 0, isPublic, mperm); |
| 1440 | } |
| 1441 | } |
| 1442 | } |
| 1443 | if( pParent->zBaseline && pChild->zBaseline ){ |
| @@ -1450,21 +1457,21 @@ | |
| 1450 | pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0); |
| 1451 | if( pChildFile==0 ){ |
| 1452 | /* The child file reverts to baseline. Show this as a change */ |
| 1453 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1454 | if( pChildFile ){ |
| 1455 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1456 | pChildFile->zName, 0, isPublic, |
| 1457 | manifest_file_mperm(pChildFile)); |
| 1458 | } |
| 1459 | } |
| 1460 | }else{ |
| 1461 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1462 | if( pChildFile ){ |
| 1463 | /* File resurrected in the child after having been deleted in |
| 1464 | ** the parent. Show this as an added file. */ |
| 1465 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1466 | isPublic, manifest_file_mperm(pChildFile)); |
| 1467 | } |
| 1468 | } |
| 1469 | } |
| 1470 | }else if( pChild->zBaseline==0 ){ |
| @@ -1472,11 +1479,11 @@ | |
| 1472 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1473 | manifest_file_rewind(pParent); |
| 1474 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1475 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1476 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1477 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1478 | isPublic, 0); |
| 1479 | } |
| 1480 | } |
| 1481 | } |
| 1482 | manifest_cache_insert(*ppOther); |
| @@ -1784,41 +1791,29 @@ | |
| 1784 | sqlite3_snprintf(sizeof(zBaseId), zBaseId, "NULL"); |
| 1785 | } |
| 1786 | (void)db_schema_is_outofdate(); /* Make sure g.zAuxSchema is initialized */ |
| 1787 | for(i=0; i<p->nParent; i++){ |
| 1788 | int pid = uuid_to_rid(p->azParent[i], 1); |
| 1789 | if( strcmp(g.zAuxSchema,"2014-11-24 20:35")>=0 ){ |
| 1790 | /* Support for PLINK.BASEID added on 2014-11-24 */ |
| 1791 | db_multi_exec( |
| 1792 | "INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime, baseid)" |
| 1793 | "VALUES(%d, %d, %d, %.17g, %s)", |
| 1794 | pid, rid, i==0, p->rDate, zBaseId/*safe-for-%s*/); |
| 1795 | }else{ |
| 1796 | /* Continue to work with older schema to avoid an unnecessary |
| 1797 | ** rebuild */ |
| 1798 | db_multi_exec( |
| 1799 | "INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime)" |
| 1800 | "VALUES(%d, %d, %d, %.17g)", |
| 1801 | pid, rid, i==0, p->rDate); |
| 1802 | } |
| 1803 | if( i==0 ){ |
| 1804 | add_mlink(pid, 0, rid, p); |
| 1805 | parentid = pid; |
| 1806 | } |
| 1807 | } |
| 1808 | db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d AND isprim", rid); |
| 1809 | while( db_step(&q)==SQLITE_ROW ){ |
| 1810 | int cid = db_column_int(&q, 0); |
| 1811 | add_mlink(rid, p, cid, 0); |
| 1812 | } |
| 1813 | db_finalize(&q); |
| 1814 | if( p->nParent==0 ){ |
| 1815 | /* For root files (files without parents) add mlink entries |
| 1816 | ** showing all content as new. */ |
| 1817 | int isPublic = !content_is_private(rid); |
| 1818 | for(i=0; i<p->nFile; i++){ |
| 1819 | add_one_mlink(rid, 0, p->aFile[i].zUuid, p->aFile[i].zName, 0, |
| 1820 | isPublic, manifest_file_mperm(&p->aFile[i])); |
| 1821 | } |
| 1822 | } |
| 1823 | db_multi_exec( |
| 1824 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 1825 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1188,10 +1188,11 @@ | |
| 1188 | ** Add a single entry to the mlink table. Also add the filename to |
| 1189 | ** the filename table if it is not there already. |
| 1190 | */ |
| 1191 | static void add_one_mlink( |
| 1192 | int mid, /* The record ID of the manifest */ |
| 1193 | int mseq, /* 0 for primary parent, 1 or more for merges */ |
| 1194 | const char *zFromUuid, /* UUID for the mlink.pid. "" to add file */ |
| 1195 | const char *zToUuid, /* UUID for the mlink.fid. "" to delete */ |
| 1196 | const char *zFilename, /* Filename */ |
| 1197 | const char *zPrior, /* Previous filename. NULL if unchanged */ |
| 1198 | int isPublic, /* True if mid is not a private manifest */ |
| @@ -1216,14 +1217,15 @@ | |
| 1217 | }else{ |
| 1218 | fid = uuid_to_rid(zToUuid, 1); |
| 1219 | if( isPublic ) content_make_public(fid); |
| 1220 | } |
| 1221 | db_static_prepare(&s1, |
| 1222 | "INSERT INTO mlink(mid,mseq,pid,fid,fnid,pfnid,mperm)" |
| 1223 | "VALUES(:m,:s,:p,:f,:n,:pfn,:mp)" |
| 1224 | ); |
| 1225 | db_bind_int(&s1, ":m", mid); |
| 1226 | db_bind_int(&s1, ":s", mseq); |
| 1227 | db_bind_int(&s1, ":p", pid); |
| 1228 | db_bind_int(&s1, ":f", fid); |
| 1229 | db_bind_int(&s1, ":n", fnid); |
| 1230 | db_bind_int(&s1, ":pfn", pfnid); |
| 1231 | db_bind_int(&s1, ":mp", mperm); |
| @@ -1342,11 +1344,15 @@ | |
| 1344 | ** |
| 1345 | ** Deleted files have mlink.fid=0. |
| 1346 | ** Added files have mlink.pid=0. |
| 1347 | ** Edited files have both mlink.pid!=0 and mlink.fid!=0 |
| 1348 | */ |
| 1349 | static void add_mlink( |
| 1350 | int pid, Manifest *pParent, /* Parent checkin */ |
| 1351 | int cid, Manifest *pChild, /* Child checkin */ |
| 1352 | int mseq /* 0 for primary parent, 1 or more for merges */ |
| 1353 | ){ |
| 1354 | Blob otherContent; |
| 1355 | int otherRid; |
| 1356 | int i, rc; |
| 1357 | ManifestFile *pChildFile, *pParentFile; |
| 1358 | Manifest **ppOther; |
| @@ -1354,12 +1360,13 @@ | |
| 1360 | int isPublic; /* True if pChild is non-private */ |
| 1361 | |
| 1362 | /* If mlink table entires are already set for cid, then abort early |
| 1363 | ** doing no work. |
| 1364 | */ |
| 1365 | db_static_prepare(&eq, "SELECT 1 FROM mlink WHERE mid=:mid AND mseq=:mseq"); |
| 1366 | db_bind_int(&eq, ":mid", cid); |
| 1367 | db_bind_int(&eq, ":mseq", mseq); |
| 1368 | rc = db_step(&eq); |
| 1369 | db_reset(&eq); |
| 1370 | if( rc==SQLITE_ROW ) return; |
| 1371 | |
| 1372 | /* Compute the value of the missing pParent or pChild parameter. |
| @@ -1414,30 +1421,30 @@ | |
| 1421 | int mperm = manifest_file_mperm(pChildFile); |
| 1422 | if( pChildFile->zPrior ){ |
| 1423 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0); |
| 1424 | if( pParentFile ){ |
| 1425 | /* File with name change */ |
| 1426 | add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, |
| 1427 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1428 | }else{ |
| 1429 | /* File name changed, but the old name is not found in the parent! |
| 1430 | ** Treat this like a new file. */ |
| 1431 | add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1432 | isPublic, mperm); |
| 1433 | } |
| 1434 | }else{ |
| 1435 | pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0); |
| 1436 | if( pParentFile==0 ){ |
| 1437 | if( pChildFile->zUuid ){ |
| 1438 | /* A new file */ |
| 1439 | add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1440 | isPublic, mperm); |
| 1441 | } |
| 1442 | }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 |
| 1443 | || manifest_file_mperm(pParentFile)!=mperm ){ |
| 1444 | /* Changes in file content or permissions */ |
| 1445 | add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, |
| 1446 | pChildFile->zName, 0, isPublic, mperm); |
| 1447 | } |
| 1448 | } |
| 1449 | } |
| 1450 | if( pParent->zBaseline && pChild->zBaseline ){ |
| @@ -1450,21 +1457,21 @@ | |
| 1457 | pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0); |
| 1458 | if( pChildFile==0 ){ |
| 1459 | /* The child file reverts to baseline. Show this as a change */ |
| 1460 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1461 | if( pChildFile ){ |
| 1462 | add_one_mlink(cid, mseq, pParentFile->zUuid, pChildFile->zUuid, |
| 1463 | pChildFile->zName, 0, isPublic, |
| 1464 | manifest_file_mperm(pChildFile)); |
| 1465 | } |
| 1466 | } |
| 1467 | }else{ |
| 1468 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1469 | if( pChildFile ){ |
| 1470 | /* File resurrected in the child after having been deleted in |
| 1471 | ** the parent. Show this as an added file. */ |
| 1472 | add_one_mlink(cid, mseq, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1473 | isPublic, manifest_file_mperm(pChildFile)); |
| 1474 | } |
| 1475 | } |
| 1476 | } |
| 1477 | }else if( pChild->zBaseline==0 ){ |
| @@ -1472,11 +1479,11 @@ | |
| 1479 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1480 | manifest_file_rewind(pParent); |
| 1481 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1482 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1483 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1484 | add_one_mlink(cid, mseq, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1485 | isPublic, 0); |
| 1486 | } |
| 1487 | } |
| 1488 | } |
| 1489 | manifest_cache_insert(*ppOther); |
| @@ -1784,41 +1791,29 @@ | |
| 1791 | sqlite3_snprintf(sizeof(zBaseId), zBaseId, "NULL"); |
| 1792 | } |
| 1793 | (void)db_schema_is_outofdate(); /* Make sure g.zAuxSchema is initialized */ |
| 1794 | for(i=0; i<p->nParent; i++){ |
| 1795 | int pid = uuid_to_rid(p->azParent[i], 1); |
| 1796 | db_multi_exec( |
| 1797 | "INSERT OR IGNORE INTO plink(pid, cid, mseq, mtime, baseid)" |
| 1798 | "VALUES(%d, %d, %d, %.17g, %s)", |
| 1799 | pid, rid, i, p->rDate, zBaseId/*safe-for-%s*/); |
| 1800 | if( i==0 ) parentid = pid; |
| 1801 | add_mlink(pid, 0, rid, p, i); |
| 1802 | } |
| 1803 | db_prepare(&q, "SELECT cid, mseq FROM plink WHERE pid=%d", rid); |
| 1804 | while( db_step(&q)==SQLITE_ROW ){ |
| 1805 | int cid = db_column_int(&q, 0); |
| 1806 | add_mlink(rid, p, cid, 0, db_column_int(&q,1)); |
| 1807 | } |
| 1808 | db_finalize(&q); |
| 1809 | if( p->nParent==0 ){ |
| 1810 | /* For root files (files without parents) add mlink entries |
| 1811 | ** showing all content as new. */ |
| 1812 | int isPublic = !content_is_private(rid); |
| 1813 | for(i=0; i<p->nFile; i++){ |
| 1814 | add_one_mlink(rid, 0, 0, p->aFile[i].zUuid, p->aFile[i].zName, 0, |
| 1815 | isPublic, manifest_file_mperm(&p->aFile[i])); |
| 1816 | } |
| 1817 | } |
| 1818 | db_multi_exec( |
| 1819 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 1820 |
+1
-1
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -230,11 +230,11 @@ | ||
| 230 | 230 | } |
| 231 | 231 | }else if( pickFlag || backoutFlag ){ |
| 232 | 232 | if( integrateFlag ){ |
| 233 | 233 | fossil_fatal("incompatible options: --integrate & --cherrypick or --backout"); |
| 234 | 234 | } |
| 235 | - pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", mid); | |
| 235 | + pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND mseq=0", mid); | |
| 236 | 236 | if( pid<=0 ){ |
| 237 | 237 | fossil_fatal("cannot find an ancestor for %s", g.argv[2]); |
| 238 | 238 | } |
| 239 | 239 | }else{ |
| 240 | 240 | pivot_set_primary(mid); |
| 241 | 241 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -230,11 +230,11 @@ | |
| 230 | } |
| 231 | }else if( pickFlag || backoutFlag ){ |
| 232 | if( integrateFlag ){ |
| 233 | fossil_fatal("incompatible options: --integrate & --cherrypick or --backout"); |
| 234 | } |
| 235 | pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", mid); |
| 236 | if( pid<=0 ){ |
| 237 | fossil_fatal("cannot find an ancestor for %s", g.argv[2]); |
| 238 | } |
| 239 | }else{ |
| 240 | pivot_set_primary(mid); |
| 241 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -230,11 +230,11 @@ | |
| 230 | } |
| 231 | }else if( pickFlag || backoutFlag ){ |
| 232 | if( integrateFlag ){ |
| 233 | fossil_fatal("incompatible options: --integrate & --cherrypick or --backout"); |
| 234 | } |
| 235 | pid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND mseq=0", mid); |
| 236 | if( pid<=0 ){ |
| 237 | fossil_fatal("cannot find an ancestor for %s", g.argv[2]); |
| 238 | } |
| 239 | }else{ |
| 240 | pivot_set_primary(mid); |
| 241 |
+3
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | db_prepare(&q, |
| 62 | 62 | "SELECT pid, EXISTS(SELECT 1 FROM tagxref" |
| 63 | 63 | " WHERE tagid=%d AND tagtype>0" |
| 64 | 64 | " AND value=%Q AND rid=plink.pid)" |
| 65 | 65 | " FROM plink" |
| 66 | - " WHERE cid=:cid AND isprim", | |
| 66 | + " WHERE cid=:cid AND mseq=0", | |
| 67 | 67 | TAG_BRANCH, zBr |
| 68 | 68 | ); |
| 69 | 69 | fossil_free(zBr); |
| 70 | 70 | do{ |
| 71 | 71 | db_reset(&q); |
| @@ -137,14 +137,14 @@ | ||
| 137 | 137 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 138 | 138 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 139 | 139 | rid = vid; |
| 140 | 140 | }else if( fossil_strcmp(zTag, "prev")==0 |
| 141 | 141 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 142 | - rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid); | |
| 142 | + rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND mseq=0", vid); | |
| 143 | 143 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 144 | 144 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 145 | - " ORDER BY isprim DESC, mtime DESC", vid); | |
| 145 | + " ORDER BY mseq>0, mtime DESC", vid); | |
| 146 | 146 | } |
| 147 | 147 | if( rid ) return rid; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /* Date and times */ |
| 151 | 151 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | db_prepare(&q, |
| 62 | "SELECT pid, EXISTS(SELECT 1 FROM tagxref" |
| 63 | " WHERE tagid=%d AND tagtype>0" |
| 64 | " AND value=%Q AND rid=plink.pid)" |
| 65 | " FROM plink" |
| 66 | " WHERE cid=:cid AND isprim", |
| 67 | TAG_BRANCH, zBr |
| 68 | ); |
| 69 | fossil_free(zBr); |
| 70 | do{ |
| 71 | db_reset(&q); |
| @@ -137,14 +137,14 @@ | |
| 137 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 138 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 139 | rid = vid; |
| 140 | }else if( fossil_strcmp(zTag, "prev")==0 |
| 141 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 142 | rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND isprim", vid); |
| 143 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 144 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 145 | " ORDER BY isprim DESC, mtime DESC", vid); |
| 146 | } |
| 147 | if( rid ) return rid; |
| 148 | } |
| 149 | |
| 150 | /* Date and times */ |
| 151 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | db_prepare(&q, |
| 62 | "SELECT pid, EXISTS(SELECT 1 FROM tagxref" |
| 63 | " WHERE tagid=%d AND tagtype>0" |
| 64 | " AND value=%Q AND rid=plink.pid)" |
| 65 | " FROM plink" |
| 66 | " WHERE cid=:cid AND mseq=0", |
| 67 | TAG_BRANCH, zBr |
| 68 | ); |
| 69 | fossil_free(zBr); |
| 70 | do{ |
| 71 | db_reset(&q); |
| @@ -137,14 +137,14 @@ | |
| 137 | if( g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){ |
| 138 | if( fossil_strcmp(zTag, "current")==0 ){ |
| 139 | rid = vid; |
| 140 | }else if( fossil_strcmp(zTag, "prev")==0 |
| 141 | || fossil_strcmp(zTag, "previous")==0 ){ |
| 142 | rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d AND mseq=0", vid); |
| 143 | }else if( fossil_strcmp(zTag, "next")==0 ){ |
| 144 | rid = db_int(0, "SELECT cid FROM plink WHERE pid=%d" |
| 145 | " ORDER BY mseq>0, mtime DESC", vid); |
| 146 | } |
| 147 | if( rid ) return rid; |
| 148 | } |
| 149 | |
| 150 | /* Date and times */ |
| 151 |
+3
-3
| --- src/path.c | ||
| +++ src/path.c | ||
| @@ -136,21 +136,21 @@ | ||
| 136 | 136 | path.pEnd = path.pStart; |
| 137 | 137 | return path.pStart; |
| 138 | 138 | } |
| 139 | 139 | if( oneWayOnly && directOnly ){ |
| 140 | 140 | db_prepare(&s, |
| 141 | - "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim" | |
| 141 | + "SELECT cid, 1 FROM plink WHERE pid=:pid AND mseq=0" | |
| 142 | 142 | ); |
| 143 | 143 | }else if( oneWayOnly ){ |
| 144 | 144 | db_prepare(&s, |
| 145 | 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | 146 | ); |
| 147 | 147 | }else if( directOnly ){ |
| 148 | 148 | db_prepare(&s, |
| 149 | - "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " | |
| 149 | + "SELECT cid, 1 FROM plink WHERE pid=:pid AND mseq=0 " | |
| 150 | 150 | "UNION ALL " |
| 151 | - "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" | |
| 151 | + "SELECT pid, 0 FROM plink WHERE cid=:pid AND mseq=0" | |
| 152 | 152 | ); |
| 153 | 153 | }else{ |
| 154 | 154 | db_prepare(&s, |
| 155 | 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | 156 | "UNION ALL " |
| 157 | 157 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -136,21 +136,21 @@ | |
| 136 | path.pEnd = path.pStart; |
| 137 | return path.pStart; |
| 138 | } |
| 139 | if( oneWayOnly && directOnly ){ |
| 140 | db_prepare(&s, |
| 141 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim" |
| 142 | ); |
| 143 | }else if( oneWayOnly ){ |
| 144 | db_prepare(&s, |
| 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | ); |
| 147 | }else if( directOnly ){ |
| 148 | db_prepare(&s, |
| 149 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 150 | "UNION ALL " |
| 151 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| 152 | ); |
| 153 | }else{ |
| 154 | db_prepare(&s, |
| 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | "UNION ALL " |
| 157 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -136,21 +136,21 @@ | |
| 136 | path.pEnd = path.pStart; |
| 137 | return path.pStart; |
| 138 | } |
| 139 | if( oneWayOnly && directOnly ){ |
| 140 | db_prepare(&s, |
| 141 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND mseq=0" |
| 142 | ); |
| 143 | }else if( oneWayOnly ){ |
| 144 | db_prepare(&s, |
| 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | ); |
| 147 | }else if( directOnly ){ |
| 148 | db_prepare(&s, |
| 149 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND mseq=0 " |
| 150 | "UNION ALL " |
| 151 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND mseq=0" |
| 152 | ); |
| 153 | }else{ |
| 154 | db_prepare(&s, |
| 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | "UNION ALL " |
| 157 |
+2
-2
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | @ blob.rid, |
| 59 | 59 | @ uuid, |
| 60 | 60 | @ event.mtime, |
| 61 | 61 | @ coalesce(ecomment,comment), |
| 62 | 62 | @ coalesce(euser,user), |
| 63 | - @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim), | |
| 63 | + @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0), | |
| 64 | 64 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 65 | 65 | @ FROM event, blob |
| 66 | 66 | @ WHERE blob.rid=event.objid |
| 67 | 67 | ; |
| 68 | 68 | |
| @@ -259,11 +259,11 @@ | ||
| 259 | 259 | @ blob.rid, |
| 260 | 260 | @ uuid, |
| 261 | 261 | @ event.mtime, |
| 262 | 262 | @ coalesce(ecomment,comment), |
| 263 | 263 | @ coalesce(euser,user), |
| 264 | - @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim), | |
| 264 | + @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0), | |
| 265 | 265 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 266 | 266 | @ FROM event, blob |
| 267 | 267 | @ WHERE blob.rid=event.objid |
| 268 | 268 | ; |
| 269 | 269 | if(!zType || !*zType){ |
| 270 | 270 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | @ blob.rid, |
| 59 | @ uuid, |
| 60 | @ event.mtime, |
| 61 | @ coalesce(ecomment,comment), |
| 62 | @ coalesce(euser,user), |
| 63 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim), |
| 64 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 65 | @ FROM event, blob |
| 66 | @ WHERE blob.rid=event.objid |
| 67 | ; |
| 68 | |
| @@ -259,11 +259,11 @@ | |
| 259 | @ blob.rid, |
| 260 | @ uuid, |
| 261 | @ event.mtime, |
| 262 | @ coalesce(ecomment,comment), |
| 263 | @ coalesce(euser,user), |
| 264 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim), |
| 265 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 266 | @ FROM event, blob |
| 267 | @ WHERE blob.rid=event.objid |
| 268 | ; |
| 269 | if(!zType || !*zType){ |
| 270 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | @ blob.rid, |
| 59 | @ uuid, |
| 60 | @ event.mtime, |
| 61 | @ coalesce(ecomment,comment), |
| 62 | @ coalesce(euser,user), |
| 63 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0), |
| 64 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 65 | @ FROM event, blob |
| 66 | @ WHERE blob.rid=event.objid |
| 67 | ; |
| 68 | |
| @@ -259,11 +259,11 @@ | |
| 259 | @ blob.rid, |
| 260 | @ uuid, |
| 261 | @ event.mtime, |
| 262 | @ coalesce(ecomment,comment), |
| 263 | @ coalesce(euser,user), |
| 264 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0), |
| 265 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 266 | @ FROM event, blob |
| 267 | @ WHERE blob.rid=event.objid |
| 268 | ; |
| 269 | if(!zType || !*zType){ |
| 270 |
+5
-4
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -44,12 +44,12 @@ | ||
| 44 | 44 | ** a date) which can change frequently. When the content schema changes, |
| 45 | 45 | ** we have to execute special procedures to update the schema. When |
| 46 | 46 | ** the aux schema changes, all we need to do is rebuild the database. |
| 47 | 47 | */ |
| 48 | 48 | #define CONTENT_SCHEMA "2" |
| 49 | -#define AUX_SCHEMA_MIN "2011-04-25 19:50" | |
| 50 | -#define AUX_SCHEMA_MAX "2014-11-24 20:35" | |
| 49 | +#define AUX_SCHEMA_MIN "2014-12-08 14:36" | |
| 50 | +#define AUX_SCHEMA_MAX "2014-12-08 14:36" | |
| 51 | 51 | |
| 52 | 52 | #endif /* INTERFACE */ |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | /* |
| @@ -237,23 +237,24 @@ | ||
| 237 | 237 | @ mid INTEGER REFERENCES blob, -- Manifest ID where change occurs |
| 238 | 238 | @ pid INTEGER REFERENCES blob, -- File ID in parent manifest |
| 239 | 239 | @ fid INTEGER REFERENCES blob, -- Changed file ID in this manifest |
| 240 | 240 | @ fnid INTEGER REFERENCES filename, -- Name of the file |
| 241 | 241 | @ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged |
| 242 | +@ mseq INTEGER, -- 0 for primary parent. 1 or more for merges | |
| 242 | 243 | @ mperm INTEGER -- File permissions. 1==exec |
| 243 | 244 | @ ); |
| 244 | -@ CREATE INDEX mlink_i1 ON mlink(mid); | |
| 245 | +@ CREATE INDEX mlink_i1 ON mlink(mid,fid); | |
| 245 | 246 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 246 | 247 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 247 | 248 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 248 | 249 | @ |
| 249 | 250 | @ -- Parent/child linkages between checkins |
| 250 | 251 | @ -- |
| 251 | 252 | @ CREATE TABLE plink( |
| 252 | 253 | @ pid INTEGER REFERENCES blob, -- Parent manifest |
| 253 | 254 | @ cid INTEGER REFERENCES blob, -- Child manifest |
| 254 | -@ isprim BOOLEAN, -- pid is the primary parent of cid | |
| 255 | +@ mseq INTEGER, -- 0 if pid is primary, 1 or more for merges | |
| 255 | 256 | @ mtime DATETIME, -- the date/time stamp on cid. Julian day. |
| 256 | 257 | @ baseid INTEGER REFERENCES blob, -- Baseline if child is a delta manifest |
| 257 | 258 | @ UNIQUE(pid, cid) |
| 258 | 259 | @ ); |
| 259 | 260 | @ CREATE INDEX plink_i2 ON plink(cid,pid); |
| 260 | 261 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -44,12 +44,12 @@ | |
| 44 | ** a date) which can change frequently. When the content schema changes, |
| 45 | ** we have to execute special procedures to update the schema. When |
| 46 | ** the aux schema changes, all we need to do is rebuild the database. |
| 47 | */ |
| 48 | #define CONTENT_SCHEMA "2" |
| 49 | #define AUX_SCHEMA_MIN "2011-04-25 19:50" |
| 50 | #define AUX_SCHEMA_MAX "2014-11-24 20:35" |
| 51 | |
| 52 | #endif /* INTERFACE */ |
| 53 | |
| 54 | |
| 55 | /* |
| @@ -237,23 +237,24 @@ | |
| 237 | @ mid INTEGER REFERENCES blob, -- Manifest ID where change occurs |
| 238 | @ pid INTEGER REFERENCES blob, -- File ID in parent manifest |
| 239 | @ fid INTEGER REFERENCES blob, -- Changed file ID in this manifest |
| 240 | @ fnid INTEGER REFERENCES filename, -- Name of the file |
| 241 | @ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged |
| 242 | @ mperm INTEGER -- File permissions. 1==exec |
| 243 | @ ); |
| 244 | @ CREATE INDEX mlink_i1 ON mlink(mid); |
| 245 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 246 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 247 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 248 | @ |
| 249 | @ -- Parent/child linkages between checkins |
| 250 | @ -- |
| 251 | @ CREATE TABLE plink( |
| 252 | @ pid INTEGER REFERENCES blob, -- Parent manifest |
| 253 | @ cid INTEGER REFERENCES blob, -- Child manifest |
| 254 | @ isprim BOOLEAN, -- pid is the primary parent of cid |
| 255 | @ mtime DATETIME, -- the date/time stamp on cid. Julian day. |
| 256 | @ baseid INTEGER REFERENCES blob, -- Baseline if child is a delta manifest |
| 257 | @ UNIQUE(pid, cid) |
| 258 | @ ); |
| 259 | @ CREATE INDEX plink_i2 ON plink(cid,pid); |
| 260 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -44,12 +44,12 @@ | |
| 44 | ** a date) which can change frequently. When the content schema changes, |
| 45 | ** we have to execute special procedures to update the schema. When |
| 46 | ** the aux schema changes, all we need to do is rebuild the database. |
| 47 | */ |
| 48 | #define CONTENT_SCHEMA "2" |
| 49 | #define AUX_SCHEMA_MIN "2014-12-08 14:36" |
| 50 | #define AUX_SCHEMA_MAX "2014-12-08 14:36" |
| 51 | |
| 52 | #endif /* INTERFACE */ |
| 53 | |
| 54 | |
| 55 | /* |
| @@ -237,23 +237,24 @@ | |
| 237 | @ mid INTEGER REFERENCES blob, -- Manifest ID where change occurs |
| 238 | @ pid INTEGER REFERENCES blob, -- File ID in parent manifest |
| 239 | @ fid INTEGER REFERENCES blob, -- Changed file ID in this manifest |
| 240 | @ fnid INTEGER REFERENCES filename, -- Name of the file |
| 241 | @ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged |
| 242 | @ mseq INTEGER, -- 0 for primary parent. 1 or more for merges |
| 243 | @ mperm INTEGER -- File permissions. 1==exec |
| 244 | @ ); |
| 245 | @ CREATE INDEX mlink_i1 ON mlink(mid,fid); |
| 246 | @ CREATE INDEX mlink_i2 ON mlink(fnid); |
| 247 | @ CREATE INDEX mlink_i3 ON mlink(fid); |
| 248 | @ CREATE INDEX mlink_i4 ON mlink(pid); |
| 249 | @ |
| 250 | @ -- Parent/child linkages between checkins |
| 251 | @ -- |
| 252 | @ CREATE TABLE plink( |
| 253 | @ pid INTEGER REFERENCES blob, -- Parent manifest |
| 254 | @ cid INTEGER REFERENCES blob, -- Child manifest |
| 255 | @ mseq INTEGER, -- 0 if pid is primary, 1 or more for merges |
| 256 | @ mtime DATETIME, -- the date/time stamp on cid. Julian day. |
| 257 | @ baseid INTEGER REFERENCES blob, -- Baseline if child is a delta manifest |
| 258 | @ UNIQUE(pid, cid) |
| 259 | @ ); |
| 260 | @ CREATE INDEX plink_i2 ON plink(cid,pid); |
| 261 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | */ |
| 55 | 55 | db_prepare(&s, |
| 56 | 56 | "SELECT cid, plink.mtime," |
| 57 | 57 | " coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit" |
| 58 | 58 | " FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d" |
| 59 | - " WHERE pid=:pid AND isprim", | |
| 59 | + " WHERE pid=:pid AND mseq=0", | |
| 60 | 60 | tagType==2, tagid |
| 61 | 61 | ); |
| 62 | 62 | db_bind_double(&s, ":mtime", mtime); |
| 63 | 63 | |
| 64 | 64 | if( tagType==2 ){ |
| 65 | 65 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | */ |
| 55 | db_prepare(&s, |
| 56 | "SELECT cid, plink.mtime," |
| 57 | " coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit" |
| 58 | " FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d" |
| 59 | " WHERE pid=:pid AND isprim", |
| 60 | tagType==2, tagid |
| 61 | ); |
| 62 | db_bind_double(&s, ":mtime", mtime); |
| 63 | |
| 64 | if( tagType==2 ){ |
| 65 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | */ |
| 55 | db_prepare(&s, |
| 56 | "SELECT cid, plink.mtime," |
| 57 | " coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit" |
| 58 | " FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d" |
| 59 | " WHERE pid=:pid AND mseq=0", |
| 60 | tagType==2, tagid |
| 61 | ); |
| 62 | db_bind_double(&s, ":mtime", mtime); |
| 63 | |
| 64 | if( tagType==2 ){ |
| 65 |
+2
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -365,11 +365,11 @@ | ||
| 365 | 365 | int gidx; |
| 366 | 366 | static Stmt qparent; |
| 367 | 367 | db_static_prepare(&qparent, |
| 368 | 368 | "SELECT pid FROM plink" |
| 369 | 369 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 370 | - " ORDER BY isprim DESC /*sort*/" | |
| 370 | + " ORDER BY mseq>0 /*sort*/" | |
| 371 | 371 | ); |
| 372 | 372 | db_bind_int(&qparent, ":rid", rid); |
| 373 | 373 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 374 | 374 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 375 | 375 | } |
| @@ -1716,11 +1716,11 @@ | ||
| 1716 | 1716 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1717 | 1717 | @ FROM tag, tagxref |
| 1718 | 1718 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 1719 | 1719 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) |
| 1720 | 1720 | @ || ')' as comment, |
| 1721 | - @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim) | |
| 1721 | + @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0) | |
| 1722 | 1722 | @ AS primPlinkCount, |
| 1723 | 1723 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) AS plinkCount, |
| 1724 | 1724 | @ event.mtime AS mtime, |
| 1725 | 1725 | @ tagxref.value AS branch |
| 1726 | 1726 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 1727 | 1727 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | int gidx; |
| 366 | static Stmt qparent; |
| 367 | db_static_prepare(&qparent, |
| 368 | "SELECT pid FROM plink" |
| 369 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 370 | " ORDER BY isprim DESC /*sort*/" |
| 371 | ); |
| 372 | db_bind_int(&qparent, ":rid", rid); |
| 373 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 374 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 375 | } |
| @@ -1716,11 +1716,11 @@ | |
| 1716 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1717 | @ FROM tag, tagxref |
| 1718 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 1719 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) |
| 1720 | @ || ')' as comment, |
| 1721 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim) |
| 1722 | @ AS primPlinkCount, |
| 1723 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) AS plinkCount, |
| 1724 | @ event.mtime AS mtime, |
| 1725 | @ tagxref.value AS branch |
| 1726 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 1727 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | int gidx; |
| 366 | static Stmt qparent; |
| 367 | db_static_prepare(&qparent, |
| 368 | "SELECT pid FROM plink" |
| 369 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 370 | " ORDER BY mseq>0 /*sort*/" |
| 371 | ); |
| 372 | db_bind_int(&qparent, ":rid", rid); |
| 373 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 374 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 375 | } |
| @@ -1716,11 +1716,11 @@ | |
| 1716 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1717 | @ FROM tag, tagxref |
| 1718 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 1719 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) |
| 1720 | @ || ')' as comment, |
| 1721 | @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND mseq=0) |
| 1722 | @ AS primPlinkCount, |
| 1723 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) AS plinkCount, |
| 1724 | @ event.mtime AS mtime, |
| 1725 | @ tagxref.value AS branch |
| 1726 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 1727 |