Index: src/manifest.c ================================================================== --- src/manifest.c +++ src/manifest.c @@ -361,10 +361,11 @@ char *z; int n; char *zUuid; int sz = 0; int isRepeat, hasSelfRefTag = 0; + Blob bUuid = BLOB_INITIALIZER; static Bag seen; const char *zErr = 0; if( rid==0 ){ isRepeat = 1; @@ -404,10 +405,15 @@ if( verify_z_card(z, n)==2 ){ blob_reset(pContent); blob_appendf(pErr, "incorrect Z-card cksum"); return 0; } + + /* Store the UUID (before modifying the blob) only for error + ** reporting purposes. + */ + sha1sum_blob(pContent, &bUuid); /* Allocate a Manifest object to hold the parsed control artifact. */ p = fossil_malloc( sizeof(*p) ); memset(p, 0, sizeof(*p)); @@ -945,13 +951,18 @@ if( !seenZ ) SYNTAX("missing Z-card on control"); p->type = CFTYPE_CONTROL; } md5sum_init(); if( !isRepeat ) g.parseCnt[p->type]++; + blob_reset(&bUuid); return p; manifest_syntax_error: + if(bUuid.nUsed){ + blob_appendf(pErr, "manifest [%.40s] ", blob_str(&bUuid)); + blob_reset(&bUuid); + } if( zErr ){ blob_appendf(pErr, "line %d: %s", lineNo, zErr); }else{ blob_appendf(pErr, "unknown error on line %d", lineNo); } @@ -1734,11 +1745,14 @@ if( (p = manifest_cache_find(rid))!=0 ){ blob_reset(pContent); }else if( (p = manifest_parse(pContent, rid, 0))==0 ){ assert( blob_is_reset(pContent) || pContent==0 ); - if( (flags & MC_NO_ERRORS)==0 ) fossil_error(1, "syntax error in manifest"); + if( (flags & MC_NO_ERRORS)==0 ){ + fossil_error(1, "syntax error in manifest [%s]", + db_text(0, "SELECT uuid FROM blob WHERE rid=%d",rid)); + } return 0; } if( g.xlinkClusterOnly && p->type!=CFTYPE_CLUSTER ){ manifest_destroy(p); assert( blob_is_reset(pContent) ); @@ -1747,11 +1761,12 @@ } if( p->type==CFTYPE_MANIFEST && fetch_baseline(p, 0) ){ manifest_destroy(p); assert( blob_is_reset(pContent) ); if( (flags & MC_NO_ERRORS)==0 ){ - fossil_error(1, "cannot fetch baseline manifest"); + fossil_error(1, "cannot fetch baseline for manifest [%s]", + db_text(0, "SELECT uuid FROM blob WHERE rid=%d",rid)); } return 0; } db_begin_transaction(); if( p->type==CFTYPE_MANIFEST ){ Index: src/xfer.c ================================================================== --- src/xfer.c +++ src/xfer.c @@ -201,11 +201,11 @@ if( rid==0 ){ blob_appendf(&pXfer->err, "%s", g.zErrMsg); blob_reset(&content); }else{ if( !isPriv ) content_make_public(rid); - manifest_crosslink(rid, &content, MC_NONE|MC_NO_ERRORS); + manifest_crosslink(rid, &content, MC_NO_ERRORS); } assert( blob_is_reset(&content) ); remote_has(rid); }