Fossil SCM
Better error message in case of "manifest file (12892) is malformed". It will now give an additional line: "line ???: wrong size UUID on P-card" (or whatever other parsing error happens), and using the "-n" option it will print out the complete manifest as well. This would have made it much easier to investigate Ron Aaron's commit problem (many thanks for reporting this!), without adding special debugging code to fossil.
Commit
ec81aee9156f43f45021592062d70d2829f43703
Parent
6d1c038c6279339…
22 files changed
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+4
-4
+1
-1
+1
-1
+1
-1
+3
-3
+4
-4
+1
-1
+1
-1
+3
-3
+1
-1
+6
-3
+6
-3
+6
-6
+1
-1
~
src/attach.c
~
src/branch.c
~
src/browse.c
~
src/checkin.c
~
src/checkout.c
~
src/doc.c
~
src/event.c
~
src/import.c
~
src/info.c
~
src/json_artifact.c
~
src/json_branch.c
~
src/json_timeline.c
~
src/json_wiki.c
~
src/manifest.c
~
src/rebuild.c
~
src/tar.c
~
src/tkt.c
~
src/update.c
~
src/vfile.c
~
src/vfile.c
~
src/wiki.c
~
src/zip.c
+1
-1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -384,11 +384,11 @@ | ||
| 384 | 384 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 385 | 385 | g.zTop, zUuid); |
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | #endif |
| 389 | - pAttach = manifest_get(rid, CFTYPE_ATTACHMENT); | |
| 389 | + pAttach = manifest_get(rid, CFTYPE_ATTACHMENT, 0); | |
| 390 | 390 | if( pAttach==0 ) fossil_redirect_home(); |
| 391 | 391 | zTarget = pAttach->zAttachTarget; |
| 392 | 392 | zSrc = pAttach->zAttachSrc; |
| 393 | 393 | ridSrc = db_int(0,"SELECT rid FROM blob WHERE uuid='%s'", zSrc); |
| 394 | 394 | zName = pAttach->zAttachName; |
| 395 | 395 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -384,11 +384,11 @@ | |
| 384 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 385 | g.zTop, zUuid); |
| 386 | } |
| 387 | } |
| 388 | #endif |
| 389 | pAttach = manifest_get(rid, CFTYPE_ATTACHMENT); |
| 390 | if( pAttach==0 ) fossil_redirect_home(); |
| 391 | zTarget = pAttach->zAttachTarget; |
| 392 | zSrc = pAttach->zAttachSrc; |
| 393 | ridSrc = db_int(0,"SELECT rid FROM blob WHERE uuid='%s'", zSrc); |
| 394 | zName = pAttach->zAttachName; |
| 395 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -384,11 +384,11 @@ | |
| 384 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 385 | g.zTop, zUuid); |
| 386 | } |
| 387 | } |
| 388 | #endif |
| 389 | pAttach = manifest_get(rid, CFTYPE_ATTACHMENT, 0); |
| 390 | if( pAttach==0 ) fossil_redirect_home(); |
| 391 | zTarget = pAttach->zAttachTarget; |
| 392 | zSrc = pAttach->zAttachSrc; |
| 393 | ridSrc = db_int(0,"SELECT rid FROM blob WHERE uuid='%s'", zSrc); |
| 394 | zName = pAttach->zAttachName; |
| 395 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -73,11 +73,11 @@ | ||
| 73 | 73 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 74 | 74 | if( rootid==0 ){ |
| 75 | 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - pParent = manifest_get(rootid, CFTYPE_MANIFEST); | |
| 78 | + pParent = manifest_get(rootid, CFTYPE_MANIFEST, 0); | |
| 79 | 79 | if( pParent==0 ){ |
| 80 | 80 | fossil_fatal("%s is not a valid check-in", g.argv[4]); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* Create a manifest for the new branch */ |
| 84 | 84 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -73,11 +73,11 @@ | |
| 73 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 74 | if( rootid==0 ){ |
| 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | } |
| 77 | |
| 78 | pParent = manifest_get(rootid, CFTYPE_MANIFEST); |
| 79 | if( pParent==0 ){ |
| 80 | fossil_fatal("%s is not a valid check-in", g.argv[4]); |
| 81 | } |
| 82 | |
| 83 | /* Create a manifest for the new branch */ |
| 84 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -73,11 +73,11 @@ | |
| 73 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 74 | if( rootid==0 ){ |
| 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | } |
| 77 | |
| 78 | pParent = manifest_get(rootid, CFTYPE_MANIFEST, 0); |
| 79 | if( pParent==0 ){ |
| 80 | fossil_fatal("%s is not a valid check-in", g.argv[4]); |
| 81 | } |
| 82 | |
| 83 | /* Create a manifest for the new branch */ |
| 84 |
+1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -331,11 +331,11 @@ | ||
| 331 | 331 | " mtime DATETIME," |
| 332 | 332 | " pathname TEXT" |
| 333 | 333 | ");" |
| 334 | 334 | "CREATE INDEX fileage_fid ON fileage(fid);" |
| 335 | 335 | ); |
| 336 | - pManifest = manifest_get(vid, CFTYPE_MANIFEST); | |
| 336 | + pManifest = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 337 | 337 | if( pManifest==0 ) return 1; |
| 338 | 338 | manifest_file_rewind(pManifest); |
| 339 | 339 | db_prepare(&ins, |
| 340 | 340 | "INSERT INTO temp.fileage(fid, pathname)" |
| 341 | 341 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 342 | 342 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -331,11 +331,11 @@ | |
| 331 | " mtime DATETIME," |
| 332 | " pathname TEXT" |
| 333 | ");" |
| 334 | "CREATE INDEX fileage_fid ON fileage(fid);" |
| 335 | ); |
| 336 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 337 | if( pManifest==0 ) return 1; |
| 338 | manifest_file_rewind(pManifest); |
| 339 | db_prepare(&ins, |
| 340 | "INSERT INTO temp.fileage(fid, pathname)" |
| 341 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 342 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -331,11 +331,11 @@ | |
| 331 | " mtime DATETIME," |
| 332 | " pathname TEXT" |
| 333 | ");" |
| 334 | "CREATE INDEX fileage_fid ON fileage(fid);" |
| 335 | ); |
| 336 | pManifest = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 337 | if( pManifest==0 ) return 1; |
| 338 | manifest_file_rewind(pManifest); |
| 339 | db_prepare(&ins, |
| 340 | "INSERT INTO temp.fileage(fid, pathname)" |
| 341 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 342 |
+1
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1730,11 +1730,11 @@ | ||
| 1730 | 1730 | /* See if a delta-manifest would be more appropriate */ |
| 1731 | 1731 | if( !forceBaseline ){ |
| 1732 | 1732 | const char *zBaselineUuid; |
| 1733 | 1733 | Manifest *pParent; |
| 1734 | 1734 | Manifest *pBaseline; |
| 1735 | - pParent = manifest_get(vid, CFTYPE_MANIFEST); | |
| 1735 | + pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 1736 | 1736 | if( pParent && pParent->zBaseline ){ |
| 1737 | 1737 | zBaselineUuid = pParent->zBaseline; |
| 1738 | 1738 | pBaseline = manifest_get_by_name(zBaselineUuid, 0); |
| 1739 | 1739 | }else{ |
| 1740 | 1740 | zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 1741 | 1741 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1730,11 +1730,11 @@ | |
| 1730 | /* See if a delta-manifest would be more appropriate */ |
| 1731 | if( !forceBaseline ){ |
| 1732 | const char *zBaselineUuid; |
| 1733 | Manifest *pParent; |
| 1734 | Manifest *pBaseline; |
| 1735 | pParent = manifest_get(vid, CFTYPE_MANIFEST); |
| 1736 | if( pParent && pParent->zBaseline ){ |
| 1737 | zBaselineUuid = pParent->zBaseline; |
| 1738 | pBaseline = manifest_get_by_name(zBaselineUuid, 0); |
| 1739 | }else{ |
| 1740 | zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 1741 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1730,11 +1730,11 @@ | |
| 1730 | /* See if a delta-manifest would be more appropriate */ |
| 1731 | if( !forceBaseline ){ |
| 1732 | const char *zBaselineUuid; |
| 1733 | Manifest *pParent; |
| 1734 | Manifest *pBaseline; |
| 1735 | pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 1736 | if( pParent && pParent->zBaseline ){ |
| 1737 | zBaselineUuid = pParent->zBaseline; |
| 1738 | pBaseline = manifest_get_by_name(zBaselineUuid, 0); |
| 1739 | }else{ |
| 1740 | zBaselineUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 1741 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -103,11 +103,11 @@ | ||
| 103 | 103 | Manifest *pManifest; |
| 104 | 104 | ManifestFile *pFile; |
| 105 | 105 | |
| 106 | 106 | /* Check the EXE permission status of all files |
| 107 | 107 | */ |
| 108 | - pManifest = manifest_get(vid, CFTYPE_MANIFEST); | |
| 108 | + pManifest = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 109 | 109 | if( pManifest==0 ) return; |
| 110 | 110 | blob_zero(&filename); |
| 111 | 111 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 112 | 112 | baseLen = blob_size(&filename); |
| 113 | 113 | manifest_file_rewind(pManifest); |
| 114 | 114 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -103,11 +103,11 @@ | |
| 103 | Manifest *pManifest; |
| 104 | ManifestFile *pFile; |
| 105 | |
| 106 | /* Check the EXE permission status of all files |
| 107 | */ |
| 108 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 109 | if( pManifest==0 ) return; |
| 110 | blob_zero(&filename); |
| 111 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 112 | baseLen = blob_size(&filename); |
| 113 | manifest_file_rewind(pManifest); |
| 114 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -103,11 +103,11 @@ | |
| 103 | Manifest *pManifest; |
| 104 | ManifestFile *pFile; |
| 105 | |
| 106 | /* Check the EXE permission status of all files |
| 107 | */ |
| 108 | pManifest = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 109 | if( pManifest==0 ) return; |
| 110 | blob_zero(&filename); |
| 111 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 112 | baseLen = blob_size(&filename); |
| 113 | manifest_file_rewind(pManifest); |
| 114 |
+1
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -449,11 +449,11 @@ | ||
| 449 | 449 | |
| 450 | 450 | /* Add the vid baseline to the cache */ |
| 451 | 451 | if( db_int(0, "SELECT count(*) FROM vcache")>10000 ){ |
| 452 | 452 | db_multi_exec("DELETE FROM vcache"); |
| 453 | 453 | } |
| 454 | - pM = manifest_get(vid, CFTYPE_MANIFEST); | |
| 454 | + pM = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 455 | 455 | if( pM==0 ){ |
| 456 | 456 | goto doc_not_found; |
| 457 | 457 | } |
| 458 | 458 | db_prepare(&s, |
| 459 | 459 | "INSERT INTO vcache(vid,fname,rid)" |
| 460 | 460 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -449,11 +449,11 @@ | |
| 449 | |
| 450 | /* Add the vid baseline to the cache */ |
| 451 | if( db_int(0, "SELECT count(*) FROM vcache")>10000 ){ |
| 452 | db_multi_exec("DELETE FROM vcache"); |
| 453 | } |
| 454 | pM = manifest_get(vid, CFTYPE_MANIFEST); |
| 455 | if( pM==0 ){ |
| 456 | goto doc_not_found; |
| 457 | } |
| 458 | db_prepare(&s, |
| 459 | "INSERT INTO vcache(vid,fname,rid)" |
| 460 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -449,11 +449,11 @@ | |
| 449 | |
| 450 | /* Add the vid baseline to the cache */ |
| 451 | if( db_int(0, "SELECT count(*) FROM vcache")>10000 ){ |
| 452 | db_multi_exec("DELETE FROM vcache"); |
| 453 | } |
| 454 | pM = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 455 | if( pM==0 ){ |
| 456 | goto doc_not_found; |
| 457 | } |
| 458 | db_prepare(&s, |
| 459 | "INSERT INTO vcache(vid,fname,rid)" |
| 460 |
+2
-2
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -113,11 +113,11 @@ | ||
| 113 | 113 | } |
| 114 | 114 | verboseFlag = (zVerbose!=0) && !is_false(zVerbose); |
| 115 | 115 | |
| 116 | 116 | /* Extract the event content. |
| 117 | 117 | */ |
| 118 | - pEvent = manifest_get(rid, CFTYPE_EVENT); | |
| 118 | + pEvent = manifest_get(rid, CFTYPE_EVENT, 0); | |
| 119 | 119 | if( pEvent==0 ){ |
| 120 | 120 | fossil_fatal("Object #%d is not an event", rid); |
| 121 | 121 | } |
| 122 | 122 | blob_init(&fullbody, pEvent->zWiki, -1); |
| 123 | 123 | if( wiki_find_title(&fullbody, &title, &tail) ){ |
| @@ -257,11 +257,11 @@ | ||
| 257 | 257 | /* If editing an existing event, extract the key fields to use as |
| 258 | 258 | ** a starting point for the edit. |
| 259 | 259 | */ |
| 260 | 260 | if( rid && (zBody==0 || zETime==0 || zComment==0 || zTags==0) ){ |
| 261 | 261 | Manifest *pEvent; |
| 262 | - pEvent = manifest_get(rid, CFTYPE_EVENT); | |
| 262 | + pEvent = manifest_get(rid, CFTYPE_EVENT, 0); | |
| 263 | 263 | if( pEvent && pEvent->type==CFTYPE_EVENT ){ |
| 264 | 264 | if( zBody==0 ) zBody = pEvent->zWiki; |
| 265 | 265 | if( zETime==0 ){ |
| 266 | 266 | zETime = db_text(0, "SELECT datetime(%.17g)", pEvent->rEventDate); |
| 267 | 267 | } |
| 268 | 268 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -113,11 +113,11 @@ | |
| 113 | } |
| 114 | verboseFlag = (zVerbose!=0) && !is_false(zVerbose); |
| 115 | |
| 116 | /* Extract the event content. |
| 117 | */ |
| 118 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 119 | if( pEvent==0 ){ |
| 120 | fossil_fatal("Object #%d is not an event", rid); |
| 121 | } |
| 122 | blob_init(&fullbody, pEvent->zWiki, -1); |
| 123 | if( wiki_find_title(&fullbody, &title, &tail) ){ |
| @@ -257,11 +257,11 @@ | |
| 257 | /* If editing an existing event, extract the key fields to use as |
| 258 | ** a starting point for the edit. |
| 259 | */ |
| 260 | if( rid && (zBody==0 || zETime==0 || zComment==0 || zTags==0) ){ |
| 261 | Manifest *pEvent; |
| 262 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 263 | if( pEvent && pEvent->type==CFTYPE_EVENT ){ |
| 264 | if( zBody==0 ) zBody = pEvent->zWiki; |
| 265 | if( zETime==0 ){ |
| 266 | zETime = db_text(0, "SELECT datetime(%.17g)", pEvent->rEventDate); |
| 267 | } |
| 268 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -113,11 +113,11 @@ | |
| 113 | } |
| 114 | verboseFlag = (zVerbose!=0) && !is_false(zVerbose); |
| 115 | |
| 116 | /* Extract the event content. |
| 117 | */ |
| 118 | pEvent = manifest_get(rid, CFTYPE_EVENT, 0); |
| 119 | if( pEvent==0 ){ |
| 120 | fossil_fatal("Object #%d is not an event", rid); |
| 121 | } |
| 122 | blob_init(&fullbody, pEvent->zWiki, -1); |
| 123 | if( wiki_find_title(&fullbody, &title, &tail) ){ |
| @@ -257,11 +257,11 @@ | |
| 257 | /* If editing an existing event, extract the key fields to use as |
| 258 | ** a starting point for the edit. |
| 259 | */ |
| 260 | if( rid && (zBody==0 || zETime==0 || zComment==0 || zTags==0) ){ |
| 261 | Manifest *pEvent; |
| 262 | pEvent = manifest_get(rid, CFTYPE_EVENT, 0); |
| 263 | if( pEvent && pEvent->type==CFTYPE_EVENT ){ |
| 264 | if( zBody==0 ) zBody = pEvent->zWiki; |
| 265 | if( zETime==0 ){ |
| 266 | zETime = db_text(0, "SELECT datetime(%.17g)", pEvent->rEventDate); |
| 267 | } |
| 268 |
+1
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -419,11 +419,11 @@ | ||
| 419 | 419 | gg.zPrevCheckin = 0; |
| 420 | 420 | } |
| 421 | 421 | if( gg.zFrom==0 ) return; |
| 422 | 422 | rid = fast_uuid_to_rid(gg.zFrom); |
| 423 | 423 | if( rid==0 ) return; |
| 424 | - p = manifest_get(rid, CFTYPE_MANIFEST); | |
| 424 | + p = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 425 | 425 | if( p==0 ) return; |
| 426 | 426 | manifest_file_rewind(p); |
| 427 | 427 | while( (pOld = manifest_file_next(p, 0))!=0 ){ |
| 428 | 428 | pNew = import_add_file(); |
| 429 | 429 | pNew->zName = fossil_strdup(pOld->zName); |
| 430 | 430 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -419,11 +419,11 @@ | |
| 419 | gg.zPrevCheckin = 0; |
| 420 | } |
| 421 | if( gg.zFrom==0 ) return; |
| 422 | rid = fast_uuid_to_rid(gg.zFrom); |
| 423 | if( rid==0 ) return; |
| 424 | p = manifest_get(rid, CFTYPE_MANIFEST); |
| 425 | if( p==0 ) return; |
| 426 | manifest_file_rewind(p); |
| 427 | while( (pOld = manifest_file_next(p, 0))!=0 ){ |
| 428 | pNew = import_add_file(); |
| 429 | pNew->zName = fossil_strdup(pOld->zName); |
| 430 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -419,11 +419,11 @@ | |
| 419 | gg.zPrevCheckin = 0; |
| 420 | } |
| 421 | if( gg.zFrom==0 ) return; |
| 422 | rid = fast_uuid_to_rid(gg.zFrom); |
| 423 | if( rid==0 ) return; |
| 424 | p = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 425 | if( p==0 ) return; |
| 426 | manifest_file_rewind(p); |
| 427 | while( (pOld = manifest_file_next(p, 0))!=0 ){ |
| 428 | pNew = import_add_file(); |
| 429 | pNew->zName = fossil_strdup(pOld->zName); |
| 430 |
+4
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -723,11 +723,11 @@ | ||
| 723 | 723 | const char *zModAction; |
| 724 | 724 | |
| 725 | 725 | login_check_credentials(); |
| 726 | 726 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 727 | 727 | rid = name_to_rid_www("name"); |
| 728 | - if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI))==0 ){ | |
| 728 | + if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){ | |
| 729 | 729 | style_header("Wiki Page Information Error"); |
| 730 | 730 | @ No such object: %h(P("name")) |
| 731 | 731 | style_footer(); |
| 732 | 732 | return; |
| 733 | 733 | } |
| @@ -834,11 +834,11 @@ | ||
| 834 | 834 | } |
| 835 | 835 | if( !is_a_version(rid) ){ |
| 836 | 836 | webpage_error("Artifact %s is not a checkin.", P(zParam)); |
| 837 | 837 | return 0; |
| 838 | 838 | } |
| 839 | - return manifest_get(rid, CFTYPE_MANIFEST); | |
| 839 | + return manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | /* |
| 843 | 843 | ** Output a description of a check-in |
| 844 | 844 | */ |
| @@ -1485,11 +1485,11 @@ | ||
| 1485 | 1485 | zCI = P("ci"); |
| 1486 | 1486 | if( zCI==0 ) return 0; |
| 1487 | 1487 | zFilename = P("filename"); |
| 1488 | 1488 | if( zFilename==0 ) return 0; |
| 1489 | 1489 | cirid = name_to_rid_www("ci"); |
| 1490 | - pManifest = manifest_get(cirid, CFTYPE_MANIFEST); | |
| 1490 | + pManifest = manifest_get(cirid, CFTYPE_MANIFEST, 0); | |
| 1491 | 1491 | if( pManifest==0 ) return 0; |
| 1492 | 1492 | manifest_file_rewind(pManifest); |
| 1493 | 1493 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 1494 | 1494 | if( fossil_strcmp(zFilename, pFile->zName)==0 ){ |
| 1495 | 1495 | int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid); |
| @@ -1708,11 +1708,11 @@ | ||
| 1708 | 1708 | }else{ |
| 1709 | 1709 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 1710 | 1710 | g.zTop, zUuid); |
| 1711 | 1711 | } |
| 1712 | 1712 | } |
| 1713 | - pTktChng = manifest_get(rid, CFTYPE_TICKET); | |
| 1713 | + pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 1714 | 1714 | if( pTktChng==0 ) fossil_redirect_home(); |
| 1715 | 1715 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1716 | 1716 | memcpy(zTktName, pTktChng->zTicketUuid, UUID_SIZE+1); |
| 1717 | 1717 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 1718 | 1718 | if( strcmp(zModAction,"delete")==0 ){ |
| 1719 | 1719 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -723,11 +723,11 @@ | |
| 723 | const char *zModAction; |
| 724 | |
| 725 | login_check_credentials(); |
| 726 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 727 | rid = name_to_rid_www("name"); |
| 728 | if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI))==0 ){ |
| 729 | style_header("Wiki Page Information Error"); |
| 730 | @ No such object: %h(P("name")) |
| 731 | style_footer(); |
| 732 | return; |
| 733 | } |
| @@ -834,11 +834,11 @@ | |
| 834 | } |
| 835 | if( !is_a_version(rid) ){ |
| 836 | webpage_error("Artifact %s is not a checkin.", P(zParam)); |
| 837 | return 0; |
| 838 | } |
| 839 | return manifest_get(rid, CFTYPE_MANIFEST); |
| 840 | } |
| 841 | |
| 842 | /* |
| 843 | ** Output a description of a check-in |
| 844 | */ |
| @@ -1485,11 +1485,11 @@ | |
| 1485 | zCI = P("ci"); |
| 1486 | if( zCI==0 ) return 0; |
| 1487 | zFilename = P("filename"); |
| 1488 | if( zFilename==0 ) return 0; |
| 1489 | cirid = name_to_rid_www("ci"); |
| 1490 | pManifest = manifest_get(cirid, CFTYPE_MANIFEST); |
| 1491 | if( pManifest==0 ) return 0; |
| 1492 | manifest_file_rewind(pManifest); |
| 1493 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 1494 | if( fossil_strcmp(zFilename, pFile->zName)==0 ){ |
| 1495 | int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid); |
| @@ -1708,11 +1708,11 @@ | |
| 1708 | }else{ |
| 1709 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 1710 | g.zTop, zUuid); |
| 1711 | } |
| 1712 | } |
| 1713 | pTktChng = manifest_get(rid, CFTYPE_TICKET); |
| 1714 | if( pTktChng==0 ) fossil_redirect_home(); |
| 1715 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1716 | memcpy(zTktName, pTktChng->zTicketUuid, UUID_SIZE+1); |
| 1717 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 1718 | if( strcmp(zModAction,"delete")==0 ){ |
| 1719 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -723,11 +723,11 @@ | |
| 723 | const char *zModAction; |
| 724 | |
| 725 | login_check_credentials(); |
| 726 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 727 | rid = name_to_rid_www("name"); |
| 728 | if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){ |
| 729 | style_header("Wiki Page Information Error"); |
| 730 | @ No such object: %h(P("name")) |
| 731 | style_footer(); |
| 732 | return; |
| 733 | } |
| @@ -834,11 +834,11 @@ | |
| 834 | } |
| 835 | if( !is_a_version(rid) ){ |
| 836 | webpage_error("Artifact %s is not a checkin.", P(zParam)); |
| 837 | return 0; |
| 838 | } |
| 839 | return manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 840 | } |
| 841 | |
| 842 | /* |
| 843 | ** Output a description of a check-in |
| 844 | */ |
| @@ -1485,11 +1485,11 @@ | |
| 1485 | zCI = P("ci"); |
| 1486 | if( zCI==0 ) return 0; |
| 1487 | zFilename = P("filename"); |
| 1488 | if( zFilename==0 ) return 0; |
| 1489 | cirid = name_to_rid_www("ci"); |
| 1490 | pManifest = manifest_get(cirid, CFTYPE_MANIFEST, 0); |
| 1491 | if( pManifest==0 ) return 0; |
| 1492 | manifest_file_rewind(pManifest); |
| 1493 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 1494 | if( fossil_strcmp(zFilename, pFile->zName)==0 ){ |
| 1495 | int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid); |
| @@ -1708,11 +1708,11 @@ | |
| 1708 | }else{ |
| 1709 | style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun", |
| 1710 | g.zTop, zUuid); |
| 1711 | } |
| 1712 | } |
| 1713 | pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); |
| 1714 | if( pTktChng==0 ) fossil_redirect_home(); |
| 1715 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1716 | memcpy(zTktName, pTktChng->zTicketUuid, UUID_SIZE+1); |
| 1717 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 1718 | if( strcmp(zModAction,"delete")==0 ){ |
| 1719 |
+1
-1
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -192,11 +192,11 @@ | ||
| 192 | 192 | if(!eventTypeLabel){ |
| 193 | 193 | eventTypeLabel = json_new_string("ticket"); |
| 194 | 194 | json_gc_add("$EVENT_TYPE_LABEL(ticket)", eventTypeLabel); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - pTktChng = manifest_get(rid, CFTYPE_TICKET); | |
| 197 | + pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 198 | 198 | if( pTktChng==0 ){ |
| 199 | 199 | g.json.resultCode = FSL_JSON_E_MANIFEST_READ_FAILED; |
| 200 | 200 | return NULL; |
| 201 | 201 | } |
| 202 | 202 | pay = cson_new_object(); |
| 203 | 203 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -192,11 +192,11 @@ | |
| 192 | if(!eventTypeLabel){ |
| 193 | eventTypeLabel = json_new_string("ticket"); |
| 194 | json_gc_add("$EVENT_TYPE_LABEL(ticket)", eventTypeLabel); |
| 195 | } |
| 196 | |
| 197 | pTktChng = manifest_get(rid, CFTYPE_TICKET); |
| 198 | if( pTktChng==0 ){ |
| 199 | g.json.resultCode = FSL_JSON_E_MANIFEST_READ_FAILED; |
| 200 | return NULL; |
| 201 | } |
| 202 | pay = cson_new_object(); |
| 203 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -192,11 +192,11 @@ | |
| 192 | if(!eventTypeLabel){ |
| 193 | eventTypeLabel = json_new_string("ticket"); |
| 194 | json_gc_add("$EVENT_TYPE_LABEL(ticket)", eventTypeLabel); |
| 195 | } |
| 196 | |
| 197 | pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); |
| 198 | if( pTktChng==0 ){ |
| 199 | g.json.resultCode = FSL_JSON_E_MANIFEST_READ_FAILED; |
| 200 | return NULL; |
| 201 | } |
| 202 | pay = cson_new_object(); |
| 203 |
+1
-1
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -218,11 +218,11 @@ | ||
| 218 | 218 | if( rootid==0 ){ |
| 219 | 219 | zOpt->rcErrMsg = "Basis branch not found."; |
| 220 | 220 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - pParent = manifest_get(rootid, CFTYPE_MANIFEST); | |
| 223 | + pParent = manifest_get(rootid, CFTYPE_MANIFEST, 0); | |
| 224 | 224 | if( pParent==0 ){ |
| 225 | 225 | zOpt->rcErrMsg = "Could not read parent manifest."; |
| 226 | 226 | return FSL_JSON_E_UNKNOWN; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -218,11 +218,11 @@ | |
| 218 | if( rootid==0 ){ |
| 219 | zOpt->rcErrMsg = "Basis branch not found."; |
| 220 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 221 | } |
| 222 | |
| 223 | pParent = manifest_get(rootid, CFTYPE_MANIFEST); |
| 224 | if( pParent==0 ){ |
| 225 | zOpt->rcErrMsg = "Could not read parent manifest."; |
| 226 | return FSL_JSON_E_UNKNOWN; |
| 227 | } |
| 228 | |
| 229 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -218,11 +218,11 @@ | |
| 218 | if( rootid==0 ){ |
| 219 | zOpt->rcErrMsg = "Basis branch not found."; |
| 220 | return FSL_JSON_E_RESOURCE_NOT_FOUND; |
| 221 | } |
| 222 | |
| 223 | pParent = manifest_get(rootid, CFTYPE_MANIFEST, 0); |
| 224 | if( pParent==0 ){ |
| 225 | zOpt->rcErrMsg = "Could not read parent manifest."; |
| 226 | return FSL_JSON_E_UNKNOWN; |
| 227 | } |
| 228 | |
| 229 |
+1
-1
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -632,11 +632,11 @@ | ||
| 632 | 632 | int const rid = db_column_int(&q,0); |
| 633 | 633 | Manifest * pMan = NULL; |
| 634 | 634 | cson_value * rowV; |
| 635 | 635 | cson_object * row; |
| 636 | 636 | /*printf("rid=%d\n",rid);*/ |
| 637 | - pMan = manifest_get(rid, CFTYPE_TICKET); | |
| 637 | + pMan = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 638 | 638 | if(!pMan){ |
| 639 | 639 | /* this might be an attachment? I'm seeing this with |
| 640 | 640 | rid 15380, uuid [1292fef05f2472108]. |
| 641 | 641 | |
| 642 | 642 | /json/artifact/1292fef05f2472108 returns not-found, |
| 643 | 643 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -632,11 +632,11 @@ | |
| 632 | int const rid = db_column_int(&q,0); |
| 633 | Manifest * pMan = NULL; |
| 634 | cson_value * rowV; |
| 635 | cson_object * row; |
| 636 | /*printf("rid=%d\n",rid);*/ |
| 637 | pMan = manifest_get(rid, CFTYPE_TICKET); |
| 638 | if(!pMan){ |
| 639 | /* this might be an attachment? I'm seeing this with |
| 640 | rid 15380, uuid [1292fef05f2472108]. |
| 641 | |
| 642 | /json/artifact/1292fef05f2472108 returns not-found, |
| 643 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -632,11 +632,11 @@ | |
| 632 | int const rid = db_column_int(&q,0); |
| 633 | Manifest * pMan = NULL; |
| 634 | cson_value * rowV; |
| 635 | cson_object * row; |
| 636 | /*printf("rid=%d\n",rid);*/ |
| 637 | pMan = manifest_get(rid, CFTYPE_TICKET, 0); |
| 638 | if(!pMan){ |
| 639 | /* this might be an attachment? I'm seeing this with |
| 640 | rid 15380, uuid [1292fef05f2472108]. |
| 641 | |
| 642 | /json/artifact/1292fef05f2472108 returns not-found, |
| 643 |
+3
-3
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 83 | 83 | ** caller. If it returns NULL then it may set g.json's error state. |
| 84 | 84 | */ |
| 85 | 85 | cson_value * json_get_wiki_page_by_rid(int rid, char contentFormat){ |
| 86 | 86 | Manifest * pWiki = NULL; |
| 87 | - if( NULL == (pWiki = manifest_get(rid, CFTYPE_WIKI)) ){ | |
| 87 | + if( NULL == (pWiki = manifest_get(rid, CFTYPE_WIKI, 0)) ){ | |
| 88 | 88 | json_set_err( FSL_JSON_E_UNKNOWN, |
| 89 | 89 | "Error reading wiki page from manifest (rid=%d).", |
| 90 | 90 | rid ); |
| 91 | 91 | return NULL; |
| 92 | 92 | }else{ |
| @@ -528,16 +528,16 @@ | ||
| 528 | 528 | }else if(0==r2){ |
| 529 | 529 | goto invalid; |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | zErrTag = zV1; |
| 533 | - pW1 = manifest_get(r1, CFTYPE_WIKI); | |
| 533 | + pW1 = manifest_get(r1, CFTYPE_WIKI, 0); | |
| 534 | 534 | if( pW1==0 ) { |
| 535 | 535 | goto manifest; |
| 536 | 536 | } |
| 537 | 537 | zErrTag = zV2; |
| 538 | - pW2 = manifest_get(r2, CFTYPE_WIKI); | |
| 538 | + pW2 = manifest_get(r2, CFTYPE_WIKI, 0); | |
| 539 | 539 | if( pW2==0 ) { |
| 540 | 540 | goto manifest; |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | blob_init(&w1, pW1->zWiki, -1); |
| 544 | 544 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 83 | ** caller. If it returns NULL then it may set g.json's error state. |
| 84 | */ |
| 85 | cson_value * json_get_wiki_page_by_rid(int rid, char contentFormat){ |
| 86 | Manifest * pWiki = NULL; |
| 87 | if( NULL == (pWiki = manifest_get(rid, CFTYPE_WIKI)) ){ |
| 88 | json_set_err( FSL_JSON_E_UNKNOWN, |
| 89 | "Error reading wiki page from manifest (rid=%d).", |
| 90 | rid ); |
| 91 | return NULL; |
| 92 | }else{ |
| @@ -528,16 +528,16 @@ | |
| 528 | }else if(0==r2){ |
| 529 | goto invalid; |
| 530 | } |
| 531 | |
| 532 | zErrTag = zV1; |
| 533 | pW1 = manifest_get(r1, CFTYPE_WIKI); |
| 534 | if( pW1==0 ) { |
| 535 | goto manifest; |
| 536 | } |
| 537 | zErrTag = zV2; |
| 538 | pW2 = manifest_get(r2, CFTYPE_WIKI); |
| 539 | if( pW2==0 ) { |
| 540 | goto manifest; |
| 541 | } |
| 542 | |
| 543 | blob_init(&w1, pW1->zWiki, -1); |
| 544 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 83 | ** caller. If it returns NULL then it may set g.json's error state. |
| 84 | */ |
| 85 | cson_value * json_get_wiki_page_by_rid(int rid, char contentFormat){ |
| 86 | Manifest * pWiki = NULL; |
| 87 | if( NULL == (pWiki = manifest_get(rid, CFTYPE_WIKI, 0)) ){ |
| 88 | json_set_err( FSL_JSON_E_UNKNOWN, |
| 89 | "Error reading wiki page from manifest (rid=%d).", |
| 90 | rid ); |
| 91 | return NULL; |
| 92 | }else{ |
| @@ -528,16 +528,16 @@ | |
| 528 | }else if(0==r2){ |
| 529 | goto invalid; |
| 530 | } |
| 531 | |
| 532 | zErrTag = zV1; |
| 533 | pW1 = manifest_get(r1, CFTYPE_WIKI, 0); |
| 534 | if( pW1==0 ) { |
| 535 | goto manifest; |
| 536 | } |
| 537 | zErrTag = zV2; |
| 538 | pW2 = manifest_get(r2, CFTYPE_WIKI, 0); |
| 539 | if( pW2==0 ) { |
| 540 | goto manifest; |
| 541 | } |
| 542 | |
| 543 | blob_init(&w1, pW1->zWiki, -1); |
| 544 |
+4
-4
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -955,11 +955,11 @@ | ||
| 955 | 955 | |
| 956 | 956 | /* |
| 957 | 957 | ** Get a manifest given the rid for the control artifact. Return |
| 958 | 958 | ** a pointer to the manifest on success or NULL if there is a failure. |
| 959 | 959 | */ |
| 960 | -Manifest *manifest_get(int rid, int cfType){ | |
| 960 | +Manifest *manifest_get(int rid, int cfType, Blob *pErr){ | |
| 961 | 961 | Blob content; |
| 962 | 962 | Manifest *p; |
| 963 | 963 | if( !rid ) return 0; |
| 964 | 964 | p = manifest_cache_find(rid); |
| 965 | 965 | if( p ){ |
| @@ -968,11 +968,11 @@ | ||
| 968 | 968 | p = 0; |
| 969 | 969 | } |
| 970 | 970 | return p; |
| 971 | 971 | } |
| 972 | 972 | content_get(rid, &content); |
| 973 | - p = manifest_parse(&content, rid, 0); | |
| 973 | + p = manifest_parse(&content, rid, pErr); | |
| 974 | 974 | if( p && cfType!=CFTYPE_ANY && cfType!=p->type ){ |
| 975 | 975 | manifest_destroy(p); |
| 976 | 976 | p = 0; |
| 977 | 977 | } |
| 978 | 978 | return p; |
| @@ -989,11 +989,11 @@ | ||
| 989 | 989 | rid = name_to_typed_rid(zName, "ci"); |
| 990 | 990 | if( !is_a_version(rid) ){ |
| 991 | 991 | fossil_fatal("no such checkin: %s", zName); |
| 992 | 992 | } |
| 993 | 993 | if( pRid ) *pRid = rid; |
| 994 | - p = manifest_get(rid, CFTYPE_MANIFEST); | |
| 994 | + p = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 995 | 995 | if( p==0 ){ |
| 996 | 996 | fossil_fatal("cannot parse manifest for checkin: %s", zName); |
| 997 | 997 | } |
| 998 | 998 | return p; |
| 999 | 999 | } |
| @@ -1036,11 +1036,11 @@ | ||
| 1036 | 1036 | ** and return 1 if throwError is false. |
| 1037 | 1037 | */ |
| 1038 | 1038 | static int fetch_baseline(Manifest *p, int throwError){ |
| 1039 | 1039 | if( p->zBaseline!=0 && p->pBaseline==0 ){ |
| 1040 | 1040 | int rid = uuid_to_rid(p->zBaseline, 1); |
| 1041 | - p->pBaseline = manifest_get(rid, CFTYPE_MANIFEST); | |
| 1041 | + p->pBaseline = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 1042 | 1042 | if( p->pBaseline==0 ){ |
| 1043 | 1043 | if( !throwError ){ |
| 1044 | 1044 | db_multi_exec( |
| 1045 | 1045 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1046 | 1046 | p->rid, rid |
| 1047 | 1047 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -955,11 +955,11 @@ | |
| 955 | |
| 956 | /* |
| 957 | ** Get a manifest given the rid for the control artifact. Return |
| 958 | ** a pointer to the manifest on success or NULL if there is a failure. |
| 959 | */ |
| 960 | Manifest *manifest_get(int rid, int cfType){ |
| 961 | Blob content; |
| 962 | Manifest *p; |
| 963 | if( !rid ) return 0; |
| 964 | p = manifest_cache_find(rid); |
| 965 | if( p ){ |
| @@ -968,11 +968,11 @@ | |
| 968 | p = 0; |
| 969 | } |
| 970 | return p; |
| 971 | } |
| 972 | content_get(rid, &content); |
| 973 | p = manifest_parse(&content, rid, 0); |
| 974 | if( p && cfType!=CFTYPE_ANY && cfType!=p->type ){ |
| 975 | manifest_destroy(p); |
| 976 | p = 0; |
| 977 | } |
| 978 | return p; |
| @@ -989,11 +989,11 @@ | |
| 989 | rid = name_to_typed_rid(zName, "ci"); |
| 990 | if( !is_a_version(rid) ){ |
| 991 | fossil_fatal("no such checkin: %s", zName); |
| 992 | } |
| 993 | if( pRid ) *pRid = rid; |
| 994 | p = manifest_get(rid, CFTYPE_MANIFEST); |
| 995 | if( p==0 ){ |
| 996 | fossil_fatal("cannot parse manifest for checkin: %s", zName); |
| 997 | } |
| 998 | return p; |
| 999 | } |
| @@ -1036,11 +1036,11 @@ | |
| 1036 | ** and return 1 if throwError is false. |
| 1037 | */ |
| 1038 | static int fetch_baseline(Manifest *p, int throwError){ |
| 1039 | if( p->zBaseline!=0 && p->pBaseline==0 ){ |
| 1040 | int rid = uuid_to_rid(p->zBaseline, 1); |
| 1041 | p->pBaseline = manifest_get(rid, CFTYPE_MANIFEST); |
| 1042 | if( p->pBaseline==0 ){ |
| 1043 | if( !throwError ){ |
| 1044 | db_multi_exec( |
| 1045 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1046 | p->rid, rid |
| 1047 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -955,11 +955,11 @@ | |
| 955 | |
| 956 | /* |
| 957 | ** Get a manifest given the rid for the control artifact. Return |
| 958 | ** a pointer to the manifest on success or NULL if there is a failure. |
| 959 | */ |
| 960 | Manifest *manifest_get(int rid, int cfType, Blob *pErr){ |
| 961 | Blob content; |
| 962 | Manifest *p; |
| 963 | if( !rid ) return 0; |
| 964 | p = manifest_cache_find(rid); |
| 965 | if( p ){ |
| @@ -968,11 +968,11 @@ | |
| 968 | p = 0; |
| 969 | } |
| 970 | return p; |
| 971 | } |
| 972 | content_get(rid, &content); |
| 973 | p = manifest_parse(&content, rid, pErr); |
| 974 | if( p && cfType!=CFTYPE_ANY && cfType!=p->type ){ |
| 975 | manifest_destroy(p); |
| 976 | p = 0; |
| 977 | } |
| 978 | return p; |
| @@ -989,11 +989,11 @@ | |
| 989 | rid = name_to_typed_rid(zName, "ci"); |
| 990 | if( !is_a_version(rid) ){ |
| 991 | fossil_fatal("no such checkin: %s", zName); |
| 992 | } |
| 993 | if( pRid ) *pRid = rid; |
| 994 | p = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 995 | if( p==0 ){ |
| 996 | fossil_fatal("cannot parse manifest for checkin: %s", zName); |
| 997 | } |
| 998 | return p; |
| 999 | } |
| @@ -1036,11 +1036,11 @@ | |
| 1036 | ** and return 1 if throwError is false. |
| 1037 | */ |
| 1038 | static int fetch_baseline(Manifest *p, int throwError){ |
| 1039 | if( p->zBaseline!=0 && p->pBaseline==0 ){ |
| 1040 | int rid = uuid_to_rid(p->zBaseline, 1); |
| 1041 | p->pBaseline = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1042 | if( p->pBaseline==0 ){ |
| 1043 | if( !throwError ){ |
| 1044 | db_multi_exec( |
| 1045 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1046 | p->rid, rid |
| 1047 |
+1
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -721,11 +721,11 @@ | ||
| 721 | 721 | Manifest *p; |
| 722 | 722 | int rid = bag_first(&pending); |
| 723 | 723 | int i; |
| 724 | 724 | |
| 725 | 725 | bag_remove(&pending, rid); |
| 726 | - p = manifest_get(rid, CFTYPE_CLUSTER); | |
| 726 | + p = manifest_get(rid, CFTYPE_CLUSTER, 0); | |
| 727 | 727 | if( p==0 ){ |
| 728 | 728 | fossil_fatal("bad cluster: rid=%d", rid); |
| 729 | 729 | } |
| 730 | 730 | for(i=0; i<p->nCChild; i++){ |
| 731 | 731 | const char *zUuid = p->azCChild[i]; |
| 732 | 732 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -721,11 +721,11 @@ | |
| 721 | Manifest *p; |
| 722 | int rid = bag_first(&pending); |
| 723 | int i; |
| 724 | |
| 725 | bag_remove(&pending, rid); |
| 726 | p = manifest_get(rid, CFTYPE_CLUSTER); |
| 727 | if( p==0 ){ |
| 728 | fossil_fatal("bad cluster: rid=%d", rid); |
| 729 | } |
| 730 | for(i=0; i<p->nCChild; i++){ |
| 731 | const char *zUuid = p->azCChild[i]; |
| 732 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -721,11 +721,11 @@ | |
| 721 | Manifest *p; |
| 722 | int rid = bag_first(&pending); |
| 723 | int i; |
| 724 | |
| 725 | bag_remove(&pending, rid); |
| 726 | p = manifest_get(rid, CFTYPE_CLUSTER, 0); |
| 727 | if( p==0 ){ |
| 728 | fossil_fatal("bad cluster: rid=%d", rid); |
| 729 | } |
| 730 | for(i=0; i<p->nCChild; i++){ |
| 731 | const char *zUuid = p->azCChild[i]; |
| 732 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -479,11 +479,11 @@ | ||
| 479 | 479 | if( zDir && zDir[0] ){ |
| 480 | 480 | blob_appendf(&filename, "%s/", zDir); |
| 481 | 481 | } |
| 482 | 482 | nPrefix = blob_size(&filename); |
| 483 | 483 | |
| 484 | - pManifest = manifest_get(rid, CFTYPE_MANIFEST); | |
| 484 | + pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 485 | 485 | if( pManifest ){ |
| 486 | 486 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 487 | 487 | tar_begin(mTime); |
| 488 | 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | 489 | blob_append(&filename, "manifest", -1); |
| 490 | 490 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -479,11 +479,11 @@ | |
| 479 | if( zDir && zDir[0] ){ |
| 480 | blob_appendf(&filename, "%s/", zDir); |
| 481 | } |
| 482 | nPrefix = blob_size(&filename); |
| 483 | |
| 484 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 485 | if( pManifest ){ |
| 486 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 487 | tar_begin(mTime); |
| 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | blob_append(&filename, "manifest", -1); |
| 490 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -479,11 +479,11 @@ | |
| 479 | if( zDir && zDir[0] ){ |
| 480 | blob_appendf(&filename, "%s/", zDir); |
| 481 | } |
| 482 | nPrefix = blob_size(&filename); |
| 483 | |
| 484 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 485 | if( pManifest ){ |
| 486 | mTime = (pManifest->rDate - 2440587.5)*86400.0; |
| 487 | tar_begin(mTime); |
| 488 | if( db_get_boolean("manifest", 0) ){ |
| 489 | blob_append(&filename, "manifest", -1); |
| 490 |
+3
-3
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -296,11 +296,11 @@ | ||
| 296 | 296 | db_multi_exec("DELETE FROM ticket WHERE tkt_id=%d", tktid); |
| 297 | 297 | tktid = 0; |
| 298 | 298 | db_prepare(&q, "SELECT rid FROM tagxref WHERE tagid=%d ORDER BY mtime",tagid); |
| 299 | 299 | while( db_step(&q)==SQLITE_ROW ){ |
| 300 | 300 | int rid = db_column_int(&q, 0); |
| 301 | - pTicket = manifest_get(rid, CFTYPE_TICKET); | |
| 301 | + pTicket = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 302 | 302 | if( pTicket ){ |
| 303 | 303 | tktid = ticket_insert(pTicket, rid, tktid); |
| 304 | 304 | manifest_ticket_event(rid, pTicket, createFlag, tagid); |
| 305 | 305 | manifest_destroy(pTicket); |
| 306 | 306 | } |
| @@ -943,11 +943,11 @@ | ||
| 943 | 943 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 944 | 944 | @ (rid %d(rid)) by |
| 945 | 945 | hyperlink_to_user(zUser,zDate," on"); |
| 946 | 946 | hyperlink_to_date(zDate, ".</p>"); |
| 947 | 947 | }else{ |
| 948 | - pTicket = manifest_get(rid, CFTYPE_TICKET); | |
| 948 | + pTicket = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 949 | 949 | if( pTicket ){ |
| 950 | 950 | @ |
| 951 | 951 | @ <li><p>Ticket change |
| 952 | 952 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 953 | 953 | @ (rid %d(rid)) by |
| @@ -1243,11 +1243,11 @@ | ||
| 1243 | 1243 | }else{ |
| 1244 | 1244 | fossil_print("Add attachment %s\n", zFile); |
| 1245 | 1245 | } |
| 1246 | 1246 | fossil_print(" by %s on %s\n", zUser, zDate); |
| 1247 | 1247 | }else{ |
| 1248 | - pTicket = manifest_get(rid, CFTYPE_TICKET); | |
| 1248 | + pTicket = manifest_get(rid, CFTYPE_TICKET, 0); | |
| 1249 | 1249 | if( pTicket ){ |
| 1250 | 1250 | int i; |
| 1251 | 1251 | |
| 1252 | 1252 | fossil_print("Ticket Change by %s on %s:\n", |
| 1253 | 1253 | pTicket->zUser, zDate); |
| 1254 | 1254 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -296,11 +296,11 @@ | |
| 296 | db_multi_exec("DELETE FROM ticket WHERE tkt_id=%d", tktid); |
| 297 | tktid = 0; |
| 298 | db_prepare(&q, "SELECT rid FROM tagxref WHERE tagid=%d ORDER BY mtime",tagid); |
| 299 | while( db_step(&q)==SQLITE_ROW ){ |
| 300 | int rid = db_column_int(&q, 0); |
| 301 | pTicket = manifest_get(rid, CFTYPE_TICKET); |
| 302 | if( pTicket ){ |
| 303 | tktid = ticket_insert(pTicket, rid, tktid); |
| 304 | manifest_ticket_event(rid, pTicket, createFlag, tagid); |
| 305 | manifest_destroy(pTicket); |
| 306 | } |
| @@ -943,11 +943,11 @@ | |
| 943 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 944 | @ (rid %d(rid)) by |
| 945 | hyperlink_to_user(zUser,zDate," on"); |
| 946 | hyperlink_to_date(zDate, ".</p>"); |
| 947 | }else{ |
| 948 | pTicket = manifest_get(rid, CFTYPE_TICKET); |
| 949 | if( pTicket ){ |
| 950 | @ |
| 951 | @ <li><p>Ticket change |
| 952 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 953 | @ (rid %d(rid)) by |
| @@ -1243,11 +1243,11 @@ | |
| 1243 | }else{ |
| 1244 | fossil_print("Add attachment %s\n", zFile); |
| 1245 | } |
| 1246 | fossil_print(" by %s on %s\n", zUser, zDate); |
| 1247 | }else{ |
| 1248 | pTicket = manifest_get(rid, CFTYPE_TICKET); |
| 1249 | if( pTicket ){ |
| 1250 | int i; |
| 1251 | |
| 1252 | fossil_print("Ticket Change by %s on %s:\n", |
| 1253 | pTicket->zUser, zDate); |
| 1254 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -296,11 +296,11 @@ | |
| 296 | db_multi_exec("DELETE FROM ticket WHERE tkt_id=%d", tktid); |
| 297 | tktid = 0; |
| 298 | db_prepare(&q, "SELECT rid FROM tagxref WHERE tagid=%d ORDER BY mtime",tagid); |
| 299 | while( db_step(&q)==SQLITE_ROW ){ |
| 300 | int rid = db_column_int(&q, 0); |
| 301 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 302 | if( pTicket ){ |
| 303 | tktid = ticket_insert(pTicket, rid, tktid); |
| 304 | manifest_ticket_event(rid, pTicket, createFlag, tagid); |
| 305 | manifest_destroy(pTicket); |
| 306 | } |
| @@ -943,11 +943,11 @@ | |
| 943 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 944 | @ (rid %d(rid)) by |
| 945 | hyperlink_to_user(zUser,zDate," on"); |
| 946 | hyperlink_to_date(zDate, ".</p>"); |
| 947 | }else{ |
| 948 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 949 | if( pTicket ){ |
| 950 | @ |
| 951 | @ <li><p>Ticket change |
| 952 | @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>] |
| 953 | @ (rid %d(rid)) by |
| @@ -1243,11 +1243,11 @@ | |
| 1243 | }else{ |
| 1244 | fossil_print("Add attachment %s\n", zFile); |
| 1245 | } |
| 1246 | fossil_print(" by %s on %s\n", zUser, zDate); |
| 1247 | }else{ |
| 1248 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 1249 | if( pTicket ){ |
| 1250 | int i; |
| 1251 | |
| 1252 | fossil_print("Ticket Change by %s on %s:\n", |
| 1253 | pTicket->zUser, zDate); |
| 1254 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -635,11 +635,11 @@ | ||
| 635 | 635 | } |
| 636 | 636 | if( !is_a_version(rid) ){ |
| 637 | 637 | if( errCode>0 ) return errCode; |
| 638 | 638 | fossil_fatal("no such checkin: %s", revision); |
| 639 | 639 | } |
| 640 | - pManifest = manifest_get(rid, CFTYPE_MANIFEST); | |
| 640 | + pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 641 | 641 | |
| 642 | 642 | if( pManifest ){ |
| 643 | 643 | pFile = manifest_file_find(pManifest, file); |
| 644 | 644 | if( pFile ){ |
| 645 | 645 | int rc; |
| 646 | 646 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -635,11 +635,11 @@ | |
| 635 | } |
| 636 | if( !is_a_version(rid) ){ |
| 637 | if( errCode>0 ) return errCode; |
| 638 | fossil_fatal("no such checkin: %s", revision); |
| 639 | } |
| 640 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 641 | |
| 642 | if( pManifest ){ |
| 643 | pFile = manifest_file_find(pManifest, file); |
| 644 | if( pFile ){ |
| 645 | int rc; |
| 646 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -635,11 +635,11 @@ | |
| 635 | } |
| 636 | if( !is_a_version(rid) ){ |
| 637 | if( errCode>0 ) return errCode; |
| 638 | fossil_fatal("no such checkin: %s", revision); |
| 639 | } |
| 640 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 641 | |
| 642 | if( pManifest ){ |
| 643 | pFile = manifest_file_find(pManifest, file); |
| 644 | if( pFile ){ |
| 645 | int rc; |
| 646 |
+6
-3
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | db_begin_transaction(); |
| 86 | - p = manifest_get(vid, CFTYPE_MANIFEST); | |
| 86 | + p = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 87 | 87 | if( p==0 ) { |
| 88 | 88 | db_end_transaction(1); |
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | ||
| 852 | 852 | ** pManOut, should be identical. |
| 853 | 853 | */ |
| 854 | 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | 855 | int fid; |
| 856 | 856 | Blob file; |
| 857 | + Blob err; | |
| 857 | 858 | Manifest *pManifest; |
| 858 | 859 | ManifestFile *pFile; |
| 859 | 860 | char zBuf[100]; |
| 860 | 861 | |
| 861 | 862 | blob_zero(pOut); |
| 863 | + blob_zero(&err); | |
| 862 | 864 | if( pManOut ){ |
| 863 | 865 | blob_zero(pManOut); |
| 864 | 866 | } |
| 865 | 867 | db_must_be_within_tree(); |
| 866 | - pManifest = manifest_get(vid, CFTYPE_MANIFEST); | |
| 868 | + pManifest = manifest_get(vid, CFTYPE_MANIFEST, &err); | |
| 867 | 869 | if( pManifest==0 ){ |
| 868 | - fossil_fatal("manifest file (%d) is malformed", vid); | |
| 870 | + fossil_fatal("manifest file (%d) is malformed:\n%s\n", | |
| 871 | + vid, blob_str(&err)); | |
| 869 | 872 | } |
| 870 | 873 | manifest_file_rewind(pManifest); |
| 871 | 874 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 872 | 875 | if( pFile->zUuid==0 ) continue; |
| 873 | 876 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 874 | 877 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 87 | if( p==0 ) { |
| 88 | db_end_transaction(1); |
| 89 | return; |
| 90 | } |
| 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | |
| 852 | ** pManOut, should be identical. |
| 853 | */ |
| 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | int fid; |
| 856 | Blob file; |
| 857 | Manifest *pManifest; |
| 858 | ManifestFile *pFile; |
| 859 | char zBuf[100]; |
| 860 | |
| 861 | blob_zero(pOut); |
| 862 | if( pManOut ){ |
| 863 | blob_zero(pManOut); |
| 864 | } |
| 865 | db_must_be_within_tree(); |
| 866 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 867 | if( pManifest==0 ){ |
| 868 | fossil_fatal("manifest file (%d) is malformed", vid); |
| 869 | } |
| 870 | manifest_file_rewind(pManifest); |
| 871 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 872 | if( pFile->zUuid==0 ) continue; |
| 873 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 874 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 87 | if( p==0 ) { |
| 88 | db_end_transaction(1); |
| 89 | return; |
| 90 | } |
| 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | |
| 852 | ** pManOut, should be identical. |
| 853 | */ |
| 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | int fid; |
| 856 | Blob file; |
| 857 | Blob err; |
| 858 | Manifest *pManifest; |
| 859 | ManifestFile *pFile; |
| 860 | char zBuf[100]; |
| 861 | |
| 862 | blob_zero(pOut); |
| 863 | blob_zero(&err); |
| 864 | if( pManOut ){ |
| 865 | blob_zero(pManOut); |
| 866 | } |
| 867 | db_must_be_within_tree(); |
| 868 | pManifest = manifest_get(vid, CFTYPE_MANIFEST, &err); |
| 869 | if( pManifest==0 ){ |
| 870 | fossil_fatal("manifest file (%d) is malformed:\n%s\n", |
| 871 | vid, blob_str(&err)); |
| 872 | } |
| 873 | manifest_file_rewind(pManifest); |
| 874 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 875 | if( pFile->zUuid==0 ) continue; |
| 876 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 877 |
+6
-3
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | db_begin_transaction(); |
| 86 | - p = manifest_get(vid, CFTYPE_MANIFEST); | |
| 86 | + p = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 87 | 87 | if( p==0 ) { |
| 88 | 88 | db_end_transaction(1); |
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | ||
| 852 | 852 | ** pManOut, should be identical. |
| 853 | 853 | */ |
| 854 | 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | 855 | int fid; |
| 856 | 856 | Blob file; |
| 857 | + Blob err; | |
| 857 | 858 | Manifest *pManifest; |
| 858 | 859 | ManifestFile *pFile; |
| 859 | 860 | char zBuf[100]; |
| 860 | 861 | |
| 861 | 862 | blob_zero(pOut); |
| 863 | + blob_zero(&err); | |
| 862 | 864 | if( pManOut ){ |
| 863 | 865 | blob_zero(pManOut); |
| 864 | 866 | } |
| 865 | 867 | db_must_be_within_tree(); |
| 866 | - pManifest = manifest_get(vid, CFTYPE_MANIFEST); | |
| 868 | + pManifest = manifest_get(vid, CFTYPE_MANIFEST, &err); | |
| 867 | 869 | if( pManifest==0 ){ |
| 868 | - fossil_fatal("manifest file (%d) is malformed", vid); | |
| 870 | + fossil_fatal("manifest file (%d) is malformed:\n%s\n", | |
| 871 | + vid, blob_str(&err)); | |
| 869 | 872 | } |
| 870 | 873 | manifest_file_rewind(pManifest); |
| 871 | 874 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 872 | 875 | if( pFile->zUuid==0 ) continue; |
| 873 | 876 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 874 | 877 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 87 | if( p==0 ) { |
| 88 | db_end_transaction(1); |
| 89 | return; |
| 90 | } |
| 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | |
| 852 | ** pManOut, should be identical. |
| 853 | */ |
| 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | int fid; |
| 856 | Blob file; |
| 857 | Manifest *pManifest; |
| 858 | ManifestFile *pFile; |
| 859 | char zBuf[100]; |
| 860 | |
| 861 | blob_zero(pOut); |
| 862 | if( pManOut ){ |
| 863 | blob_zero(pManOut); |
| 864 | } |
| 865 | db_must_be_within_tree(); |
| 866 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 867 | if( pManifest==0 ){ |
| 868 | fossil_fatal("manifest file (%d) is malformed", vid); |
| 869 | } |
| 870 | manifest_file_rewind(pManifest); |
| 871 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 872 | if( pFile->zUuid==0 ) continue; |
| 873 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 874 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | if( db_exists("SELECT 1 FROM vfile WHERE vid=%d", vid) ){ |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | db_begin_transaction(); |
| 86 | p = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 87 | if( p==0 ) { |
| 88 | db_end_transaction(1); |
| 89 | return; |
| 90 | } |
| 91 | db_prepare(&ins, |
| @@ -852,22 +852,25 @@ | |
| 852 | ** pManOut, should be identical. |
| 853 | */ |
| 854 | void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){ |
| 855 | int fid; |
| 856 | Blob file; |
| 857 | Blob err; |
| 858 | Manifest *pManifest; |
| 859 | ManifestFile *pFile; |
| 860 | char zBuf[100]; |
| 861 | |
| 862 | blob_zero(pOut); |
| 863 | blob_zero(&err); |
| 864 | if( pManOut ){ |
| 865 | blob_zero(pManOut); |
| 866 | } |
| 867 | db_must_be_within_tree(); |
| 868 | pManifest = manifest_get(vid, CFTYPE_MANIFEST, &err); |
| 869 | if( pManifest==0 ){ |
| 870 | fossil_fatal("manifest file (%d) is malformed:\n%s\n", |
| 871 | vid, blob_str(&err)); |
| 872 | } |
| 873 | manifest_file_rewind(pManifest); |
| 874 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 875 | if( pFile->zUuid==0 ) continue; |
| 876 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 877 |
+6
-6
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -228,11 +228,11 @@ | ||
| 228 | 228 | "SELECT rid FROM tagxref" |
| 229 | 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | 230 | " ORDER BY mtime DESC", zTag |
| 231 | 231 | ); |
| 232 | 232 | free(zTag); |
| 233 | - pWiki = manifest_get(rid, CFTYPE_WIKI); | |
| 233 | + pWiki = manifest_get(rid, CFTYPE_WIKI, 0); | |
| 234 | 234 | if( pWiki ){ |
| 235 | 235 | zBody = pWiki->zWiki; |
| 236 | 236 | zMimetype = pWiki->zMimetype; |
| 237 | 237 | } |
| 238 | 238 | } |
| @@ -391,11 +391,11 @@ | ||
| 391 | 391 | free(zTag); |
| 392 | 392 | if( (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){ |
| 393 | 393 | login_needed(); |
| 394 | 394 | return; |
| 395 | 395 | } |
| 396 | - if( zBody==0 && (pWiki = manifest_get(rid, CFTYPE_WIKI))!=0 ){ | |
| 396 | + if( zBody==0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ | |
| 397 | 397 | zBody = pWiki->zWiki; |
| 398 | 398 | zMimetype = pWiki->zMimetype; |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | if( P("submit")!=0 && zBody!=0 |
| @@ -632,11 +632,11 @@ | ||
| 632 | 632 | blob_appendf(&body, db_get("sandbox","")); |
| 633 | 633 | appendRemark(&body, zMimetype); |
| 634 | 634 | db_set("sandbox", blob_str(&body), 0); |
| 635 | 635 | }else{ |
| 636 | 636 | login_verify_csrf_secret(); |
| 637 | - pWiki = manifest_get(rid, CFTYPE_WIKI); | |
| 637 | + pWiki = manifest_get(rid, CFTYPE_WIKI, 0); | |
| 638 | 638 | if( pWiki ){ |
| 639 | 639 | blob_append(&body, pWiki->zWiki, -1); |
| 640 | 640 | manifest_destroy(pWiki); |
| 641 | 641 | } |
| 642 | 642 | blob_zero(&wiki); |
| @@ -782,15 +782,15 @@ | ||
| 782 | 782 | " WHERE event.mtime<(SELECT mtime FROM event WHERE objid=%d)" |
| 783 | 783 | " ORDER BY event.mtime DESC LIMIT 1", |
| 784 | 784 | zPageName, rid1 |
| 785 | 785 | ); |
| 786 | 786 | } |
| 787 | - pW1 = manifest_get(rid1, CFTYPE_WIKI); | |
| 787 | + pW1 = manifest_get(rid1, CFTYPE_WIKI, 0); | |
| 788 | 788 | if( pW1==0 ) fossil_redirect_home(); |
| 789 | 789 | blob_init(&w1, pW1->zWiki, -1); |
| 790 | 790 | blob_zero(&w2); |
| 791 | - if( rid2 && (pW2 = manifest_get(rid2, CFTYPE_WIKI))!=0 ){ | |
| 791 | + if( rid2 && (pW2 = manifest_get(rid2, CFTYPE_WIKI, 0))!=0 ){ | |
| 792 | 792 | blob_init(&w2, pW2->zWiki, -1); |
| 793 | 793 | } |
| 794 | 794 | blob_zero(&d); |
| 795 | 795 | diffFlags = construct_diff_flags(1,0); |
| 796 | 796 | text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO); |
| @@ -1064,11 +1064,11 @@ | ||
| 1064 | 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | 1067 | zPageName |
| 1068 | 1068 | ); |
| 1069 | - if( (pWiki = manifest_get(rid, CFTYPE_WIKI))!=0 ){ | |
| 1069 | + if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ | |
| 1070 | 1070 | zBody = pWiki->zWiki; |
| 1071 | 1071 | } |
| 1072 | 1072 | if( zBody==0 ){ |
| 1073 | 1073 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 1074 | 1074 | } |
| 1075 | 1075 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | "SELECT rid FROM tagxref" |
| 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | " ORDER BY mtime DESC", zTag |
| 231 | ); |
| 232 | free(zTag); |
| 233 | pWiki = manifest_get(rid, CFTYPE_WIKI); |
| 234 | if( pWiki ){ |
| 235 | zBody = pWiki->zWiki; |
| 236 | zMimetype = pWiki->zMimetype; |
| 237 | } |
| 238 | } |
| @@ -391,11 +391,11 @@ | |
| 391 | free(zTag); |
| 392 | if( (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){ |
| 393 | login_needed(); |
| 394 | return; |
| 395 | } |
| 396 | if( zBody==0 && (pWiki = manifest_get(rid, CFTYPE_WIKI))!=0 ){ |
| 397 | zBody = pWiki->zWiki; |
| 398 | zMimetype = pWiki->zMimetype; |
| 399 | } |
| 400 | } |
| 401 | if( P("submit")!=0 && zBody!=0 |
| @@ -632,11 +632,11 @@ | |
| 632 | blob_appendf(&body, db_get("sandbox","")); |
| 633 | appendRemark(&body, zMimetype); |
| 634 | db_set("sandbox", blob_str(&body), 0); |
| 635 | }else{ |
| 636 | login_verify_csrf_secret(); |
| 637 | pWiki = manifest_get(rid, CFTYPE_WIKI); |
| 638 | if( pWiki ){ |
| 639 | blob_append(&body, pWiki->zWiki, -1); |
| 640 | manifest_destroy(pWiki); |
| 641 | } |
| 642 | blob_zero(&wiki); |
| @@ -782,15 +782,15 @@ | |
| 782 | " WHERE event.mtime<(SELECT mtime FROM event WHERE objid=%d)" |
| 783 | " ORDER BY event.mtime DESC LIMIT 1", |
| 784 | zPageName, rid1 |
| 785 | ); |
| 786 | } |
| 787 | pW1 = manifest_get(rid1, CFTYPE_WIKI); |
| 788 | if( pW1==0 ) fossil_redirect_home(); |
| 789 | blob_init(&w1, pW1->zWiki, -1); |
| 790 | blob_zero(&w2); |
| 791 | if( rid2 && (pW2 = manifest_get(rid2, CFTYPE_WIKI))!=0 ){ |
| 792 | blob_init(&w2, pW2->zWiki, -1); |
| 793 | } |
| 794 | blob_zero(&d); |
| 795 | diffFlags = construct_diff_flags(1,0); |
| 796 | text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO); |
| @@ -1064,11 +1064,11 @@ | |
| 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | zPageName |
| 1068 | ); |
| 1069 | if( (pWiki = manifest_get(rid, CFTYPE_WIKI))!=0 ){ |
| 1070 | zBody = pWiki->zWiki; |
| 1071 | } |
| 1072 | if( zBody==0 ){ |
| 1073 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 1074 | } |
| 1075 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | "SELECT rid FROM tagxref" |
| 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | " ORDER BY mtime DESC", zTag |
| 231 | ); |
| 232 | free(zTag); |
| 233 | pWiki = manifest_get(rid, CFTYPE_WIKI, 0); |
| 234 | if( pWiki ){ |
| 235 | zBody = pWiki->zWiki; |
| 236 | zMimetype = pWiki->zMimetype; |
| 237 | } |
| 238 | } |
| @@ -391,11 +391,11 @@ | |
| 391 | free(zTag); |
| 392 | if( (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){ |
| 393 | login_needed(); |
| 394 | return; |
| 395 | } |
| 396 | if( zBody==0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ |
| 397 | zBody = pWiki->zWiki; |
| 398 | zMimetype = pWiki->zMimetype; |
| 399 | } |
| 400 | } |
| 401 | if( P("submit")!=0 && zBody!=0 |
| @@ -632,11 +632,11 @@ | |
| 632 | blob_appendf(&body, db_get("sandbox","")); |
| 633 | appendRemark(&body, zMimetype); |
| 634 | db_set("sandbox", blob_str(&body), 0); |
| 635 | }else{ |
| 636 | login_verify_csrf_secret(); |
| 637 | pWiki = manifest_get(rid, CFTYPE_WIKI, 0); |
| 638 | if( pWiki ){ |
| 639 | blob_append(&body, pWiki->zWiki, -1); |
| 640 | manifest_destroy(pWiki); |
| 641 | } |
| 642 | blob_zero(&wiki); |
| @@ -782,15 +782,15 @@ | |
| 782 | " WHERE event.mtime<(SELECT mtime FROM event WHERE objid=%d)" |
| 783 | " ORDER BY event.mtime DESC LIMIT 1", |
| 784 | zPageName, rid1 |
| 785 | ); |
| 786 | } |
| 787 | pW1 = manifest_get(rid1, CFTYPE_WIKI, 0); |
| 788 | if( pW1==0 ) fossil_redirect_home(); |
| 789 | blob_init(&w1, pW1->zWiki, -1); |
| 790 | blob_zero(&w2); |
| 791 | if( rid2 && (pW2 = manifest_get(rid2, CFTYPE_WIKI, 0))!=0 ){ |
| 792 | blob_init(&w2, pW2->zWiki, -1); |
| 793 | } |
| 794 | blob_zero(&d); |
| 795 | diffFlags = construct_diff_flags(1,0); |
| 796 | text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO); |
| @@ -1064,11 +1064,11 @@ | |
| 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | zPageName |
| 1068 | ); |
| 1069 | if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ |
| 1070 | zBody = pWiki->zWiki; |
| 1071 | } |
| 1072 | if( zBody==0 ){ |
| 1073 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 1074 | } |
| 1075 |
+1
-1
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -337,11 +337,11 @@ | ||
| 337 | 337 | if( zDir && zDir[0] ){ |
| 338 | 338 | blob_appendf(&filename, "%s/", zDir); |
| 339 | 339 | } |
| 340 | 340 | nPrefix = blob_size(&filename); |
| 341 | 341 | |
| 342 | - pManifest = manifest_get(rid, CFTYPE_MANIFEST); | |
| 342 | + pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); | |
| 343 | 343 | if( pManifest ){ |
| 344 | 344 | char *zName; |
| 345 | 345 | zip_set_timedate(pManifest->rDate); |
| 346 | 346 | if( db_get_boolean("manifest", 0) ){ |
| 347 | 347 | blob_append(&filename, "manifest", -1); |
| 348 | 348 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -337,11 +337,11 @@ | |
| 337 | if( zDir && zDir[0] ){ |
| 338 | blob_appendf(&filename, "%s/", zDir); |
| 339 | } |
| 340 | nPrefix = blob_size(&filename); |
| 341 | |
| 342 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 343 | if( pManifest ){ |
| 344 | char *zName; |
| 345 | zip_set_timedate(pManifest->rDate); |
| 346 | if( db_get_boolean("manifest", 0) ){ |
| 347 | blob_append(&filename, "manifest", -1); |
| 348 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -337,11 +337,11 @@ | |
| 337 | if( zDir && zDir[0] ){ |
| 338 | blob_appendf(&filename, "%s/", zDir); |
| 339 | } |
| 340 | nPrefix = blob_size(&filename); |
| 341 | |
| 342 | pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 343 | if( pManifest ){ |
| 344 | char *zName; |
| 345 | zip_set_timedate(pManifest->rDate); |
| 346 | if( db_get_boolean("manifest", 0) ){ |
| 347 | blob_append(&filename, "manifest", -1); |
| 348 |