Fossil SCM

Fix bugs in the bundle generator logic.

drh 2014-11-29 04:56 UTC DBP-workflow
Commit 8d94eab98a742e658ef8b44490789769796bdb70
2 files changed +4 -3 +4 -4
+4 -3
--- src/bundle.c
+++ src/bundle.c
@@ -246,11 +246,11 @@
246246
247247
/* Decode the arguments (like --branch) that specify which artifacts
248248
** should be in the bundle */
249249
db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);");
250250
subtree_from_arguments("tobundle");
251
- find_checkin_associates("tobundle", !bStandalone);
251
+ find_checkin_associates("tobundle", 0);
252252
verify_all_options();
253253
254254
/* Create the new bundle */
255255
bundle_attach_file(g.argv[3], "b1", 1);
256256
db_begin_transaction();
@@ -278,11 +278,12 @@
278278
" blob.size,"
279279
" delta.srcid,"
280280
" blob.content"
281281
" FROM tobundle, blob, delta"
282282
" WHERE blob.rid=tobundle.rid"
283
- " AND delta.rid=tobundle.rid;"
283
+ " AND delta.rid=tobundle.rid"
284
+ " AND delta.srcid IN tobundle;"
284285
);
285286
286287
/* For all the remaining artifacts, we need to construct their deltas
287288
** manually.
288289
*/
@@ -560,11 +561,11 @@
560561
"INSERT INTO bix(blobid,delta)"
561562
" SELECT blobid,"
562563
" CASE WHEN typeof(delta)=='integer'"
563564
" THEN delta ELSE 0 END"
564565
" FROM bblob"
565
- " WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid);"
566
+ " WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid AND size>=0);"
566567
);
567568
manifest_crosslink_begin();
568569
bundle_import_elements(0, 0, isPriv);
569570
manifest_crosslink_end(0);
570571
db_end_transaction(0);
571572
--- src/bundle.c
+++ src/bundle.c
@@ -246,11 +246,11 @@
246
247 /* Decode the arguments (like --branch) that specify which artifacts
248 ** should be in the bundle */
249 db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);");
250 subtree_from_arguments("tobundle");
251 find_checkin_associates("tobundle", !bStandalone);
252 verify_all_options();
253
254 /* Create the new bundle */
255 bundle_attach_file(g.argv[3], "b1", 1);
256 db_begin_transaction();
@@ -278,11 +278,12 @@
278 " blob.size,"
279 " delta.srcid,"
280 " blob.content"
281 " FROM tobundle, blob, delta"
282 " WHERE blob.rid=tobundle.rid"
283 " AND delta.rid=tobundle.rid;"
 
284 );
285
286 /* For all the remaining artifacts, we need to construct their deltas
287 ** manually.
288 */
@@ -560,11 +561,11 @@
560 "INSERT INTO bix(blobid,delta)"
561 " SELECT blobid,"
562 " CASE WHEN typeof(delta)=='integer'"
563 " THEN delta ELSE 0 END"
564 " FROM bblob"
565 " WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid);"
566 );
567 manifest_crosslink_begin();
568 bundle_import_elements(0, 0, isPriv);
569 manifest_crosslink_end(0);
570 db_end_transaction(0);
571
--- src/bundle.c
+++ src/bundle.c
@@ -246,11 +246,11 @@
246
247 /* Decode the arguments (like --branch) that specify which artifacts
248 ** should be in the bundle */
249 db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);");
250 subtree_from_arguments("tobundle");
251 find_checkin_associates("tobundle", 0);
252 verify_all_options();
253
254 /* Create the new bundle */
255 bundle_attach_file(g.argv[3], "b1", 1);
256 db_begin_transaction();
@@ -278,11 +278,12 @@
278 " blob.size,"
279 " delta.srcid,"
280 " blob.content"
281 " FROM tobundle, blob, delta"
282 " WHERE blob.rid=tobundle.rid"
283 " AND delta.rid=tobundle.rid"
284 " AND delta.srcid IN tobundle;"
285 );
286
287 /* For all the remaining artifacts, we need to construct their deltas
288 ** manually.
289 */
@@ -560,11 +561,11 @@
561 "INSERT INTO bix(blobid,delta)"
562 " SELECT blobid,"
563 " CASE WHEN typeof(delta)=='integer'"
564 " THEN delta ELSE 0 END"
565 " FROM bblob"
566 " WHERE NOT EXISTS(SELECT 1 FROM blob WHERE uuid=bblob.uuid AND size>=0);"
567 );
568 manifest_crosslink_begin();
569 bundle_import_elements(0, 0, isPriv);
570 manifest_crosslink_end(0);
571 db_end_transaction(0);
572
+4 -4
--- src/content.c
+++ src/content.c
@@ -567,14 +567,14 @@
567567
db_exec(&s1);
568568
rid = db_last_insert_rowid();
569569
if( !pBlob ){
570570
db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
571571
}
572
- if( g.markPrivate || isPrivate ){
573
- db_multi_exec("INSERT INTO private VALUES(%d)", rid);
574
- markAsUnclustered = 0;
575
- }
572
+ }
573
+ if( g.markPrivate || isPrivate ){
574
+ db_multi_exec("INSERT INTO private VALUES(%d)", rid);
575
+ markAsUnclustered = 0;
576576
}
577577
if( nBlob==0 ) blob_reset(&cmpr);
578578
579579
/* If the srcId is specified, then the data we just added is
580580
** really a delta. Record this fact in the delta table.
581581
--- src/content.c
+++ src/content.c
@@ -567,14 +567,14 @@
567 db_exec(&s1);
568 rid = db_last_insert_rowid();
569 if( !pBlob ){
570 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
571 }
572 if( g.markPrivate || isPrivate ){
573 db_multi_exec("INSERT INTO private VALUES(%d)", rid);
574 markAsUnclustered = 0;
575 }
576 }
577 if( nBlob==0 ) blob_reset(&cmpr);
578
579 /* If the srcId is specified, then the data we just added is
580 ** really a delta. Record this fact in the delta table.
581
--- src/content.c
+++ src/content.c
@@ -567,14 +567,14 @@
567 db_exec(&s1);
568 rid = db_last_insert_rowid();
569 if( !pBlob ){
570 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
571 }
572 }
573 if( g.markPrivate || isPrivate ){
574 db_multi_exec("INSERT INTO private VALUES(%d)", rid);
575 markAsUnclustered = 0;
576 }
577 if( nBlob==0 ) blob_reset(&cmpr);
578
579 /* If the srcId is specified, then the data we just added is
580 ** really a delta. Record this fact in the delta table.
581

Keyboard Shortcuts

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