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].

drh 2010-11-24 21:32 trunk
Commit 3b2d67d60454511832e273cf34c419039c0ae2d2
2 files changed +9 -3 +15
+9 -3
--- src/checkin.c
+++ src/checkin.c
@@ -665,18 +665,24 @@
665665
free(zDate);
666666
667667
blob_appendf(pOut, "\n");
668668
if( pCksum ) blob_appendf(pOut, "R %b\n", pCksum);
669669
if( zBranch && zBranch[0] ){
670
- Stmt q;
670
+ /* Set tags for the new branch */
671671
if( zBgColor && zBgColor[0] ){
672672
blob_appendf(pOut, "T *bgcolor * %F\n", zBgColor);
673673
}
674674
blob_appendf(pOut, "T *branch * %F\n", zBranch);
675675
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;
678684
db_prepare(&q,
679685
"SELECT tagname FROM tagxref, tag"
680686
" WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
681687
" AND tagtype>0 AND tagname GLOB 'sym-*'"
682688
" AND tagname!='sym-'||%Q"
683689
--- 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
--- src/rebuild.c
+++ src/rebuild.c
@@ -557,10 +557,25 @@
557557
printf("Reading files from directory \"%s\"...\n", g.argv[3]);
558558
recon_read_dir(g.argv[3]);
559559
printf("\nBuilding the Fossil repository...\n");
560560
561561
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
+ );
562577
563578
/* Skip the verify_before_commit() step on a reconstruct. Most artifacts
564579
** will have been changed and verification therefore takes a really, really
565580
** long time.
566581
*/
567582
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button