Fossil SCM

Fix some problems with tag propagation. More problems remain.

drh 2007-09-25 03:14 trunk
Commit 913608a5a6848d575a1abd75540274d1a2d8f83b
1 file changed +9
--- src/manifest.c
+++ src/manifest.c
@@ -515,10 +515,11 @@
515515
*/
516516
int manifest_crosslink(int rid, Blob *pContent){
517517
int i;
518518
Manifest m;
519519
Stmt q;
520
+ int parentid = 0;
520521
521522
if( manifest_parse(&m, pContent)==0 ){
522523
return 0;
523524
}
524525
db_begin_transaction();
@@ -528,10 +529,11 @@
528529
int pid = uuid_to_rid(m.azParent[i], 1);
529530
db_multi_exec("INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime)"
530531
"VALUES(%d, %d, %d, %.17g)", pid, rid, i==0, m.rDate);
531532
if( i==0 ){
532533
add_mlink(pid, 0, rid, &m);
534
+ parentid = pid;
533535
}
534536
}
535537
db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d AND isprim", rid);
536538
while( db_step(&q)==SQLITE_ROW ){
537539
int cid = db_column_int(&q, 0);
@@ -564,11 +566,18 @@
564566
case '*': type = 2; break;
565567
case '-': type = 0; break;
566568
}
567569
tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
568570
rid, m.rDate, tid);
571
+ if( tid!=rid ){
572
+ tag_propagate_all(tid);
573
+ }
574
+ }
575
+ if( parentid ){
576
+ tag_propagate_all(parentid);
569577
}
578
+ tag_propagate_all(rid);
570579
}
571580
db_end_transaction(0);
572581
manifest_clear(&m);
573582
return 1;
574583
}
575584
--- src/manifest.c
+++ src/manifest.c
@@ -515,10 +515,11 @@
515 */
516 int manifest_crosslink(int rid, Blob *pContent){
517 int i;
518 Manifest m;
519 Stmt q;
 
520
521 if( manifest_parse(&m, pContent)==0 ){
522 return 0;
523 }
524 db_begin_transaction();
@@ -528,10 +529,11 @@
528 int pid = uuid_to_rid(m.azParent[i], 1);
529 db_multi_exec("INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime)"
530 "VALUES(%d, %d, %d, %.17g)", pid, rid, i==0, m.rDate);
531 if( i==0 ){
532 add_mlink(pid, 0, rid, &m);
 
533 }
534 }
535 db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d AND isprim", rid);
536 while( db_step(&q)==SQLITE_ROW ){
537 int cid = db_column_int(&q, 0);
@@ -564,11 +566,18 @@
564 case '*': type = 2; break;
565 case '-': type = 0; break;
566 }
567 tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
568 rid, m.rDate, tid);
 
 
 
 
 
 
569 }
 
570 }
571 db_end_transaction(0);
572 manifest_clear(&m);
573 return 1;
574 }
575
--- src/manifest.c
+++ src/manifest.c
@@ -515,10 +515,11 @@
515 */
516 int manifest_crosslink(int rid, Blob *pContent){
517 int i;
518 Manifest m;
519 Stmt q;
520 int parentid = 0;
521
522 if( manifest_parse(&m, pContent)==0 ){
523 return 0;
524 }
525 db_begin_transaction();
@@ -528,10 +529,11 @@
529 int pid = uuid_to_rid(m.azParent[i], 1);
530 db_multi_exec("INSERT OR IGNORE INTO plink(pid, cid, isprim, mtime)"
531 "VALUES(%d, %d, %d, %.17g)", pid, rid, i==0, m.rDate);
532 if( i==0 ){
533 add_mlink(pid, 0, rid, &m);
534 parentid = pid;
535 }
536 }
537 db_prepare(&q, "SELECT cid FROM plink WHERE pid=%d AND isprim", rid);
538 while( db_step(&q)==SQLITE_ROW ){
539 int cid = db_column_int(&q, 0);
@@ -564,11 +566,18 @@
566 case '*': type = 2; break;
567 case '-': type = 0; break;
568 }
569 tag_insert(&m.aTag[i].zName[1], type, m.aTag[i].zValue,
570 rid, m.rDate, tid);
571 if( tid!=rid ){
572 tag_propagate_all(tid);
573 }
574 }
575 if( parentid ){
576 tag_propagate_all(parentid);
577 }
578 tag_propagate_all(rid);
579 }
580 db_end_transaction(0);
581 manifest_clear(&m);
582 return 1;
583 }
584

Keyboard Shortcuts

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