Fossil SCM
Fix bugs in the bundle generator logic.
Commit
8d94eab98a742e658ef8b44490789769796bdb70
Parent
09f67d5cbde3492…
2 files changed
+4
-3
+4
-4
+4
-3
| --- src/bundle.c | ||
| +++ src/bundle.c | ||
| @@ -246,11 +246,11 @@ | ||
| 246 | 246 | |
| 247 | 247 | /* Decode the arguments (like --branch) that specify which artifacts |
| 248 | 248 | ** should be in the bundle */ |
| 249 | 249 | db_multi_exec("CREATE TEMP TABLE tobundle(rid INTEGER PRIMARY KEY);"); |
| 250 | 250 | subtree_from_arguments("tobundle"); |
| 251 | - find_checkin_associates("tobundle", !bStandalone); | |
| 251 | + find_checkin_associates("tobundle", 0); | |
| 252 | 252 | verify_all_options(); |
| 253 | 253 | |
| 254 | 254 | /* Create the new bundle */ |
| 255 | 255 | bundle_attach_file(g.argv[3], "b1", 1); |
| 256 | 256 | db_begin_transaction(); |
| @@ -278,11 +278,12 @@ | ||
| 278 | 278 | " blob.size," |
| 279 | 279 | " delta.srcid," |
| 280 | 280 | " blob.content" |
| 281 | 281 | " FROM tobundle, blob, delta" |
| 282 | 282 | " WHERE blob.rid=tobundle.rid" |
| 283 | - " AND delta.rid=tobundle.rid;" | |
| 283 | + " AND delta.rid=tobundle.rid" | |
| 284 | + " AND delta.srcid IN tobundle;" | |
| 284 | 285 | ); |
| 285 | 286 | |
| 286 | 287 | /* For all the remaining artifacts, we need to construct their deltas |
| 287 | 288 | ** manually. |
| 288 | 289 | */ |
| @@ -560,11 +561,11 @@ | ||
| 560 | 561 | "INSERT INTO bix(blobid,delta)" |
| 561 | 562 | " SELECT blobid," |
| 562 | 563 | " CASE WHEN typeof(delta)=='integer'" |
| 563 | 564 | " THEN delta ELSE 0 END" |
| 564 | 565 | " 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);" | |
| 566 | 567 | ); |
| 567 | 568 | manifest_crosslink_begin(); |
| 568 | 569 | bundle_import_elements(0, 0, isPriv); |
| 569 | 570 | manifest_crosslink_end(0); |
| 570 | 571 | db_end_transaction(0); |
| 571 | 572 |
| --- 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 @@ | ||
| 567 | 567 | db_exec(&s1); |
| 568 | 568 | rid = db_last_insert_rowid(); |
| 569 | 569 | if( !pBlob ){ |
| 570 | 570 | db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid); |
| 571 | 571 | } |
| 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; | |
| 576 | 576 | } |
| 577 | 577 | if( nBlob==0 ) blob_reset(&cmpr); |
| 578 | 578 | |
| 579 | 579 | /* If the srcId is specified, then the data we just added is |
| 580 | 580 | ** really a delta. Record this fact in the delta table. |
| 581 | 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 | 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 |