Fossil SCM

Some fossil_panic() -> fossil_fatal(). Revert output value of manifest_crosslink() to what it was: 0=error.

jan.nijtmans 2013-09-19 15:10 tkt-change-hook
Commit b6cb91ca5b1dde0e86180fb3f5767991746a76e1
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -153,11 +153,11 @@
153153
brid = content_put_ex(&branch, 0, 0, 0, isPrivate);
154154
if( brid==0 ){
155155
fossil_fatal("trouble committing manifest: %s", g.zErrMsg);
156156
}
157157
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 ){
159159
fossil_fatal("%s\n", g.zErrMsg);
160160
}
161161
assert( blob_is_reset(&branch) );
162162
content_deltify(rootid, brid, 0);
163163
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", brid);
164164
--- 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 @@
17321732
if( nvid==0 ){
17331733
fossil_fatal("trouble committing manifest: %s", g.zErrMsg);
17341734
}
17351735
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid);
17361736
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);
17391739
}
17401740
}
17411741
assert( blob_is_reset(&manifest) );
17421742
content_deltify(vid, nvid, 0);
17431743
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nvid);
17441744
--- 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
--- src/json_branch.c
+++ src/json_branch.c
@@ -292,11 +292,11 @@
292292
if( brid==0 ){
293293
fossil_fatal("Problem committing manifest: %s", g.zErrMsg);
294294
}
295295
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid);
296296
run_common_script();
297
- if( manifest_crosslink(brid, &branch) ){
297
+ if( manifest_crosslink(brid, &branch)==0 ){
298298
fossil_fatal("%s\n", g.zErrMsg);
299299
}
300300
assert( blob_is_reset(&branch) );
301301
content_deltify(rootid, brid, 0);
302302
if( zNewRid ){
303303
--- 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 @@
16631663
if( (p = manifest_cache_find(rid))!=0 ){
16641664
blob_reset(pContent);
16651665
}else if( (p = manifest_parse(pContent, rid, 0))==0 ){
16661666
assert( blob_is_reset(pContent) || pContent==0 );
16671667
fossil_error(1, "syntax error in manifest");
1668
- return 1;
1668
+ return 0;
16691669
}
16701670
if( g.xlinkClusterOnly && p->type!=CFTYPE_CLUSTER ){
16711671
manifest_destroy(p);
16721672
assert( blob_is_reset(pContent) );
16731673
fossil_error(1, "no manifest");
1674
- return 1;
1674
+ return 0;
16751675
}
16761676
if( p->type==CFTYPE_MANIFEST && fetch_baseline(p, 0) ){
16771677
manifest_destroy(p);
16781678
assert( blob_is_reset(pContent) );
16791679
fossil_error(1, "cannot fetch baseline manifest");
1680
- return 1;
1680
+ return 0;
16811681
}
16821682
db_begin_transaction();
16831683
if( p->type==CFTYPE_MANIFEST ){
16841684
hook = "xfer-commit-script";
16851685
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
@@ -1776,11 +1776,11 @@
17761776
case '-': type = 0; break; /* Cancel prior occurrences */
17771777
case '+': type = 1; break; /* Apply to target only */
17781778
case '*': type = 2; break; /* Propagate to descendants */
17791779
default:
17801780
fossil_error(1, "unknown tag type in manifest: %s", p->aTag);
1781
- return 1;
1781
+ return 0;
17821782
}
17831783
tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue,
17841784
rid, p->rDate, tid);
17851785
}
17861786
}
@@ -2030,11 +2030,11 @@
20302030
p->rDate, rid, p->zUser, blob_str(&comment)+1
20312031
);
20322032
blob_reset(&comment);
20332033
}
20342034
db_end_transaction(0);
2035
- i = run_script(hook, zUuid);
2035
+ i = run_script(hook, zUuid)==0;
20362036
if( p->type==CFTYPE_MANIFEST ){
20372037
manifest_cache_insert(p);
20382038
}else{
20392039
manifest_destroy(p);
20402040
}
20412041
--- 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 @@
524524
}else{
525525
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d);", rid);
526526
db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d);", rid);
527527
}
528528
manifest_crosslink_begin();
529
- result = manifest_crosslink(rid, pTicket);
529
+ result = manifest_crosslink(rid, pTicket)==0;
530530
assert( blob_is_reset(pTicket) );
531531
manifest_crosslink_end();
532532
return result;
533533
}
534534
@@ -1339,13 +1339,13 @@
13391339
blob_appendf(&tktchng, "K %s\n", zTktUuid);
13401340
blob_appendf(&tktchng, "U %F\n", zUser);
13411341
md5sum_blob(&tktchng, &cksum);
13421342
blob_appendf(&tktchng, "Z %b\n", &cksum);
13431343
if( run_common_script() || ticket_put(&tktchng, zTktUuid, 0)){
1344
- fossil_panic("%s\n", g.zErrMsg);
1344
+ fossil_fatal("%s\n", g.zErrMsg);
13451345
}else{
13461346
fossil_print("ticket %s succeeded for %s\n",
13471347
(eCmd==set?"set":"add"),zTktUuid);
13481348
}
13491349
}
13501350
}
13511351
}
13521352
--- 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

Keyboard Shortcuts

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