Fossil SCM
Some fossil_panic() -> fossil_fatal(). Revert output value of manifest_crosslink() to what it was: 0=error.
Commit
b6cb91ca5b1dde0e86180fb3f5767991746a76e1
Parent
06f08ed02b27d27…
5 files changed
+1
-1
+2
-2
+1
-1
+5
-5
+2
-2
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | brid = content_put_ex(&branch, 0, 0, 0, isPrivate); |
| 154 | 154 | if( brid==0 ){ |
| 155 | 155 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 156 | 156 | } |
| 157 | 157 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 158 | - if( run_common_script() || manifest_crosslink(brid, &branch) ){ | |
| 158 | + if( run_common_script() || manifest_crosslink(brid, &branch)==0 ){ | |
| 159 | 159 | fossil_fatal("%s\n", g.zErrMsg); |
| 160 | 160 | } |
| 161 | 161 | assert( blob_is_reset(&branch) ); |
| 162 | 162 | content_deltify(rootid, brid, 0); |
| 163 | 163 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", brid); |
| 164 | 164 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -153,11 +153,11 @@ | |
| 153 | brid = content_put_ex(&branch, 0, 0, 0, isPrivate); |
| 154 | if( brid==0 ){ |
| 155 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 156 | } |
| 157 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 158 | if( run_common_script() || manifest_crosslink(brid, &branch) ){ |
| 159 | fossil_fatal("%s\n", g.zErrMsg); |
| 160 | } |
| 161 | assert( blob_is_reset(&branch) ); |
| 162 | content_deltify(rootid, brid, 0); |
| 163 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", brid); |
| 164 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -153,11 +153,11 @@ | |
| 153 | brid = content_put_ex(&branch, 0, 0, 0, isPrivate); |
| 154 | if( brid==0 ){ |
| 155 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 156 | } |
| 157 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 158 | if( run_common_script() || manifest_crosslink(brid, &branch)==0 ){ |
| 159 | fossil_fatal("%s\n", g.zErrMsg); |
| 160 | } |
| 161 | assert( blob_is_reset(&branch) ); |
| 162 | content_deltify(rootid, brid, 0); |
| 163 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", brid); |
| 164 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1732,12 +1732,12 @@ | ||
| 1732 | 1732 | if( nvid==0 ){ |
| 1733 | 1733 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 1734 | 1734 | } |
| 1735 | 1735 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1736 | 1736 | if( !dryRunFlag ){ |
| 1737 | - if( run_common_script() || manifest_crosslink(nvid, &manifest) ){ | |
| 1738 | - fossil_panic("%s\n", g.zErrMsg); | |
| 1737 | + if( run_common_script() || manifest_crosslink(nvid, &manifest)==0 ){ | |
| 1738 | + fossil_fatal("%s\n", g.zErrMsg); | |
| 1739 | 1739 | } |
| 1740 | 1740 | } |
| 1741 | 1741 | assert( blob_is_reset(&manifest) ); |
| 1742 | 1742 | content_deltify(vid, nvid, 0); |
| 1743 | 1743 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid); |
| 1744 | 1744 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1732,12 +1732,12 @@ | |
| 1732 | if( nvid==0 ){ |
| 1733 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 1734 | } |
| 1735 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1736 | if( !dryRunFlag ){ |
| 1737 | if( run_common_script() || manifest_crosslink(nvid, &manifest) ){ |
| 1738 | fossil_panic("%s\n", g.zErrMsg); |
| 1739 | } |
| 1740 | } |
| 1741 | assert( blob_is_reset(&manifest) ); |
| 1742 | content_deltify(vid, nvid, 0); |
| 1743 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid); |
| 1744 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1732,12 +1732,12 @@ | |
| 1732 | if( nvid==0 ){ |
| 1733 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 1734 | } |
| 1735 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1736 | if( !dryRunFlag ){ |
| 1737 | if( run_common_script() || manifest_crosslink(nvid, &manifest)==0 ){ |
| 1738 | fossil_fatal("%s\n", g.zErrMsg); |
| 1739 | } |
| 1740 | } |
| 1741 | assert( blob_is_reset(&manifest) ); |
| 1742 | content_deltify(vid, nvid, 0); |
| 1743 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid); |
| 1744 |
+1
-1
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -292,11 +292,11 @@ | ||
| 292 | 292 | if( brid==0 ){ |
| 293 | 293 | fossil_fatal("Problem committing manifest: %s", g.zErrMsg); |
| 294 | 294 | } |
| 295 | 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | 296 | run_common_script(); |
| 297 | - if( manifest_crosslink(brid, &branch) ){ | |
| 297 | + if( manifest_crosslink(brid, &branch)==0 ){ | |
| 298 | 298 | fossil_fatal("%s\n", g.zErrMsg); |
| 299 | 299 | } |
| 300 | 300 | assert( blob_is_reset(&branch) ); |
| 301 | 301 | content_deltify(rootid, brid, 0); |
| 302 | 302 | if( zNewRid ){ |
| 303 | 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -292,11 +292,11 @@ | |
| 292 | if( brid==0 ){ |
| 293 | fossil_fatal("Problem committing manifest: %s", g.zErrMsg); |
| 294 | } |
| 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | run_common_script(); |
| 297 | if( manifest_crosslink(brid, &branch) ){ |
| 298 | fossil_fatal("%s\n", g.zErrMsg); |
| 299 | } |
| 300 | assert( blob_is_reset(&branch) ); |
| 301 | content_deltify(rootid, brid, 0); |
| 302 | if( zNewRid ){ |
| 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -292,11 +292,11 @@ | |
| 292 | if( brid==0 ){ |
| 293 | fossil_fatal("Problem committing manifest: %s", g.zErrMsg); |
| 294 | } |
| 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | run_common_script(); |
| 297 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 298 | fossil_fatal("%s\n", g.zErrMsg); |
| 299 | } |
| 300 | assert( blob_is_reset(&branch) ); |
| 301 | content_deltify(rootid, brid, 0); |
| 302 | if( zNewRid ){ |
| 303 |
+5
-5
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1663,23 +1663,23 @@ | ||
| 1663 | 1663 | if( (p = manifest_cache_find(rid))!=0 ){ |
| 1664 | 1664 | blob_reset(pContent); |
| 1665 | 1665 | }else if( (p = manifest_parse(pContent, rid, 0))==0 ){ |
| 1666 | 1666 | assert( blob_is_reset(pContent) || pContent==0 ); |
| 1667 | 1667 | fossil_error(1, "syntax error in manifest"); |
| 1668 | - return 1; | |
| 1668 | + return 0; | |
| 1669 | 1669 | } |
| 1670 | 1670 | if( g.xlinkClusterOnly && p->type!=CFTYPE_CLUSTER ){ |
| 1671 | 1671 | manifest_destroy(p); |
| 1672 | 1672 | assert( blob_is_reset(pContent) ); |
| 1673 | 1673 | fossil_error(1, "no manifest"); |
| 1674 | - return 1; | |
| 1674 | + return 0; | |
| 1675 | 1675 | } |
| 1676 | 1676 | if( p->type==CFTYPE_MANIFEST && fetch_baseline(p, 0) ){ |
| 1677 | 1677 | manifest_destroy(p); |
| 1678 | 1678 | assert( blob_is_reset(pContent) ); |
| 1679 | 1679 | fossil_error(1, "cannot fetch baseline manifest"); |
| 1680 | - return 1; | |
| 1680 | + return 0; | |
| 1681 | 1681 | } |
| 1682 | 1682 | db_begin_transaction(); |
| 1683 | 1683 | if( p->type==CFTYPE_MANIFEST ){ |
| 1684 | 1684 | hook = "xfer-commit-script"; |
| 1685 | 1685 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -1776,11 +1776,11 @@ | ||
| 1776 | 1776 | case '-': type = 0; break; /* Cancel prior occurrences */ |
| 1777 | 1777 | case '+': type = 1; break; /* Apply to target only */ |
| 1778 | 1778 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1779 | 1779 | default: |
| 1780 | 1780 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1781 | - return 1; | |
| 1781 | + return 0; | |
| 1782 | 1782 | } |
| 1783 | 1783 | tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, |
| 1784 | 1784 | rid, p->rDate, tid); |
| 1785 | 1785 | } |
| 1786 | 1786 | } |
| @@ -2030,11 +2030,11 @@ | ||
| 2030 | 2030 | p->rDate, rid, p->zUser, blob_str(&comment)+1 |
| 2031 | 2031 | ); |
| 2032 | 2032 | blob_reset(&comment); |
| 2033 | 2033 | } |
| 2034 | 2034 | db_end_transaction(0); |
| 2035 | - i = run_script(hook, zUuid); | |
| 2035 | + i = run_script(hook, zUuid)==0; | |
| 2036 | 2036 | if( p->type==CFTYPE_MANIFEST ){ |
| 2037 | 2037 | manifest_cache_insert(p); |
| 2038 | 2038 | }else{ |
| 2039 | 2039 | manifest_destroy(p); |
| 2040 | 2040 | } |
| 2041 | 2041 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1663,23 +1663,23 @@ | |
| 1663 | if( (p = manifest_cache_find(rid))!=0 ){ |
| 1664 | blob_reset(pContent); |
| 1665 | }else if( (p = manifest_parse(pContent, rid, 0))==0 ){ |
| 1666 | assert( blob_is_reset(pContent) || pContent==0 ); |
| 1667 | fossil_error(1, "syntax error in manifest"); |
| 1668 | return 1; |
| 1669 | } |
| 1670 | if( g.xlinkClusterOnly && p->type!=CFTYPE_CLUSTER ){ |
| 1671 | manifest_destroy(p); |
| 1672 | assert( blob_is_reset(pContent) ); |
| 1673 | fossil_error(1, "no manifest"); |
| 1674 | return 1; |
| 1675 | } |
| 1676 | if( p->type==CFTYPE_MANIFEST && fetch_baseline(p, 0) ){ |
| 1677 | manifest_destroy(p); |
| 1678 | assert( blob_is_reset(pContent) ); |
| 1679 | fossil_error(1, "cannot fetch baseline manifest"); |
| 1680 | return 1; |
| 1681 | } |
| 1682 | db_begin_transaction(); |
| 1683 | if( p->type==CFTYPE_MANIFEST ){ |
| 1684 | hook = "xfer-commit-script"; |
| 1685 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -1776,11 +1776,11 @@ | |
| 1776 | case '-': type = 0; break; /* Cancel prior occurrences */ |
| 1777 | case '+': type = 1; break; /* Apply to target only */ |
| 1778 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1779 | default: |
| 1780 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1781 | return 1; |
| 1782 | } |
| 1783 | tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, |
| 1784 | rid, p->rDate, tid); |
| 1785 | } |
| 1786 | } |
| @@ -2030,11 +2030,11 @@ | |
| 2030 | p->rDate, rid, p->zUser, blob_str(&comment)+1 |
| 2031 | ); |
| 2032 | blob_reset(&comment); |
| 2033 | } |
| 2034 | db_end_transaction(0); |
| 2035 | i = run_script(hook, zUuid); |
| 2036 | if( p->type==CFTYPE_MANIFEST ){ |
| 2037 | manifest_cache_insert(p); |
| 2038 | }else{ |
| 2039 | manifest_destroy(p); |
| 2040 | } |
| 2041 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1663,23 +1663,23 @@ | |
| 1663 | if( (p = manifest_cache_find(rid))!=0 ){ |
| 1664 | blob_reset(pContent); |
| 1665 | }else if( (p = manifest_parse(pContent, rid, 0))==0 ){ |
| 1666 | assert( blob_is_reset(pContent) || pContent==0 ); |
| 1667 | fossil_error(1, "syntax error in manifest"); |
| 1668 | return 0; |
| 1669 | } |
| 1670 | if( g.xlinkClusterOnly && p->type!=CFTYPE_CLUSTER ){ |
| 1671 | manifest_destroy(p); |
| 1672 | assert( blob_is_reset(pContent) ); |
| 1673 | fossil_error(1, "no manifest"); |
| 1674 | return 0; |
| 1675 | } |
| 1676 | if( p->type==CFTYPE_MANIFEST && fetch_baseline(p, 0) ){ |
| 1677 | manifest_destroy(p); |
| 1678 | assert( blob_is_reset(pContent) ); |
| 1679 | fossil_error(1, "cannot fetch baseline manifest"); |
| 1680 | return 0; |
| 1681 | } |
| 1682 | db_begin_transaction(); |
| 1683 | if( p->type==CFTYPE_MANIFEST ){ |
| 1684 | hook = "xfer-commit-script"; |
| 1685 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -1776,11 +1776,11 @@ | |
| 1776 | case '-': type = 0; break; /* Cancel prior occurrences */ |
| 1777 | case '+': type = 1; break; /* Apply to target only */ |
| 1778 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1779 | default: |
| 1780 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1781 | return 0; |
| 1782 | } |
| 1783 | tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, |
| 1784 | rid, p->rDate, tid); |
| 1785 | } |
| 1786 | } |
| @@ -2030,11 +2030,11 @@ | |
| 2030 | p->rDate, rid, p->zUser, blob_str(&comment)+1 |
| 2031 | ); |
| 2032 | blob_reset(&comment); |
| 2033 | } |
| 2034 | db_end_transaction(0); |
| 2035 | i = run_script(hook, zUuid)==0; |
| 2036 | if( p->type==CFTYPE_MANIFEST ){ |
| 2037 | manifest_cache_insert(p); |
| 2038 | }else{ |
| 2039 | manifest_destroy(p); |
| 2040 | } |
| 2041 |
+2
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -524,11 +524,11 @@ | ||
| 524 | 524 | }else{ |
| 525 | 525 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d);", rid); |
| 526 | 526 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d);", rid); |
| 527 | 527 | } |
| 528 | 528 | manifest_crosslink_begin(); |
| 529 | - result = manifest_crosslink(rid, pTicket); | |
| 529 | + result = manifest_crosslink(rid, pTicket)==0; | |
| 530 | 530 | assert( blob_is_reset(pTicket) ); |
| 531 | 531 | manifest_crosslink_end(); |
| 532 | 532 | return result; |
| 533 | 533 | } |
| 534 | 534 | |
| @@ -1339,13 +1339,13 @@ | ||
| 1339 | 1339 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1340 | 1340 | blob_appendf(&tktchng, "U %F\n", zUser); |
| 1341 | 1341 | md5sum_blob(&tktchng, &cksum); |
| 1342 | 1342 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 1343 | 1343 | if( run_common_script() || ticket_put(&tktchng, zTktUuid, 0)){ |
| 1344 | - fossil_panic("%s\n", g.zErrMsg); | |
| 1344 | + fossil_fatal("%s\n", g.zErrMsg); | |
| 1345 | 1345 | }else{ |
| 1346 | 1346 | fossil_print("ticket %s succeeded for %s\n", |
| 1347 | 1347 | (eCmd==set?"set":"add"),zTktUuid); |
| 1348 | 1348 | } |
| 1349 | 1349 | } |
| 1350 | 1350 | } |
| 1351 | 1351 | } |
| 1352 | 1352 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -524,11 +524,11 @@ | |
| 524 | }else{ |
| 525 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d);", rid); |
| 526 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d);", rid); |
| 527 | } |
| 528 | manifest_crosslink_begin(); |
| 529 | result = manifest_crosslink(rid, pTicket); |
| 530 | assert( blob_is_reset(pTicket) ); |
| 531 | manifest_crosslink_end(); |
| 532 | return result; |
| 533 | } |
| 534 | |
| @@ -1339,13 +1339,13 @@ | |
| 1339 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1340 | blob_appendf(&tktchng, "U %F\n", zUser); |
| 1341 | md5sum_blob(&tktchng, &cksum); |
| 1342 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 1343 | if( run_common_script() || ticket_put(&tktchng, zTktUuid, 0)){ |
| 1344 | fossil_panic("%s\n", g.zErrMsg); |
| 1345 | }else{ |
| 1346 | fossil_print("ticket %s succeeded for %s\n", |
| 1347 | (eCmd==set?"set":"add"),zTktUuid); |
| 1348 | } |
| 1349 | } |
| 1350 | } |
| 1351 | } |
| 1352 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -524,11 +524,11 @@ | |
| 524 | }else{ |
| 525 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d);", rid); |
| 526 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d);", rid); |
| 527 | } |
| 528 | manifest_crosslink_begin(); |
| 529 | result = manifest_crosslink(rid, pTicket)==0; |
| 530 | assert( blob_is_reset(pTicket) ); |
| 531 | manifest_crosslink_end(); |
| 532 | return result; |
| 533 | } |
| 534 | |
| @@ -1339,13 +1339,13 @@ | |
| 1339 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1340 | blob_appendf(&tktchng, "U %F\n", zUser); |
| 1341 | md5sum_blob(&tktchng, &cksum); |
| 1342 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 1343 | if( run_common_script() || ticket_put(&tktchng, zTktUuid, 0)){ |
| 1344 | fossil_fatal("%s\n", g.zErrMsg); |
| 1345 | }else{ |
| 1346 | fossil_print("ticket %s succeeded for %s\n", |
| 1347 | (eCmd==set?"set":"add"),zTktUuid); |
| 1348 | } |
| 1349 | } |
| 1350 | } |
| 1351 | } |
| 1352 |