Fossil SCM

When adding a new artifact from a delta, read the delta header in order to insert the correct size into the blob table.

drh 2010-12-24 00:27 trunk
Commit 25e80d2e6efa8a713291bb29771cf19cdb88bd7e
1 file changed +8 -1
+8 -1
--- src/content.c
+++ src/content.c
@@ -451,11 +451,18 @@
451451
assert( nBlob==0 );
452452
sha1sum_blob(pBlob, &hash);
453453
}else{
454454
blob_init(&hash, zUuid, -1);
455455
}
456
- size = nBlob ? nBlob : blob_size(pBlob);
456
+ if( nBlob ){
457
+ size = nBlob;
458
+ }else{
459
+ size = blob_size(pBlob);
460
+ if( srcId ){
461
+ size = delta_output_size(blob_buffer(pBlob), size);
462
+ }
463
+ }
457464
db_begin_transaction();
458465
459466
/* Check to see if the entry already exists and if it does whether
460467
** or not the entry is a phantom
461468
*/
462469
--- src/content.c
+++ src/content.c
@@ -451,11 +451,18 @@
451 assert( nBlob==0 );
452 sha1sum_blob(pBlob, &hash);
453 }else{
454 blob_init(&hash, zUuid, -1);
455 }
456 size = nBlob ? nBlob : blob_size(pBlob);
 
 
 
 
 
 
 
457 db_begin_transaction();
458
459 /* Check to see if the entry already exists and if it does whether
460 ** or not the entry is a phantom
461 */
462
--- src/content.c
+++ src/content.c
@@ -451,11 +451,18 @@
451 assert( nBlob==0 );
452 sha1sum_blob(pBlob, &hash);
453 }else{
454 blob_init(&hash, zUuid, -1);
455 }
456 if( nBlob ){
457 size = nBlob;
458 }else{
459 size = blob_size(pBlob);
460 if( srcId ){
461 size = delta_output_size(blob_buffer(pBlob), size);
462 }
463 }
464 db_begin_transaction();
465
466 /* Check to see if the entry already exists and if it does whether
467 ** or not the entry is a phantom
468 */
469

Keyboard Shortcuts

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