Fossil SCM
Tag the manifest of every "private" checkin with the "private" tag. After the "reconstruct" command, add all private checkins to the private table. Ticket [e29ea5912afe1e97].
Commit
3b2d67d60454511832e273cf34c419039c0ae2d2
Parent
1ee56c4201a4017…
2 files changed
+9
-3
+15
+9
-3
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -665,18 +665,24 @@ | ||
| 665 | 665 | free(zDate); |
| 666 | 666 | |
| 667 | 667 | blob_appendf(pOut, "\n"); |
| 668 | 668 | if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum); |
| 669 | 669 | if( zBranch && zBranch[0] ){ |
| 670 | - Stmt q; | |
| 670 | + /* Set tags for the new branch */ | |
| 671 | 671 | if( zBgColor && zBgColor[0] ){ |
| 672 | 672 | blob_appendf(pOut, "T *bgcolor * %F\n", zBgColor); |
| 673 | 673 | } |
| 674 | 674 | blob_appendf(pOut, "T *branch * %F\n", zBranch); |
| 675 | 675 | blob_appendf(pOut, "T *sym-%F *\n", zBranch); |
| 676 | - | |
| 677 | - /* Cancel all other symbolic tags */ | |
| 676 | + } | |
| 677 | + if( g.markPrivate ){ | |
| 678 | + /* If this manifest is private, mark it as such */ | |
| 679 | + blob_appendf(pOut, "T +private *\n"); | |
| 680 | + } | |
| 681 | + if( zBranch && zBranch[0] ){ | |
| 682 | + /* For a new branch, cancel all prior propagating tags */ | |
| 683 | + Stmt q; | |
| 678 | 684 | db_prepare(&q, |
| 679 | 685 | "SELECT tagname FROM tagxref, tag" |
| 680 | 686 | " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid" |
| 681 | 687 | " AND tagtype>0 AND tagname GLOB 'sym-*'" |
| 682 | 688 | " AND tagname!='sym-'||%Q" |
| 683 | 689 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -665,18 +665,24 @@ | |
| 665 | free(zDate); |
| 666 | |
| 667 | blob_appendf(pOut, "\n"); |
| 668 | if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum); |
| 669 | if( zBranch && zBranch[0] ){ |
| 670 | Stmt q; |
| 671 | if( zBgColor && zBgColor[0] ){ |
| 672 | blob_appendf(pOut, "T *bgcolor * %F\n", zBgColor); |
| 673 | } |
| 674 | blob_appendf(pOut, "T *branch * %F\n", zBranch); |
| 675 | blob_appendf(pOut, "T *sym-%F *\n", zBranch); |
| 676 | |
| 677 | /* Cancel all other symbolic tags */ |
| 678 | db_prepare(&q, |
| 679 | "SELECT tagname FROM tagxref, tag" |
| 680 | " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid" |
| 681 | " AND tagtype>0 AND tagname GLOB 'sym-*'" |
| 682 | " AND tagname!='sym-'||%Q" |
| 683 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -665,18 +665,24 @@ | |
| 665 | free(zDate); |
| 666 | |
| 667 | blob_appendf(pOut, "\n"); |
| 668 | if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum); |
| 669 | if( zBranch && zBranch[0] ){ |
| 670 | /* Set tags for the new branch */ |
| 671 | if( zBgColor && zBgColor[0] ){ |
| 672 | blob_appendf(pOut, "T *bgcolor * %F\n", zBgColor); |
| 673 | } |
| 674 | blob_appendf(pOut, "T *branch * %F\n", zBranch); |
| 675 | blob_appendf(pOut, "T *sym-%F *\n", zBranch); |
| 676 | } |
| 677 | if( g.markPrivate ){ |
| 678 | /* If this manifest is private, mark it as such */ |
| 679 | blob_appendf(pOut, "T +private *\n"); |
| 680 | } |
| 681 | if( zBranch && zBranch[0] ){ |
| 682 | /* For a new branch, cancel all prior propagating tags */ |
| 683 | Stmt q; |
| 684 | db_prepare(&q, |
| 685 | "SELECT tagname FROM tagxref, tag" |
| 686 | " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid" |
| 687 | " AND tagtype>0 AND tagname GLOB 'sym-*'" |
| 688 | " AND tagname!='sym-'||%Q" |
| 689 |
+15
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -557,10 +557,25 @@ | ||
| 557 | 557 | printf("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 558 | 558 | recon_read_dir(g.argv[3]); |
| 559 | 559 | printf("\nBuilding the Fossil repository...\n"); |
| 560 | 560 | |
| 561 | 561 | rebuild_db(0, 1); |
| 562 | + | |
| 563 | + /* Reconstruct the private table. The private table contains the rid | |
| 564 | + ** of every manifest that is tagged with "private" and every file that | |
| 565 | + ** is not used by a manifest that is not private. | |
| 566 | + */ | |
| 567 | + db_multi_exec( | |
| 568 | + "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" | |
| 569 | + "INSERT INTO private_ckin " | |
| 570 | + " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" | |
| 571 | + "INSERT OR IGNORE INTO private" | |
| 572 | + " SELECT fid FROM mlink" | |
| 573 | + " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" | |
| 574 | + "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" | |
| 575 | + "DROP TABLE private_ckin;" | |
| 576 | + ); | |
| 562 | 577 | |
| 563 | 578 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 564 | 579 | ** will have been changed and verification therefore takes a really, really |
| 565 | 580 | ** long time. |
| 566 | 581 | */ |
| 567 | 582 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -557,10 +557,25 @@ | |
| 557 | printf("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 558 | recon_read_dir(g.argv[3]); |
| 559 | printf("\nBuilding the Fossil repository...\n"); |
| 560 | |
| 561 | rebuild_db(0, 1); |
| 562 | |
| 563 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 564 | ** will have been changed and verification therefore takes a really, really |
| 565 | ** long time. |
| 566 | */ |
| 567 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -557,10 +557,25 @@ | |
| 557 | printf("Reading files from directory \"%s\"...\n", g.argv[3]); |
| 558 | recon_read_dir(g.argv[3]); |
| 559 | printf("\nBuilding the Fossil repository...\n"); |
| 560 | |
| 561 | rebuild_db(0, 1); |
| 562 | |
| 563 | /* Reconstruct the private table. The private table contains the rid |
| 564 | ** of every manifest that is tagged with "private" and every file that |
| 565 | ** is not used by a manifest that is not private. |
| 566 | */ |
| 567 | db_multi_exec( |
| 568 | "CREATE TEMP TABLE private_ckin(rid INTEGER PRIMARY KEY);" |
| 569 | "INSERT INTO private_ckin " |
| 570 | " SELECT rid FROM tagxref WHERE tagid=%d AND tagtype>0;" |
| 571 | "INSERT OR IGNORE INTO private" |
| 572 | " SELECT fid FROM mlink" |
| 573 | " EXCEPT SELECT fid FROM mlink WHERE mid NOT IN private_ckin;" |
| 574 | "INSERT OR IGNORE INTO private SELECT rid FROM private_ckin;" |
| 575 | "DROP TABLE private_ckin;" |
| 576 | ); |
| 577 | |
| 578 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 579 | ** will have been changed and verification therefore takes a really, really |
| 580 | ** long time. |
| 581 | */ |
| 582 |