| ︙ | | | ︙ | |
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
int rid, sz;
char z[UUID_SIZE+1];
sz = strlen(zUuid);
if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
return 0;
}
strcpy(z, zUuid);
canonical16(z, sz);
rid = fast_uuid_to_rid(z);
if( rid==0 && phantomize ){
rid = content_new(zUuid);
}
return rid;
}
|
|
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
int rid, sz;
char z[UUID_SIZE+1];
sz = strlen(zUuid);
if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
return 0;
}
memcpy(z, zUuid, UUID_SIZE+1);
canonical16(z, sz);
rid = fast_uuid_to_rid(z);
if( rid==0 && phantomize ){
rid = content_new(zUuid);
}
return rid;
}
|
| ︙ | | | ︙ | |
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
md5sum_step_text(zName, -1);
in = fopen(zFullpath,"rb");
if( in==0 ){
md5sum_step_text(" 0\n", -1);
continue;
}
fseek(in, 0L, SEEK_END);
sprintf(zBuf, " %ld\n", ftell(in));
fseek(in, 0L, SEEK_SET);
md5sum_step_text(zBuf, -1);
/*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/
for(;;){
int n;
n = fread(zBuf, 1, sizeof(zBuf), in);
if( n<=0 ) break;
|
|
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
md5sum_step_text(zName, -1);
in = fopen(zFullpath,"rb");
if( in==0 ){
md5sum_step_text(" 0\n", -1);
continue;
}
fseek(in, 0L, SEEK_END);
sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n", ftell(in));
fseek(in, 0L, SEEK_SET);
md5sum_step_text(zBuf, -1);
/*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/
for(;;){
int n;
n = fread(zBuf, 1, sizeof(zBuf), in);
if( n<=0 ) break;
|
| ︙ | | | ︙ | |
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
Blob file;
if( zOrigName ) zName = zOrigName;
if( rid>0 ){
md5sum_step_text(zName, -1);
blob_zero(&file);
content_get(rid, &file);
sprintf(zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
md5sum_step_blob(&file);
blob_reset(&file);
}
}
}
db_finalize(&q);
|
|
|
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
Blob file;
if( zOrigName ) zName = zOrigName;
if( rid>0 ){
md5sum_step_text(zName, -1);
blob_zero(&file);
content_get(rid, &file);
sqlite3_snprintf(sizeof(zBuf), zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
md5sum_step_blob(&file);
blob_reset(&file);
}
}
}
db_finalize(&q);
|
| ︙ | | | ︙ | |
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
|
const char *zName = db_column_text(&q, 0);
const char *zOrigName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
int isSelected = db_column_int(&q, 3);
if( zOrigName && !isSelected ) zName = zOrigName;
md5sum_step_text(zName, -1);
content_get(rid, &file);
sprintf(zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
/*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/
md5sum_step_blob(&file);
blob_reset(&file);
}
db_finalize(&q);
md5sum_finish(pOut);
|
|
|
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
|
const char *zName = db_column_text(&q, 0);
const char *zOrigName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
int isSelected = db_column_int(&q, 3);
if( zOrigName && !isSelected ) zName = zOrigName;
md5sum_step_text(zName, -1);
content_get(rid, &file);
sqlite3_snprintf(sizeof(zBuf), zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
/*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/
md5sum_step_blob(&file);
blob_reset(&file);
}
db_finalize(&q);
md5sum_finish(pOut);
|
| ︙ | | | ︙ | |
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
|
fossil_panic("manifest file (%d) is malformed", vid);
}
manifest_file_rewind(pManifest);
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
fid = uuid_to_rid(pFile->zUuid, 0);
md5sum_step_text(pFile->zName, -1);
content_get(fid, &file);
sprintf(zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
md5sum_step_blob(&file);
blob_reset(&file);
}
if( pManOut ){
if( pManifest->zRepoCksum ){
blob_append(pManOut, pManifest->zRepoCksum, -1);
|
|
|
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
|
fossil_panic("manifest file (%d) is malformed", vid);
}
manifest_file_rewind(pManifest);
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
fid = uuid_to_rid(pFile->zUuid, 0);
md5sum_step_text(pFile->zName, -1);
content_get(fid, &file);
sqlite3_snprintf(sizeof(zBuf), zBuf, " %d\n", blob_size(&file));
md5sum_step_text(zBuf, -1);
md5sum_step_blob(&file);
blob_reset(&file);
}
if( pManOut ){
if( pManifest->zRepoCksum ){
blob_append(pManOut, pManifest->zRepoCksum, -1);
|
| ︙ | | | ︙ | |