Fossil SCM

Add manifest.tags to generated zips, and decouple manifest and manifest.uuid.

jan 2016-01-04 00:28 jan-manifest-tags
Commit aed6fe5308202bd284da9d96bd1076cb932ae555
1 file changed +37 -13
+37 -13
--- src/zip.c
+++ src/zip.c
@@ -344,26 +344,50 @@
344344
}
345345
nPrefix = blob_size(&filename);
346346
347347
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
348348
if( pManifest ){
349
+ int flg;
349350
char *zName;
350351
zip_set_timedate(pManifest->rDate);
351
- if( db_get_boolean("manifest", 0) ){
352
- blob_append(&filename, "manifest", -1);
353
- zName = blob_str(&filename);
354
- zip_add_folders(zName);
355
- sha1sum_blob(&mfile, &hash);
356
- sterilize_manifest(&mfile);
357
- zip_add_file(zName, &mfile, 0);
352
+ flg = db_get_manifest_setting();
353
+ if( flg ){
354
+ if( flg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
355
+ if( flg & MFESTFLG_RAW ){
356
+ blob_append(&filename, "manifest", -1);
357
+ zName = blob_str(&filename);
358
+ zip_add_folders(zName);
359
+ }
360
+ if( flg & MFESTFLG_UUID ){
361
+ sha1sum_blob(&mfile, &hash);
362
+ }
363
+ if( flg & MFESTFLG_RAW ){
364
+ sterilize_manifest(&mfile);
365
+ zip_add_file(zName, &mfile, 0);
366
+ }
367
+ }
358368
blob_reset(&mfile);
359
- blob_append(&hash, "\n", 1);
360
- blob_resize(&filename, nPrefix);
361
- blob_append(&filename, "manifest.uuid", -1);
362
- zName = blob_str(&filename);
363
- zip_add_file(zName, &hash, 0);
364
- blob_reset(&hash);
369
+ if( flg & MFESTFLG_UUID ){
370
+ blob_append(&hash, "\n", 1);
371
+ blob_resize(&filename, nPrefix);
372
+ blob_append(&filename, "manifest.uuid", -1);
373
+ zName = blob_str(&filename);
374
+ zip_add_folders(zName);
375
+ zip_add_file(zName, &hash, 0);
376
+ blob_reset(&hash);
377
+ }
378
+ if( flg & MFESTFLG_TAGS ){
379
+ Blob tagslist;
380
+ blob_zero(&tagslist);
381
+ get_checkin_taglist(rid, &tagslist);
382
+ blob_resize(&filename, nPrefix);
383
+ blob_append(&filename, "manifest.tags", -1);
384
+ zName = blob_str(&filename);
385
+ zip_add_folders(zName);
386
+ zip_add_file(zName, &tagslist, 0);
387
+ blob_reset(&tagslist);
388
+ }
365389
}
366390
manifest_file_rewind(pManifest);
367391
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
368392
int fid = uuid_to_rid(pFile->zUuid, 0);
369393
if( fid ){
370394
--- src/zip.c
+++ src/zip.c
@@ -344,26 +344,50 @@
344 }
345 nPrefix = blob_size(&filename);
346
347 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
348 if( pManifest ){
 
349 char *zName;
350 zip_set_timedate(pManifest->rDate);
351 if( db_get_boolean("manifest", 0) ){
352 blob_append(&filename, "manifest", -1);
353 zName = blob_str(&filename);
354 zip_add_folders(zName);
355 sha1sum_blob(&mfile, &hash);
356 sterilize_manifest(&mfile);
357 zip_add_file(zName, &mfile, 0);
 
 
 
 
 
 
 
 
 
358 blob_reset(&mfile);
359 blob_append(&hash, "\n", 1);
360 blob_resize(&filename, nPrefix);
361 blob_append(&filename, "manifest.uuid", -1);
362 zName = blob_str(&filename);
363 zip_add_file(zName, &hash, 0);
364 blob_reset(&hash);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365 }
366 manifest_file_rewind(pManifest);
367 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
368 int fid = uuid_to_rid(pFile->zUuid, 0);
369 if( fid ){
370
--- src/zip.c
+++ src/zip.c
@@ -344,26 +344,50 @@
344 }
345 nPrefix = blob_size(&filename);
346
347 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
348 if( pManifest ){
349 int flg;
350 char *zName;
351 zip_set_timedate(pManifest->rDate);
352 flg = db_get_manifest_setting();
353 if( flg ){
354 if( flg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
355 if( flg & MFESTFLG_RAW ){
356 blob_append(&filename, "manifest", -1);
357 zName = blob_str(&filename);
358 zip_add_folders(zName);
359 }
360 if( flg & MFESTFLG_UUID ){
361 sha1sum_blob(&mfile, &hash);
362 }
363 if( flg & MFESTFLG_RAW ){
364 sterilize_manifest(&mfile);
365 zip_add_file(zName, &mfile, 0);
366 }
367 }
368 blob_reset(&mfile);
369 if( flg & MFESTFLG_UUID ){
370 blob_append(&hash, "\n", 1);
371 blob_resize(&filename, nPrefix);
372 blob_append(&filename, "manifest.uuid", -1);
373 zName = blob_str(&filename);
374 zip_add_folders(zName);
375 zip_add_file(zName, &hash, 0);
376 blob_reset(&hash);
377 }
378 if( flg & MFESTFLG_TAGS ){
379 Blob tagslist;
380 blob_zero(&tagslist);
381 get_checkin_taglist(rid, &tagslist);
382 blob_resize(&filename, nPrefix);
383 blob_append(&filename, "manifest.tags", -1);
384 zName = blob_str(&filename);
385 zip_add_folders(zName);
386 zip_add_file(zName, &tagslist, 0);
387 blob_reset(&tagslist);
388 }
389 }
390 manifest_file_rewind(pManifest);
391 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
392 int fid = uuid_to_rid(pFile->zUuid, 0);
393 if( fid ){
394

Keyboard Shortcuts

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