Fossil SCM

In "fossil rebuild" and "fossil deconstruct", leave an artifact alone when its content cannot be rebuilt because it is a delta from something that has not arrived. Rebuild recorded its size as zero, which stayed wrong after the source arrived, and deconstruct wrote an empty file.

dmestas 2026-11-13 23:39 UTC small-fixes-2
Commit 2c2b6af037bb4f048976286fbb7eb5b16895bc9493d8615ca1e118f8a25269ff
1 file changed +12 -4
+12 -4
--- src/rebuild.c
+++ src/rebuild.c
@@ -465,12 +465,16 @@
465465
int rid = db_column_int(&s, 0);
466466
int size = db_column_int(&s, 1);
467467
if( size>=0 ){
468468
if( !bag_find(&bagDone, rid) ){
469469
Blob content;
470
- content_get(rid, &content);
471
- rebuild_step(rid, size, &content);
470
+ if( content_get(rid, &content) ){
471
+ rebuild_step(rid, size, &content);
472
+ }else{
473
+ /* The content cannot be rebuilt. Leave the artifact as it is. */
474
+ rebuild_step_done(rid);
475
+ }
472476
}
473477
}else{
474478
db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
475479
rebuild_step_done(rid);
476480
}
@@ -1527,12 +1531,16 @@
15271531
int rid = db_column_int(&s, 0);
15281532
int size = db_column_int(&s, 1);
15291533
if( size>=0 ){
15301534
if( !bag_find(&bagDone, rid) ){
15311535
Blob content;
1532
- content_get(rid, &content);
1533
- rebuild_step(rid, size, &content);
1536
+ if( content_get(rid, &content) ){
1537
+ rebuild_step(rid, size, &content);
1538
+ }else{
1539
+ /* The content cannot be rebuilt. Leave the artifact as it is. */
1540
+ rebuild_step_done(rid);
1541
+ }
15341542
}
15351543
}
15361544
}
15371545
db_finalize(&s);
15381546
15391547
--- src/rebuild.c
+++ src/rebuild.c
@@ -465,12 +465,16 @@
465 int rid = db_column_int(&s, 0);
466 int size = db_column_int(&s, 1);
467 if( size>=0 ){
468 if( !bag_find(&bagDone, rid) ){
469 Blob content;
470 content_get(rid, &content);
471 rebuild_step(rid, size, &content);
 
 
 
 
472 }
473 }else{
474 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
475 rebuild_step_done(rid);
476 }
@@ -1527,12 +1531,16 @@
1527 int rid = db_column_int(&s, 0);
1528 int size = db_column_int(&s, 1);
1529 if( size>=0 ){
1530 if( !bag_find(&bagDone, rid) ){
1531 Blob content;
1532 content_get(rid, &content);
1533 rebuild_step(rid, size, &content);
 
 
 
 
1534 }
1535 }
1536 }
1537 db_finalize(&s);
1538
1539
--- src/rebuild.c
+++ src/rebuild.c
@@ -465,12 +465,16 @@
465 int rid = db_column_int(&s, 0);
466 int size = db_column_int(&s, 1);
467 if( size>=0 ){
468 if( !bag_find(&bagDone, rid) ){
469 Blob content;
470 if( content_get(rid, &content) ){
471 rebuild_step(rid, size, &content);
472 }else{
473 /* The content cannot be rebuilt. Leave the artifact as it is. */
474 rebuild_step_done(rid);
475 }
476 }
477 }else{
478 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
479 rebuild_step_done(rid);
480 }
@@ -1527,12 +1531,16 @@
1531 int rid = db_column_int(&s, 0);
1532 int size = db_column_int(&s, 1);
1533 if( size>=0 ){
1534 if( !bag_find(&bagDone, rid) ){
1535 Blob content;
1536 if( content_get(rid, &content) ){
1537 rebuild_step(rid, size, &content);
1538 }else{
1539 /* The content cannot be rebuilt. Leave the artifact as it is. */
1540 rebuild_step_done(rid);
1541 }
1542 }
1543 }
1544 }
1545 db_finalize(&s);
1546
1547

Keyboard Shortcuts

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