Fossil SCM
Change most uses of fossil_panic() to fossil_fatal(). Modify fossil_panic() to avoid allocating heap memory and to close the database connection before doing anything else.
Commit
320f14363e1a37dc96e30e0a47cec07c6be398c4
Parent
e454de135ab734c…
23 files changed
+4
-4
+4
-4
+4
-4
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+3
-3
+1
-1
+4
-4
+1
-1
+1
-1
+2
-2
+2
-2
+1
-1
+10
-5
+2
-2
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
~
src/add.c
~
src/blob.c
~
src/branch.c
~
src/checkin.c
~
src/checkout.c
~
src/clone.c
~
src/db.c
~
src/deltacmd.c
~
src/diff.c
~
src/event.c
~
src/export.c
~
src/finfo.c
~
src/info.c
~
src/json_branch.c
~
src/main.c
~
src/pivot.c
~
src/printf.c
~
src/rebuild.c
~
src/tkt.c
~
src/update.c
~
src/user.c
~
src/verify.c
~
src/vfile.c
+4
-4
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -264,11 +264,11 @@ | ||
| 264 | 264 | if( zIgnoreFlag==0 ){ |
| 265 | 265 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | 266 | } |
| 267 | 267 | vid = db_lget_int("checkout",0); |
| 268 | 268 | if( vid==0 ){ |
| 269 | - fossil_panic("no checkout to add to"); | |
| 269 | + fossil_fatal("no checkout to add to"); | |
| 270 | 270 | } |
| 271 | 271 | db_begin_transaction(); |
| 272 | 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | 273 | filename_collation()); |
| 274 | 274 | pClean = glob_create(zCleanFlag); |
| @@ -331,11 +331,11 @@ | ||
| 331 | 331 | |
| 332 | 332 | capture_case_sensitive_option(); |
| 333 | 333 | db_must_be_within_tree(); |
| 334 | 334 | vid = db_lget_int("checkout", 0); |
| 335 | 335 | if( vid==0 ){ |
| 336 | - fossil_panic("no checkout to remove from"); | |
| 336 | + fossil_fatal("no checkout to remove from"); | |
| 337 | 337 | } |
| 338 | 338 | db_begin_transaction(); |
| 339 | 339 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 340 | 340 | filename_collation()); |
| 341 | 341 | for(i=2; i<g.argc; i++){ |
| @@ -506,11 +506,11 @@ | ||
| 506 | 506 | if( zIgnoreFlag==0 ){ |
| 507 | 507 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 508 | 508 | } |
| 509 | 509 | vid = db_lget_int("checkout",0); |
| 510 | 510 | if( vid==0 ){ |
| 511 | - fossil_panic("no checkout to add to"); | |
| 511 | + fossil_fatal("no checkout to add to"); | |
| 512 | 512 | } |
| 513 | 513 | db_begin_transaction(); |
| 514 | 514 | |
| 515 | 515 | /* step 1: |
| 516 | 516 | ** Populate the temp table "sfile" with the names of all unmanaged |
| @@ -611,11 +611,11 @@ | ||
| 611 | 611 | |
| 612 | 612 | capture_case_sensitive_option(); |
| 613 | 613 | db_must_be_within_tree(); |
| 614 | 614 | vid = db_lget_int("checkout", 0); |
| 615 | 615 | if( vid==0 ){ |
| 616 | - fossil_panic("no checkout rename files in"); | |
| 616 | + fossil_fatal("no checkout rename files in"); | |
| 617 | 617 | } |
| 618 | 618 | if( g.argc<4 ){ |
| 619 | 619 | usage("OLDNAME NEWNAME"); |
| 620 | 620 | } |
| 621 | 621 | zDest = g.argv[g.argc-1]; |
| 622 | 622 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -264,11 +264,11 @@ | |
| 264 | if( zIgnoreFlag==0 ){ |
| 265 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | } |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| 269 | fossil_panic("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | filename_collation()); |
| 274 | pClean = glob_create(zCleanFlag); |
| @@ -331,11 +331,11 @@ | |
| 331 | |
| 332 | capture_case_sensitive_option(); |
| 333 | db_must_be_within_tree(); |
| 334 | vid = db_lget_int("checkout", 0); |
| 335 | if( vid==0 ){ |
| 336 | fossil_panic("no checkout to remove from"); |
| 337 | } |
| 338 | db_begin_transaction(); |
| 339 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 340 | filename_collation()); |
| 341 | for(i=2; i<g.argc; i++){ |
| @@ -506,11 +506,11 @@ | |
| 506 | if( zIgnoreFlag==0 ){ |
| 507 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 508 | } |
| 509 | vid = db_lget_int("checkout",0); |
| 510 | if( vid==0 ){ |
| 511 | fossil_panic("no checkout to add to"); |
| 512 | } |
| 513 | db_begin_transaction(); |
| 514 | |
| 515 | /* step 1: |
| 516 | ** Populate the temp table "sfile" with the names of all unmanaged |
| @@ -611,11 +611,11 @@ | |
| 611 | |
| 612 | capture_case_sensitive_option(); |
| 613 | db_must_be_within_tree(); |
| 614 | vid = db_lget_int("checkout", 0); |
| 615 | if( vid==0 ){ |
| 616 | fossil_panic("no checkout rename files in"); |
| 617 | } |
| 618 | if( g.argc<4 ){ |
| 619 | usage("OLDNAME NEWNAME"); |
| 620 | } |
| 621 | zDest = g.argv[g.argc-1]; |
| 622 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -264,11 +264,11 @@ | |
| 264 | if( zIgnoreFlag==0 ){ |
| 265 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | } |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| 269 | fossil_fatal("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | filename_collation()); |
| 274 | pClean = glob_create(zCleanFlag); |
| @@ -331,11 +331,11 @@ | |
| 331 | |
| 332 | capture_case_sensitive_option(); |
| 333 | db_must_be_within_tree(); |
| 334 | vid = db_lget_int("checkout", 0); |
| 335 | if( vid==0 ){ |
| 336 | fossil_fatal("no checkout to remove from"); |
| 337 | } |
| 338 | db_begin_transaction(); |
| 339 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 340 | filename_collation()); |
| 341 | for(i=2; i<g.argc; i++){ |
| @@ -506,11 +506,11 @@ | |
| 506 | if( zIgnoreFlag==0 ){ |
| 507 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 508 | } |
| 509 | vid = db_lget_int("checkout",0); |
| 510 | if( vid==0 ){ |
| 511 | fossil_fatal("no checkout to add to"); |
| 512 | } |
| 513 | db_begin_transaction(); |
| 514 | |
| 515 | /* step 1: |
| 516 | ** Populate the temp table "sfile" with the names of all unmanaged |
| @@ -611,11 +611,11 @@ | |
| 611 | |
| 612 | capture_case_sensitive_option(); |
| 613 | db_must_be_within_tree(); |
| 614 | vid = db_lget_int("checkout", 0); |
| 615 | if( vid==0 ){ |
| 616 | fossil_fatal("no checkout rename files in"); |
| 617 | } |
| 618 | if( g.argc<4 ){ |
| 619 | usage("OLDNAME NEWNAME"); |
| 620 | } |
| 621 | zDest = g.argv[g.argc-1]; |
| 622 |
+4
-4
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -700,11 +700,11 @@ | ||
| 700 | 700 | ** Initialize a blob to be the content of a file. If the filename |
| 701 | 701 | ** is blank or "-" then read from standard input. |
| 702 | 702 | ** |
| 703 | 703 | ** Any prior content of the blob is discarded, not freed. |
| 704 | 704 | ** |
| 705 | -** Return the number of bytes read. Calls fossil_panic() error (i.e. | |
| 705 | +** Return the number of bytes read. Calls fossil_fatal() error (i.e. | |
| 706 | 706 | ** it exit()s and does not return). |
| 707 | 707 | */ |
| 708 | 708 | int blob_read_from_file(Blob *pBlob, const char *zFilename){ |
| 709 | 709 | int size, got; |
| 710 | 710 | FILE *in; |
| @@ -721,11 +721,11 @@ | ||
| 721 | 721 | return 0; |
| 722 | 722 | } |
| 723 | 723 | blob_resize(pBlob, size); |
| 724 | 724 | in = fossil_fopen(zFilename, "rb"); |
| 725 | 725 | if( in==0 ){ |
| 726 | - fossil_panic("cannot open %s for reading", zFilename); | |
| 726 | + fossil_fatal("cannot open %s for reading", zFilename); | |
| 727 | 727 | } |
| 728 | 728 | got = fread(blob_buffer(pBlob), 1, size, in); |
| 729 | 729 | fclose(in); |
| 730 | 730 | if( got<size ){ |
| 731 | 731 | blob_resize(pBlob, got); |
| @@ -744,11 +744,11 @@ | ||
| 744 | 744 | int blob_read_link(Blob *pBlob, const char *zFilename){ |
| 745 | 745 | #if !defined(_WIN32) |
| 746 | 746 | char zBuf[1024]; |
| 747 | 747 | ssize_t len = readlink(zFilename, zBuf, 1023); |
| 748 | 748 | if( len < 0 ){ |
| 749 | - fossil_panic("cannot read symbolic link %s", zFilename); | |
| 749 | + fossil_fatal("cannot read symbolic link %s", zFilename); | |
| 750 | 750 | } |
| 751 | 751 | zBuf[len] = 0; /* null-terminate */ |
| 752 | 752 | blob_zero(pBlob); |
| 753 | 753 | blob_appendf(pBlob, "%s", zBuf); |
| 754 | 754 | return len; |
| @@ -978,11 +978,11 @@ | ||
| 978 | 978 | for(i=2; i<g.argc; i++){ |
| 979 | 979 | blob_read_from_file(&b1, g.argv[i]); |
| 980 | 980 | blob_compress(&b1, &b2); |
| 981 | 981 | blob_uncompress(&b2, &b3); |
| 982 | 982 | if( blob_compare(&b1, &b3) ){ |
| 983 | - fossil_panic("compress/uncompress cycle failed for %s", g.argv[i]); | |
| 983 | + fossil_fatal("compress/uncompress cycle failed for %s", g.argv[i]); | |
| 984 | 984 | } |
| 985 | 985 | blob_reset(&b1); |
| 986 | 986 | blob_reset(&b2); |
| 987 | 987 | blob_reset(&b3); |
| 988 | 988 | } |
| 989 | 989 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -700,11 +700,11 @@ | |
| 700 | ** Initialize a blob to be the content of a file. If the filename |
| 701 | ** is blank or "-" then read from standard input. |
| 702 | ** |
| 703 | ** Any prior content of the blob is discarded, not freed. |
| 704 | ** |
| 705 | ** Return the number of bytes read. Calls fossil_panic() error (i.e. |
| 706 | ** it exit()s and does not return). |
| 707 | */ |
| 708 | int blob_read_from_file(Blob *pBlob, const char *zFilename){ |
| 709 | int size, got; |
| 710 | FILE *in; |
| @@ -721,11 +721,11 @@ | |
| 721 | return 0; |
| 722 | } |
| 723 | blob_resize(pBlob, size); |
| 724 | in = fossil_fopen(zFilename, "rb"); |
| 725 | if( in==0 ){ |
| 726 | fossil_panic("cannot open %s for reading", zFilename); |
| 727 | } |
| 728 | got = fread(blob_buffer(pBlob), 1, size, in); |
| 729 | fclose(in); |
| 730 | if( got<size ){ |
| 731 | blob_resize(pBlob, got); |
| @@ -744,11 +744,11 @@ | |
| 744 | int blob_read_link(Blob *pBlob, const char *zFilename){ |
| 745 | #if !defined(_WIN32) |
| 746 | char zBuf[1024]; |
| 747 | ssize_t len = readlink(zFilename, zBuf, 1023); |
| 748 | if( len < 0 ){ |
| 749 | fossil_panic("cannot read symbolic link %s", zFilename); |
| 750 | } |
| 751 | zBuf[len] = 0; /* null-terminate */ |
| 752 | blob_zero(pBlob); |
| 753 | blob_appendf(pBlob, "%s", zBuf); |
| 754 | return len; |
| @@ -978,11 +978,11 @@ | |
| 978 | for(i=2; i<g.argc; i++){ |
| 979 | blob_read_from_file(&b1, g.argv[i]); |
| 980 | blob_compress(&b1, &b2); |
| 981 | blob_uncompress(&b2, &b3); |
| 982 | if( blob_compare(&b1, &b3) ){ |
| 983 | fossil_panic("compress/uncompress cycle failed for %s", g.argv[i]); |
| 984 | } |
| 985 | blob_reset(&b1); |
| 986 | blob_reset(&b2); |
| 987 | blob_reset(&b3); |
| 988 | } |
| 989 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -700,11 +700,11 @@ | |
| 700 | ** Initialize a blob to be the content of a file. If the filename |
| 701 | ** is blank or "-" then read from standard input. |
| 702 | ** |
| 703 | ** Any prior content of the blob is discarded, not freed. |
| 704 | ** |
| 705 | ** Return the number of bytes read. Calls fossil_fatal() error (i.e. |
| 706 | ** it exit()s and does not return). |
| 707 | */ |
| 708 | int blob_read_from_file(Blob *pBlob, const char *zFilename){ |
| 709 | int size, got; |
| 710 | FILE *in; |
| @@ -721,11 +721,11 @@ | |
| 721 | return 0; |
| 722 | } |
| 723 | blob_resize(pBlob, size); |
| 724 | in = fossil_fopen(zFilename, "rb"); |
| 725 | if( in==0 ){ |
| 726 | fossil_fatal("cannot open %s for reading", zFilename); |
| 727 | } |
| 728 | got = fread(blob_buffer(pBlob), 1, size, in); |
| 729 | fclose(in); |
| 730 | if( got<size ){ |
| 731 | blob_resize(pBlob, got); |
| @@ -744,11 +744,11 @@ | |
| 744 | int blob_read_link(Blob *pBlob, const char *zFilename){ |
| 745 | #if !defined(_WIN32) |
| 746 | char zBuf[1024]; |
| 747 | ssize_t len = readlink(zFilename, zBuf, 1023); |
| 748 | if( len < 0 ){ |
| 749 | fossil_fatal("cannot read symbolic link %s", zFilename); |
| 750 | } |
| 751 | zBuf[len] = 0; /* null-terminate */ |
| 752 | blob_zero(pBlob); |
| 753 | blob_appendf(pBlob, "%s", zBuf); |
| 754 | return len; |
| @@ -978,11 +978,11 @@ | |
| 978 | for(i=2; i<g.argc; i++){ |
| 979 | blob_read_from_file(&b1, g.argv[i]); |
| 980 | blob_compress(&b1, &b2); |
| 981 | blob_uncompress(&b2, &b3); |
| 982 | if( blob_compare(&b1, &b3) ){ |
| 983 | fossil_fatal("compress/uncompress cycle failed for %s", g.argv[i]); |
| 984 | } |
| 985 | blob_reset(&b1); |
| 986 | blob_reset(&b2); |
| 987 | blob_reset(&b3); |
| 988 | } |
| 989 |
+4
-4
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -56,11 +56,11 @@ | ||
| 56 | 56 | noSign = db_get_int("omitsign", 0)|noSign; |
| 57 | 57 | |
| 58 | 58 | /* fossil branch new name */ |
| 59 | 59 | zBranch = g.argv[3]; |
| 60 | 60 | if( zBranch==0 || zBranch[0]==0 ){ |
| 61 | - fossil_panic("branch name cannot be empty"); | |
| 61 | + fossil_fatal("branch name cannot be empty"); | |
| 62 | 62 | } |
| 63 | 63 | if( db_exists( |
| 64 | 64 | "SELECT 1 FROM tagxref" |
| 65 | 65 | " WHERE tagtype>0" |
| 66 | 66 | " AND tagid=(SELECT tagid FROM tag WHERE tagname='sym-%q')", |
| @@ -150,15 +150,15 @@ | ||
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | brid = content_put_ex(&branch, 0, 0, 0, isPrivate); |
| 154 | 154 | if( brid==0 ){ |
| 155 | - fossil_panic("trouble committing manifest: %s", g.zErrMsg); | |
| 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 | 158 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 159 | - fossil_panic("unable to install new manifest"); | |
| 159 | + fossil_fatal("unable to install new manifest"); | |
| 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 | fossil_print("New branch: %s\n", zUuid); |
| @@ -279,11 +279,11 @@ | ||
| 279 | 279 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 280 | 280 | fossil_print("%s%s\n", (isCur ? "* " : " "), zBr); |
| 281 | 281 | } |
| 282 | 282 | db_finalize(&q); |
| 283 | 283 | }else{ |
| 284 | - fossil_panic("branch subcommand should be one of: " | |
| 284 | + fossil_fatal("branch subcommand should be one of: " | |
| 285 | 285 | "new list ls"); |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /* |
| 290 | 290 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -56,11 +56,11 @@ | |
| 56 | noSign = db_get_int("omitsign", 0)|noSign; |
| 57 | |
| 58 | /* fossil branch new name */ |
| 59 | zBranch = g.argv[3]; |
| 60 | if( zBranch==0 || zBranch[0]==0 ){ |
| 61 | fossil_panic("branch name cannot be empty"); |
| 62 | } |
| 63 | if( db_exists( |
| 64 | "SELECT 1 FROM tagxref" |
| 65 | " WHERE tagtype>0" |
| 66 | " AND tagid=(SELECT tagid FROM tag WHERE tagname='sym-%q')", |
| @@ -150,15 +150,15 @@ | |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | brid = content_put_ex(&branch, 0, 0, 0, isPrivate); |
| 154 | if( brid==0 ){ |
| 155 | fossil_panic("trouble committing manifest: %s", g.zErrMsg); |
| 156 | } |
| 157 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 158 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 159 | fossil_panic("unable to install new manifest"); |
| 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 | fossil_print("New branch: %s\n", zUuid); |
| @@ -279,11 +279,11 @@ | |
| 279 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 280 | fossil_print("%s%s\n", (isCur ? "* " : " "), zBr); |
| 281 | } |
| 282 | db_finalize(&q); |
| 283 | }else{ |
| 284 | fossil_panic("branch subcommand should be one of: " |
| 285 | "new list ls"); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /* |
| 290 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -56,11 +56,11 @@ | |
| 56 | noSign = db_get_int("omitsign", 0)|noSign; |
| 57 | |
| 58 | /* fossil branch new name */ |
| 59 | zBranch = g.argv[3]; |
| 60 | if( zBranch==0 || zBranch[0]==0 ){ |
| 61 | fossil_fatal("branch name cannot be empty"); |
| 62 | } |
| 63 | if( db_exists( |
| 64 | "SELECT 1 FROM tagxref" |
| 65 | " WHERE tagtype>0" |
| 66 | " AND tagid=(SELECT tagid FROM tag WHERE tagname='sym-%q')", |
| @@ -150,15 +150,15 @@ | |
| 150 | } |
| 151 | } |
| 152 | |
| 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( manifest_crosslink(brid, &branch)==0 ){ |
| 159 | fossil_fatal("unable to install new manifest"); |
| 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 | fossil_print("New branch: %s\n", zUuid); |
| @@ -279,11 +279,11 @@ | |
| 279 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 280 | fossil_print("%s%s\n", (isCur ? "* " : " "), zBr); |
| 281 | } |
| 282 | db_finalize(&q); |
| 283 | }else{ |
| 284 | fossil_fatal("branch subcommand should be one of: " |
| 285 | "new list ls"); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /* |
| 290 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1690,11 +1690,11 @@ | ||
| 1690 | 1690 | manifest = delta; |
| 1691 | 1691 | }else{ |
| 1692 | 1692 | blob_reset(&delta); |
| 1693 | 1693 | } |
| 1694 | 1694 | }else if( forceDelta ){ |
| 1695 | - fossil_panic("unable to find a baseline-manifest for the delta"); | |
| 1695 | + fossil_fatal("unable to find a baseline-manifest for the delta"); | |
| 1696 | 1696 | } |
| 1697 | 1697 | } |
| 1698 | 1698 | if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){ |
| 1699 | 1699 | blob_zero(&ans); |
| 1700 | 1700 | prompt_user("unable to sign manifest. continue (y/N)? ", &ans); |
| @@ -1718,11 +1718,11 @@ | ||
| 1718 | 1718 | free(zManifestFile); |
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | nvid = content_put(&manifest); |
| 1722 | 1722 | if( nvid==0 ){ |
| 1723 | - fossil_panic("trouble committing manifest: %s", g.zErrMsg); | |
| 1723 | + fossil_fatal("trouble committing manifest: %s", g.zErrMsg); | |
| 1724 | 1724 | } |
| 1725 | 1725 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1726 | 1726 | manifest_crosslink(nvid, &manifest); |
| 1727 | 1727 | assert( blob_is_reset(&manifest) ); |
| 1728 | 1728 | content_deltify(vid, nvid, 0); |
| 1729 | 1729 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1690,11 +1690,11 @@ | |
| 1690 | manifest = delta; |
| 1691 | }else{ |
| 1692 | blob_reset(&delta); |
| 1693 | } |
| 1694 | }else if( forceDelta ){ |
| 1695 | fossil_panic("unable to find a baseline-manifest for the delta"); |
| 1696 | } |
| 1697 | } |
| 1698 | if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){ |
| 1699 | blob_zero(&ans); |
| 1700 | prompt_user("unable to sign manifest. continue (y/N)? ", &ans); |
| @@ -1718,11 +1718,11 @@ | |
| 1718 | free(zManifestFile); |
| 1719 | } |
| 1720 | |
| 1721 | nvid = content_put(&manifest); |
| 1722 | if( nvid==0 ){ |
| 1723 | fossil_panic("trouble committing manifest: %s", g.zErrMsg); |
| 1724 | } |
| 1725 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1726 | manifest_crosslink(nvid, &manifest); |
| 1727 | assert( blob_is_reset(&manifest) ); |
| 1728 | content_deltify(vid, nvid, 0); |
| 1729 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1690,11 +1690,11 @@ | |
| 1690 | manifest = delta; |
| 1691 | }else{ |
| 1692 | blob_reset(&delta); |
| 1693 | } |
| 1694 | }else if( forceDelta ){ |
| 1695 | fossil_fatal("unable to find a baseline-manifest for the delta"); |
| 1696 | } |
| 1697 | } |
| 1698 | if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){ |
| 1699 | blob_zero(&ans); |
| 1700 | prompt_user("unable to sign manifest. continue (y/N)? ", &ans); |
| @@ -1718,11 +1718,11 @@ | |
| 1718 | free(zManifestFile); |
| 1719 | } |
| 1720 | |
| 1721 | nvid = content_put(&manifest); |
| 1722 | if( nvid==0 ){ |
| 1723 | fossil_fatal("trouble committing manifest: %s", g.zErrMsg); |
| 1724 | } |
| 1725 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nvid); |
| 1726 | manifest_crosslink(nvid, &manifest); |
| 1727 | assert( blob_is_reset(&manifest) ); |
| 1728 | content_deltify(vid, nvid, 0); |
| 1729 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | Blob uuid; |
| 62 | 62 | int vid; |
| 63 | 63 | |
| 64 | 64 | blob_init(&uuid, zName, -1); |
| 65 | 65 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| 66 | - fossil_panic(g.zErrMsg); | |
| 66 | + fossil_fatal(g.zErrMsg); | |
| 67 | 67 | } |
| 68 | 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | 69 | if( vid==0 ){ |
| 70 | 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 | 71 | } |
| 72 | 72 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | Blob uuid; |
| 62 | int vid; |
| 63 | |
| 64 | blob_init(&uuid, zName, -1); |
| 65 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| 66 | fossil_panic(g.zErrMsg); |
| 67 | } |
| 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | if( vid==0 ){ |
| 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 | } |
| 72 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | Blob uuid; |
| 62 | int vid; |
| 63 | |
| 64 | blob_init(&uuid, zName, -1); |
| 65 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| 66 | fossil_fatal(g.zErrMsg); |
| 67 | } |
| 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | if( vid==0 ){ |
| 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 | } |
| 72 |
+1
-1
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -123,11 +123,11 @@ | ||
| 123 | 123 | if( g.argc < 4 ){ |
| 124 | 124 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 125 | 125 | } |
| 126 | 126 | db_open_config(0); |
| 127 | 127 | if( file_size(g.argv[3])>0 ){ |
| 128 | - fossil_panic("file already exists: %s", g.argv[3]); | |
| 128 | + fossil_fatal("file already exists: %s", g.argv[3]); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | zDefaultUser = find_option("admin-user","A",1); |
| 132 | 132 | |
| 133 | 133 | url_parse(g.argv[2], URL_PROMPT_PW|URL_ASK_REMEMBER_PW); |
| 134 | 134 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -123,11 +123,11 @@ | |
| 123 | if( g.argc < 4 ){ |
| 124 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 125 | } |
| 126 | db_open_config(0); |
| 127 | if( file_size(g.argv[3])>0 ){ |
| 128 | fossil_panic("file already exists: %s", g.argv[3]); |
| 129 | } |
| 130 | |
| 131 | zDefaultUser = find_option("admin-user","A",1); |
| 132 | |
| 133 | url_parse(g.argv[2], URL_PROMPT_PW|URL_ASK_REMEMBER_PW); |
| 134 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -123,11 +123,11 @@ | |
| 123 | if( g.argc < 4 ){ |
| 124 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 125 | } |
| 126 | db_open_config(0); |
| 127 | if( file_size(g.argv[3])>0 ){ |
| 128 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 129 | } |
| 130 | |
| 131 | zDefaultUser = find_option("admin-user","A",1); |
| 132 | |
| 133 | url_parse(g.argv[2], URL_PROMPT_PW|URL_ASK_REMEMBER_PW); |
| 134 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1994,11 +1994,11 @@ | ||
| 1994 | 1994 | allowNested = find_option("nested",0,0)!=0; |
| 1995 | 1995 | if( g.argc!=3 && g.argc!=4 ){ |
| 1996 | 1996 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1997 | 1997 | } |
| 1998 | 1998 | if( !allowNested && db_open_local(0) ){ |
| 1999 | - fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); | |
| 1999 | + fossil_fatal("already within an open tree rooted at %s", g.zLocalRoot); | |
| 2000 | 2000 | } |
| 2001 | 2001 | db_open_repository(g.argv[2]); |
| 2002 | 2002 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2003 | 2003 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2004 | 2004 | #else |
| 2005 | 2005 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1994,11 +1994,11 @@ | |
| 1994 | allowNested = find_option("nested",0,0)!=0; |
| 1995 | if( g.argc!=3 && g.argc!=4 ){ |
| 1996 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1997 | } |
| 1998 | if( !allowNested && db_open_local(0) ){ |
| 1999 | fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); |
| 2000 | } |
| 2001 | db_open_repository(g.argv[2]); |
| 2002 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2003 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2004 | #else |
| 2005 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1994,11 +1994,11 @@ | |
| 1994 | allowNested = find_option("nested",0,0)!=0; |
| 1995 | if( g.argc!=3 && g.argc!=4 ){ |
| 1996 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1997 | } |
| 1998 | if( !allowNested && db_open_local(0) ){ |
| 1999 | fossil_fatal("already within an open tree rooted at %s", g.zLocalRoot); |
| 2000 | } |
| 2001 | db_open_repository(g.argv[2]); |
| 2002 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2003 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2004 | #else |
| 2005 |
+1
-1
| --- src/deltacmd.c | ||
| +++ src/deltacmd.c | ||
| @@ -144,9 +144,9 @@ | ||
| 144 | 144 | blob_delta_create(&f1, &f2, &d12); |
| 145 | 145 | blob_delta_create(&f2, &f1, &d21); |
| 146 | 146 | blob_delta_apply(&f1, &d12, &a2); |
| 147 | 147 | blob_delta_apply(&f2, &d21, &a1); |
| 148 | 148 | if( blob_compare(&f1,&a1) || blob_compare(&f2, &a2) ){ |
| 149 | - fossil_panic("delta test failed"); | |
| 149 | + fossil_fatal("delta test failed"); | |
| 150 | 150 | } |
| 151 | 151 | fossil_print("ok\n"); |
| 152 | 152 | } |
| 153 | 153 |
| --- src/deltacmd.c | |
| +++ src/deltacmd.c | |
| @@ -144,9 +144,9 @@ | |
| 144 | blob_delta_create(&f1, &f2, &d12); |
| 145 | blob_delta_create(&f2, &f1, &d21); |
| 146 | blob_delta_apply(&f1, &d12, &a2); |
| 147 | blob_delta_apply(&f2, &d21, &a1); |
| 148 | if( blob_compare(&f1,&a1) || blob_compare(&f2, &a2) ){ |
| 149 | fossil_panic("delta test failed"); |
| 150 | } |
| 151 | fossil_print("ok\n"); |
| 152 | } |
| 153 |
| --- src/deltacmd.c | |
| +++ src/deltacmd.c | |
| @@ -144,9 +144,9 @@ | |
| 144 | blob_delta_create(&f1, &f2, &d12); |
| 145 | blob_delta_create(&f2, &f1, &d21); |
| 146 | blob_delta_apply(&f1, &d12, &a2); |
| 147 | blob_delta_apply(&f2, &d21, &a1); |
| 148 | if( blob_compare(&f1,&a1) || blob_compare(&f2, &a2) ){ |
| 149 | fossil_fatal("delta test failed"); |
| 150 | } |
| 151 | fossil_print("ok\n"); |
| 152 | } |
| 153 |
+3
-3
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2046,14 +2046,14 @@ | ||
| 2046 | 2046 | int cnt = 0; /* Number of versions examined */ |
| 2047 | 2047 | |
| 2048 | 2048 | /* Initialize the annotation */ |
| 2049 | 2049 | rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid); |
| 2050 | 2050 | if( rid==0 ){ |
| 2051 | - fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid); | |
| 2051 | + fossil_fatal("file #%d is unchanged in manifest #%d", fnid, mid); | |
| 2052 | 2052 | } |
| 2053 | 2053 | if( !content_get(rid, &toAnnotate) ){ |
| 2054 | - fossil_panic("unable to retrieve content of artifact #%d", rid); | |
| 2054 | + fossil_fatal("unable to retrieve content of artifact #%d", rid); | |
| 2055 | 2055 | } |
| 2056 | 2056 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2057 | 2057 | annotation_start(p, &toAnnotate); |
| 2058 | 2058 | db_begin_transaction(); |
| 2059 | 2059 | db_multi_exec( |
| @@ -2329,11 +2329,11 @@ | ||
| 2329 | 2329 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2330 | 2330 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2331 | 2331 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2332 | 2332 | fid, fnid); |
| 2333 | 2333 | if( mid==0 ){ |
| 2334 | - fossil_panic("unable to find manifest"); | |
| 2334 | + fossil_fatal("unable to find manifest"); | |
| 2335 | 2335 | } |
| 2336 | 2336 | annFlags |= ANN_FILE_ANCEST; |
| 2337 | 2337 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2338 | 2338 | if( showLog ){ |
| 2339 | 2339 | struct AnnVers *p; |
| 2340 | 2340 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2046,14 +2046,14 @@ | |
| 2046 | int cnt = 0; /* Number of versions examined */ |
| 2047 | |
| 2048 | /* Initialize the annotation */ |
| 2049 | rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid); |
| 2050 | if( rid==0 ){ |
| 2051 | fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid); |
| 2052 | } |
| 2053 | if( !content_get(rid, &toAnnotate) ){ |
| 2054 | fossil_panic("unable to retrieve content of artifact #%d", rid); |
| 2055 | } |
| 2056 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2057 | annotation_start(p, &toAnnotate); |
| 2058 | db_begin_transaction(); |
| 2059 | db_multi_exec( |
| @@ -2329,11 +2329,11 @@ | |
| 2329 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2330 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2331 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2332 | fid, fnid); |
| 2333 | if( mid==0 ){ |
| 2334 | fossil_panic("unable to find manifest"); |
| 2335 | } |
| 2336 | annFlags |= ANN_FILE_ANCEST; |
| 2337 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2338 | if( showLog ){ |
| 2339 | struct AnnVers *p; |
| 2340 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2046,14 +2046,14 @@ | |
| 2046 | int cnt = 0; /* Number of versions examined */ |
| 2047 | |
| 2048 | /* Initialize the annotation */ |
| 2049 | rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid); |
| 2050 | if( rid==0 ){ |
| 2051 | fossil_fatal("file #%d is unchanged in manifest #%d", fnid, mid); |
| 2052 | } |
| 2053 | if( !content_get(rid, &toAnnotate) ){ |
| 2054 | fossil_fatal("unable to retrieve content of artifact #%d", rid); |
| 2055 | } |
| 2056 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2057 | annotation_start(p, &toAnnotate); |
| 2058 | db_begin_transaction(); |
| 2059 | db_multi_exec( |
| @@ -2329,11 +2329,11 @@ | |
| 2329 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2330 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2331 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2332 | fid, fnid); |
| 2333 | if( mid==0 ){ |
| 2334 | fossil_fatal("unable to find manifest"); |
| 2335 | } |
| 2336 | annFlags |= ANN_FILE_ANCEST; |
| 2337 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2338 | if( showLog ){ |
| 2339 | struct AnnVers *p; |
| 2340 |
+1
-1
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -115,11 +115,11 @@ | ||
| 115 | 115 | |
| 116 | 116 | /* Extract the event content. |
| 117 | 117 | */ |
| 118 | 118 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 119 | 119 | if( pEvent==0 ){ |
| 120 | - fossil_panic("Object #%d is not an event", rid); | |
| 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) ){ |
| 124 | 124 | style_header(blob_str(&title)); |
| 125 | 125 | }else{ |
| 126 | 126 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -115,11 +115,11 @@ | |
| 115 | |
| 116 | /* Extract the event content. |
| 117 | */ |
| 118 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 119 | if( pEvent==0 ){ |
| 120 | fossil_panic("Object #%d is not an event", rid); |
| 121 | } |
| 122 | blob_init(&fullbody, pEvent->zWiki, -1); |
| 123 | if( wiki_find_title(&fullbody, &title, &tail) ){ |
| 124 | style_header(blob_str(&title)); |
| 125 | }else{ |
| 126 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -115,11 +115,11 @@ | |
| 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) ){ |
| 124 | style_header(blob_str(&title)); |
| 125 | }else{ |
| 126 |
+4
-4
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | char line[100]; |
| 139 | 139 | FILE *f; |
| 140 | 140 | |
| 141 | 141 | f = fossil_fopen(markfile_in, "r"); |
| 142 | 142 | if( f==0 ){ |
| 143 | - fossil_panic("cannot open %s for reading", markfile_in); | |
| 143 | + fossil_fatal("cannot open %s for reading", markfile_in); | |
| 144 | 144 | } |
| 145 | 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| 147 | 147 | while( fgets(line, sizeof(line), f)!=0 ){ |
| 148 | 148 | if( *line == 'b' ){ |
| @@ -154,11 +154,11 @@ | ||
| 154 | 154 | db_bind_text(&qc, ":rid", line + 1); |
| 155 | 155 | db_step(&qc); |
| 156 | 156 | db_reset(&qc); |
| 157 | 157 | bag_insert(&vers, atoi(line + 1)); |
| 158 | 158 | }else{ |
| 159 | - fossil_panic("bad input from %s: %s", markfile_in, line); | |
| 159 | + fossil_fatal("bad input from %s: %s", markfile_in, line); | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | db_finalize(&qb); |
| 163 | 163 | db_finalize(&qc); |
| 164 | 164 | fclose(f); |
| @@ -335,11 +335,11 @@ | ||
| 335 | 335 | |
| 336 | 336 | if( markfile_out!=0 ){ |
| 337 | 337 | FILE *f; |
| 338 | 338 | f = fossil_fopen(markfile_out, "w"); |
| 339 | 339 | if( f == 0 ){ |
| 340 | - fossil_panic("cannot open %s for writing", markfile_out); | |
| 340 | + fossil_fatal("cannot open %s for writing", markfile_out); | |
| 341 | 341 | } |
| 342 | 342 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 343 | 343 | while( db_step(&q)==SQLITE_ROW ){ |
| 344 | 344 | fprintf(f, "b%d\n", db_column_int(&q, 0)); |
| 345 | 345 | } |
| @@ -348,9 +348,9 @@ | ||
| 348 | 348 | while( db_step(&q)==SQLITE_ROW ){ |
| 349 | 349 | fprintf(f, "c%d\n", db_column_int(&q, 0)); |
| 350 | 350 | } |
| 351 | 351 | db_finalize(&q); |
| 352 | 352 | if( ferror(f)!=0 || fclose(f)!=0 ) { |
| 353 | - fossil_panic("error while writing %s", markfile_out); | |
| 353 | + fossil_fatal("error while writing %s", markfile_out); | |
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | char line[100]; |
| 139 | FILE *f; |
| 140 | |
| 141 | f = fossil_fopen(markfile_in, "r"); |
| 142 | if( f==0 ){ |
| 143 | fossil_panic("cannot open %s for reading", markfile_in); |
| 144 | } |
| 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| 147 | while( fgets(line, sizeof(line), f)!=0 ){ |
| 148 | if( *line == 'b' ){ |
| @@ -154,11 +154,11 @@ | |
| 154 | db_bind_text(&qc, ":rid", line + 1); |
| 155 | db_step(&qc); |
| 156 | db_reset(&qc); |
| 157 | bag_insert(&vers, atoi(line + 1)); |
| 158 | }else{ |
| 159 | fossil_panic("bad input from %s: %s", markfile_in, line); |
| 160 | } |
| 161 | } |
| 162 | db_finalize(&qb); |
| 163 | db_finalize(&qc); |
| 164 | fclose(f); |
| @@ -335,11 +335,11 @@ | |
| 335 | |
| 336 | if( markfile_out!=0 ){ |
| 337 | FILE *f; |
| 338 | f = fossil_fopen(markfile_out, "w"); |
| 339 | if( f == 0 ){ |
| 340 | fossil_panic("cannot open %s for writing", markfile_out); |
| 341 | } |
| 342 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 343 | while( db_step(&q)==SQLITE_ROW ){ |
| 344 | fprintf(f, "b%d\n", db_column_int(&q, 0)); |
| 345 | } |
| @@ -348,9 +348,9 @@ | |
| 348 | while( db_step(&q)==SQLITE_ROW ){ |
| 349 | fprintf(f, "c%d\n", db_column_int(&q, 0)); |
| 350 | } |
| 351 | db_finalize(&q); |
| 352 | if( ferror(f)!=0 || fclose(f)!=0 ) { |
| 353 | fossil_panic("error while writing %s", markfile_out); |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | char line[100]; |
| 139 | FILE *f; |
| 140 | |
| 141 | f = fossil_fopen(markfile_in, "r"); |
| 142 | if( f==0 ){ |
| 143 | fossil_fatal("cannot open %s for reading", markfile_in); |
| 144 | } |
| 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| 147 | while( fgets(line, sizeof(line), f)!=0 ){ |
| 148 | if( *line == 'b' ){ |
| @@ -154,11 +154,11 @@ | |
| 154 | db_bind_text(&qc, ":rid", line + 1); |
| 155 | db_step(&qc); |
| 156 | db_reset(&qc); |
| 157 | bag_insert(&vers, atoi(line + 1)); |
| 158 | }else{ |
| 159 | fossil_fatal("bad input from %s: %s", markfile_in, line); |
| 160 | } |
| 161 | } |
| 162 | db_finalize(&qb); |
| 163 | db_finalize(&qc); |
| 164 | fclose(f); |
| @@ -335,11 +335,11 @@ | |
| 335 | |
| 336 | if( markfile_out!=0 ){ |
| 337 | FILE *f; |
| 338 | f = fossil_fopen(markfile_out, "w"); |
| 339 | if( f == 0 ){ |
| 340 | fossil_fatal("cannot open %s for writing", markfile_out); |
| 341 | } |
| 342 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 343 | while( db_step(&q)==SQLITE_ROW ){ |
| 344 | fprintf(f, "b%d\n", db_column_int(&q, 0)); |
| 345 | } |
| @@ -348,9 +348,9 @@ | |
| 348 | while( db_step(&q)==SQLITE_ROW ){ |
| 349 | fprintf(f, "c%d\n", db_column_int(&q, 0)); |
| 350 | } |
| 351 | db_finalize(&q); |
| 352 | if( ferror(f)!=0 || fclose(f)!=0 ) { |
| 353 | fossil_fatal("error while writing %s", markfile_out); |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 |
+1
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -64,11 +64,11 @@ | ||
| 64 | 64 | int vid; |
| 65 | 65 | |
| 66 | 66 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 67 | 67 | vid = db_lget_int("checkout", 0); |
| 68 | 68 | if( vid==0 ){ |
| 69 | - fossil_panic("no checkout to finfo files in"); | |
| 69 | + fossil_fatal("no checkout to finfo files in"); | |
| 70 | 70 | } |
| 71 | 71 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 72 | 72 | file_tree_name(g.argv[2], &fname, 1); |
| 73 | 73 | db_prepare(&q, |
| 74 | 74 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" |
| 75 | 75 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -64,11 +64,11 @@ | |
| 64 | int vid; |
| 65 | |
| 66 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 67 | vid = db_lget_int("checkout", 0); |
| 68 | if( vid==0 ){ |
| 69 | fossil_panic("no checkout to finfo files in"); |
| 70 | } |
| 71 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 72 | file_tree_name(g.argv[2], &fname, 1); |
| 73 | db_prepare(&q, |
| 74 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" |
| 75 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -64,11 +64,11 @@ | |
| 64 | int vid; |
| 65 | |
| 66 | if( g.argc!=3 ) usage("-s|--status FILENAME"); |
| 67 | vid = db_lget_int("checkout", 0); |
| 68 | if( vid==0 ){ |
| 69 | fossil_fatal("no checkout to finfo files in"); |
| 70 | } |
| 71 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 72 | file_tree_name(g.argv[2], &fname, 1); |
| 73 | db_prepare(&q, |
| 74 | "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" |
| 75 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -215,11 +215,11 @@ | ||
| 215 | 215 | db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/")); |
| 216 | 216 | }else{ |
| 217 | 217 | int rid; |
| 218 | 218 | rid = name_to_rid(g.argv[2]); |
| 219 | 219 | if( rid==0 ){ |
| 220 | - fossil_panic("no such object: %s\n", g.argv[2]); | |
| 220 | + fossil_fatal("no such object: %s\n", g.argv[2]); | |
| 221 | 221 | } |
| 222 | 222 | show_common_info(rid, "uuid:", 1, 1); |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/")); |
| 216 | }else{ |
| 217 | int rid; |
| 218 | rid = name_to_rid(g.argv[2]); |
| 219 | if( rid==0 ){ |
| 220 | fossil_panic("no such object: %s\n", g.argv[2]); |
| 221 | } |
| 222 | show_common_info(rid, "uuid:", 1, 1); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | db_int(-1, "SELECT count(*) FROM event WHERE type='ci' /*scan*/")); |
| 216 | }else{ |
| 217 | int rid; |
| 218 | rid = name_to_rid(g.argv[2]); |
| 219 | if( rid==0 ){ |
| 220 | fossil_fatal("no such object: %s\n", g.argv[2]); |
| 221 | } |
| 222 | show_common_info(rid, "uuid:", 1, 1); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 |
+2
-2
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -288,15 +288,15 @@ | ||
| 288 | 288 | md5sum_blob(&branch, &mcksum); |
| 289 | 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | 290 | |
| 291 | 291 | brid = content_put(&branch); |
| 292 | 292 | if( brid==0 ){ |
| 293 | - fossil_panic("Problem committing manifest: %s", g.zErrMsg); | |
| 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 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 297 | - fossil_panic("unable to install new manifest"); | |
| 297 | + fossil_fatal("unable to install new manifest"); | |
| 298 | 298 | } |
| 299 | 299 | assert( blob_is_reset(&branch) ); |
| 300 | 300 | content_deltify(rootid, brid, 0); |
| 301 | 301 | if( zNewRid ){ |
| 302 | 302 | *zNewRid = brid; |
| 303 | 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -288,15 +288,15 @@ | |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| 292 | if( brid==0 ){ |
| 293 | fossil_panic("Problem committing manifest: %s", g.zErrMsg); |
| 294 | } |
| 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 297 | fossil_panic("unable to install new manifest"); |
| 298 | } |
| 299 | assert( blob_is_reset(&branch) ); |
| 300 | content_deltify(rootid, brid, 0); |
| 301 | if( zNewRid ){ |
| 302 | *zNewRid = brid; |
| 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -288,15 +288,15 @@ | |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| 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 | if( manifest_crosslink(brid, &branch)==0 ){ |
| 297 | fossil_fatal("unable to install new manifest"); |
| 298 | } |
| 299 | assert( blob_is_reset(&branch) ); |
| 300 | content_deltify(rootid, brid, 0); |
| 301 | if( zNewRid ){ |
| 302 | *zNewRid = brid; |
| 303 |
+2
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -406,11 +406,11 @@ | ||
| 406 | 406 | zFileName = g.argv[i+1]; |
| 407 | 407 | zInFile = (0==strcmp("-",zFileName)) |
| 408 | 408 | ? stdin |
| 409 | 409 | : fossil_fopen(zFileName,"rb"); |
| 410 | 410 | if(!zInFile){ |
| 411 | - fossil_panic("Cannot open -args file [%s]", zFileName); | |
| 411 | + fossil_fatal("Cannot open -args file [%s]", zFileName); | |
| 412 | 412 | }else{ |
| 413 | 413 | blob_read_from_channel(&file, zInFile, -1); |
| 414 | 414 | if(stdin != zInFile){ |
| 415 | 415 | fclose(zInFile); |
| 416 | 416 | } |
| @@ -1114,11 +1114,11 @@ | ||
| 1114 | 1114 | fossil_fatal("unable to chroot into %s", zDir); |
| 1115 | 1115 | } |
| 1116 | 1116 | zRepo = "/"; |
| 1117 | 1117 | }else{ |
| 1118 | 1118 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1119 | - if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo); | |
| 1119 | + if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo); | |
| 1120 | 1120 | if( i>0 ){ |
| 1121 | 1121 | zDir[i] = 0; |
| 1122 | 1122 | if( file_chdir(zDir, 1) ){ |
| 1123 | 1123 | fossil_fatal("unable to chroot into %s", zDir); |
| 1124 | 1124 | } |
| 1125 | 1125 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zFileName = g.argv[i+1]; |
| 407 | zInFile = (0==strcmp("-",zFileName)) |
| 408 | ? stdin |
| 409 | : fossil_fopen(zFileName,"rb"); |
| 410 | if(!zInFile){ |
| 411 | fossil_panic("Cannot open -args file [%s]", zFileName); |
| 412 | }else{ |
| 413 | blob_read_from_channel(&file, zInFile, -1); |
| 414 | if(stdin != zInFile){ |
| 415 | fclose(zInFile); |
| 416 | } |
| @@ -1114,11 +1114,11 @@ | |
| 1114 | fossil_fatal("unable to chroot into %s", zDir); |
| 1115 | } |
| 1116 | zRepo = "/"; |
| 1117 | }else{ |
| 1118 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1119 | if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo); |
| 1120 | if( i>0 ){ |
| 1121 | zDir[i] = 0; |
| 1122 | if( file_chdir(zDir, 1) ){ |
| 1123 | fossil_fatal("unable to chroot into %s", zDir); |
| 1124 | } |
| 1125 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zFileName = g.argv[i+1]; |
| 407 | zInFile = (0==strcmp("-",zFileName)) |
| 408 | ? stdin |
| 409 | : fossil_fopen(zFileName,"rb"); |
| 410 | if(!zInFile){ |
| 411 | fossil_fatal("Cannot open -args file [%s]", zFileName); |
| 412 | }else{ |
| 413 | blob_read_from_channel(&file, zInFile, -1); |
| 414 | if(stdin != zInFile){ |
| 415 | fclose(zInFile); |
| 416 | } |
| @@ -1114,11 +1114,11 @@ | |
| 1114 | fossil_fatal("unable to chroot into %s", zDir); |
| 1115 | } |
| 1116 | zRepo = "/"; |
| 1117 | }else{ |
| 1118 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1119 | if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo); |
| 1120 | if( i>0 ){ |
| 1121 | zDir[i] = 0; |
| 1122 | if( file_chdir(zDir, 1) ){ |
| 1123 | fossil_fatal("unable to chroot into %s", zDir); |
| 1124 | } |
| 1125 |
+1
-1
| --- src/pivot.c | ||
| +++ src/pivot.c | ||
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | |
| 83 | 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | 84 | ** we abort early |
| 85 | 85 | */ |
| 86 | 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | - fossil_panic("lack both primary and secondary files"); | |
| 87 | + fossil_fatal("lack both primary and secondary files"); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /* Prepare queries we will be needing |
| 91 | 91 | ** |
| 92 | 92 | ** The first query finds the oldest pending version on the aqueue. This |
| 93 | 93 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | |
| 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | ** we abort early |
| 85 | */ |
| 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | fossil_panic("lack both primary and secondary files"); |
| 88 | } |
| 89 | |
| 90 | /* Prepare queries we will be needing |
| 91 | ** |
| 92 | ** The first query finds the oldest pending version on the aqueue. This |
| 93 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | |
| 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | ** we abort early |
| 85 | */ |
| 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | fossil_fatal("lack both primary and secondary files"); |
| 88 | } |
| 89 | |
| 90 | /* Prepare queries we will be needing |
| 91 | ** |
| 92 | ** The first query finds the oldest pending version on the aqueue. This |
| 93 |
+10
-5
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -919,17 +919,22 @@ | ||
| 919 | 919 | /* |
| 920 | 920 | ** Print an error message, rollback all databases, and quit. These |
| 921 | 921 | ** routines never return. |
| 922 | 922 | */ |
| 923 | 923 | NORETURN void fossil_panic(const char *zFormat, ...){ |
| 924 | - char *z; | |
| 925 | 924 | va_list ap; |
| 926 | 925 | int rc = 1; |
| 926 | + char z[1000]; | |
| 927 | 927 | static int once = 1; |
| 928 | + | |
| 929 | + if( g.db ){ | |
| 930 | + sqlite3_close_v2(g.db); | |
| 931 | + g.db = 0; | |
| 932 | + } | |
| 928 | 933 | mainInFatalError = 1; |
| 929 | 934 | va_start(ap, zFormat); |
| 930 | - z = vmprintf(zFormat, ap); | |
| 935 | + sqlite3_vsnprintf(sizeof(z),z,zFormat, ap); | |
| 931 | 936 | va_end(ap); |
| 932 | 937 | #ifdef FOSSIL_ENABLE_JSON |
| 933 | 938 | if( g.json.isJsonMode ){ |
| 934 | 939 | json_err( 0, z, 1 ); |
| 935 | 940 | if( g.isHTTP ){ |
| @@ -943,15 +948,15 @@ | ||
| 943 | 948 | once = 0; |
| 944 | 949 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 945 | 950 | cgi_reply(); |
| 946 | 951 | }else if( !g.fQuiet ){ |
| 947 | 952 | fossil_force_newline(); |
| 948 | - fossil_trace("Fossil internal error: %s\n", z); | |
| 953 | + fossil_puts("Fossil internal error: ", 1); | |
| 954 | + fossil_puts(z, 1); | |
| 955 | + fossil_puts("\n", 1); | |
| 949 | 956 | } |
| 950 | 957 | } |
| 951 | - free(z); | |
| 952 | - db_force_rollback(); | |
| 953 | 958 | fossil_exit(rc); |
| 954 | 959 | } |
| 955 | 960 | |
| 956 | 961 | NORETURN void fossil_fatal(const char *zFormat, ...){ |
| 957 | 962 | char *z; |
| 958 | 963 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -919,17 +919,22 @@ | |
| 919 | /* |
| 920 | ** Print an error message, rollback all databases, and quit. These |
| 921 | ** routines never return. |
| 922 | */ |
| 923 | NORETURN void fossil_panic(const char *zFormat, ...){ |
| 924 | char *z; |
| 925 | va_list ap; |
| 926 | int rc = 1; |
| 927 | static int once = 1; |
| 928 | mainInFatalError = 1; |
| 929 | va_start(ap, zFormat); |
| 930 | z = vmprintf(zFormat, ap); |
| 931 | va_end(ap); |
| 932 | #ifdef FOSSIL_ENABLE_JSON |
| 933 | if( g.json.isJsonMode ){ |
| 934 | json_err( 0, z, 1 ); |
| 935 | if( g.isHTTP ){ |
| @@ -943,15 +948,15 @@ | |
| 943 | once = 0; |
| 944 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 945 | cgi_reply(); |
| 946 | }else if( !g.fQuiet ){ |
| 947 | fossil_force_newline(); |
| 948 | fossil_trace("Fossil internal error: %s\n", z); |
| 949 | } |
| 950 | } |
| 951 | free(z); |
| 952 | db_force_rollback(); |
| 953 | fossil_exit(rc); |
| 954 | } |
| 955 | |
| 956 | NORETURN void fossil_fatal(const char *zFormat, ...){ |
| 957 | char *z; |
| 958 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -919,17 +919,22 @@ | |
| 919 | /* |
| 920 | ** Print an error message, rollback all databases, and quit. These |
| 921 | ** routines never return. |
| 922 | */ |
| 923 | NORETURN void fossil_panic(const char *zFormat, ...){ |
| 924 | va_list ap; |
| 925 | int rc = 1; |
| 926 | char z[1000]; |
| 927 | static int once = 1; |
| 928 | |
| 929 | if( g.db ){ |
| 930 | sqlite3_close_v2(g.db); |
| 931 | g.db = 0; |
| 932 | } |
| 933 | mainInFatalError = 1; |
| 934 | va_start(ap, zFormat); |
| 935 | sqlite3_vsnprintf(sizeof(z),z,zFormat, ap); |
| 936 | va_end(ap); |
| 937 | #ifdef FOSSIL_ENABLE_JSON |
| 938 | if( g.json.isJsonMode ){ |
| 939 | json_err( 0, z, 1 ); |
| 940 | if( g.isHTTP ){ |
| @@ -943,15 +948,15 @@ | |
| 948 | once = 0; |
| 949 | cgi_printf("<p class=\"generalError\">%h</p>", z); |
| 950 | cgi_reply(); |
| 951 | }else if( !g.fQuiet ){ |
| 952 | fossil_force_newline(); |
| 953 | fossil_puts("Fossil internal error: ", 1); |
| 954 | fossil_puts(z, 1); |
| 955 | fossil_puts("\n", 1); |
| 956 | } |
| 957 | } |
| 958 | fossil_exit(rc); |
| 959 | } |
| 960 | |
| 961 | NORETURN void fossil_fatal(const char *zFormat, ...){ |
| 962 | char *z; |
| 963 |
+2
-2
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -862,11 +862,11 @@ | ||
| 862 | 862 | recon_read_dir(zSubpath); |
| 863 | 863 | } |
| 864 | 864 | blob_init(&path, 0, 0); |
| 865 | 865 | blob_appendf(&path, "%s", zSubpath); |
| 866 | 866 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 867 | - fossil_panic("some unknown error occurred while reading \"%s\"", | |
| 867 | + fossil_fatal("some unknown error occurred while reading \"%s\"", | |
| 868 | 868 | blob_str(&path)); |
| 869 | 869 | } |
| 870 | 870 | content_put(&aContent); |
| 871 | 871 | blob_reset(&path); |
| 872 | 872 | blob_reset(&aContent); |
| @@ -874,11 +874,11 @@ | ||
| 874 | 874 | fossil_print("\r%d", ++nFileRead); |
| 875 | 875 | fflush(stdout); |
| 876 | 876 | } |
| 877 | 877 | closedir(d); |
| 878 | 878 | }else { |
| 879 | - fossil_panic("encountered error %d while trying to open \"%s\".", | |
| 879 | + fossil_fatal("encountered error %d while trying to open \"%s\".", | |
| 880 | 880 | errno, g.argv[3]); |
| 881 | 881 | } |
| 882 | 882 | fossil_filename_free(zUnicodePath); |
| 883 | 883 | } |
| 884 | 884 | |
| 885 | 885 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -862,11 +862,11 @@ | |
| 862 | recon_read_dir(zSubpath); |
| 863 | } |
| 864 | blob_init(&path, 0, 0); |
| 865 | blob_appendf(&path, "%s", zSubpath); |
| 866 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 867 | fossil_panic("some unknown error occurred while reading \"%s\"", |
| 868 | blob_str(&path)); |
| 869 | } |
| 870 | content_put(&aContent); |
| 871 | blob_reset(&path); |
| 872 | blob_reset(&aContent); |
| @@ -874,11 +874,11 @@ | |
| 874 | fossil_print("\r%d", ++nFileRead); |
| 875 | fflush(stdout); |
| 876 | } |
| 877 | closedir(d); |
| 878 | }else { |
| 879 | fossil_panic("encountered error %d while trying to open \"%s\".", |
| 880 | errno, g.argv[3]); |
| 881 | } |
| 882 | fossil_filename_free(zUnicodePath); |
| 883 | } |
| 884 | |
| 885 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -862,11 +862,11 @@ | |
| 862 | recon_read_dir(zSubpath); |
| 863 | } |
| 864 | blob_init(&path, 0, 0); |
| 865 | blob_appendf(&path, "%s", zSubpath); |
| 866 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 867 | fossil_fatal("some unknown error occurred while reading \"%s\"", |
| 868 | blob_str(&path)); |
| 869 | } |
| 870 | content_put(&aContent); |
| 871 | blob_reset(&path); |
| 872 | blob_reset(&aContent); |
| @@ -874,11 +874,11 @@ | |
| 874 | fossil_print("\r%d", ++nFileRead); |
| 875 | fflush(stdout); |
| 876 | } |
| 877 | closedir(d); |
| 878 | }else { |
| 879 | fossil_fatal("encountered error %d while trying to open \"%s\".", |
| 880 | errno, g.argv[3]); |
| 881 | } |
| 882 | fossil_filename_free(zUnicodePath); |
| 883 | } |
| 884 | |
| 885 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -520,11 +520,11 @@ | ||
| 520 | 520 | const char *zTktId, /* The ticket to which this change is applied */ |
| 521 | 521 | int needMod /* True if moderation is needed */ |
| 522 | 522 | ){ |
| 523 | 523 | int rid = content_put_ex(pTicket, 0, 0, 0, needMod); |
| 524 | 524 | if( rid==0 ){ |
| 525 | - fossil_panic("trouble committing ticket: %s", g.zErrMsg); | |
| 525 | + fossil_fatal("trouble committing ticket: %s", g.zErrMsg); | |
| 526 | 526 | } |
| 527 | 527 | if( needMod ){ |
| 528 | 528 | moderation_table_create(); |
| 529 | 529 | db_multi_exec( |
| 530 | 530 | "INSERT INTO modreq(objid, tktid) VALUES(%d,'%s')", |
| 531 | 531 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -520,11 +520,11 @@ | |
| 520 | const char *zTktId, /* The ticket to which this change is applied */ |
| 521 | int needMod /* True if moderation is needed */ |
| 522 | ){ |
| 523 | int rid = content_put_ex(pTicket, 0, 0, 0, needMod); |
| 524 | if( rid==0 ){ |
| 525 | fossil_panic("trouble committing ticket: %s", g.zErrMsg); |
| 526 | } |
| 527 | if( needMod ){ |
| 528 | moderation_table_create(); |
| 529 | db_multi_exec( |
| 530 | "INSERT INTO modreq(objid, tktid) VALUES(%d,'%s')", |
| 531 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -520,11 +520,11 @@ | |
| 520 | const char *zTktId, /* The ticket to which this change is applied */ |
| 521 | int needMod /* True if moderation is needed */ |
| 522 | ){ |
| 523 | int rid = content_put_ex(pTicket, 0, 0, 0, needMod); |
| 524 | if( rid==0 ){ |
| 525 | fossil_fatal("trouble committing ticket: %s", g.zErrMsg); |
| 526 | } |
| 527 | if( needMod ){ |
| 528 | moderation_table_create(); |
| 529 | db_multi_exec( |
| 530 | "INSERT INTO modreq(objid, tktid) VALUES(%d,'%s')", |
| 531 |
+2
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -199,11 +199,11 @@ | ||
| 199 | 199 | " ORDER BY event.mtime DESC"); |
| 200 | 200 | if( tid==0 ) tid = vid; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | if( tid==0 ){ |
| 204 | - fossil_panic("Internal Error: unable to find a version to update to."); | |
| 204 | + fossil_panic("unable to find a version to update to."); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | db_begin_transaction(); |
| 208 | 208 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 209 | 209 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| @@ -658,11 +658,11 @@ | ||
| 658 | 658 | } |
| 659 | 659 | }else if( errCode<=0 ){ |
| 660 | 660 | if( revision==0 ){ |
| 661 | 661 | revision = db_text("current", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 662 | 662 | } |
| 663 | - fossil_panic("could not parse manifest for checkin: %s", revision); | |
| 663 | + fossil_fatal("could not parse manifest for checkin: %s", revision); | |
| 664 | 664 | } |
| 665 | 665 | return errCode; |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | 668 | |
| 669 | 669 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -199,11 +199,11 @@ | |
| 199 | " ORDER BY event.mtime DESC"); |
| 200 | if( tid==0 ) tid = vid; |
| 201 | } |
| 202 | |
| 203 | if( tid==0 ){ |
| 204 | fossil_panic("Internal Error: unable to find a version to update to."); |
| 205 | } |
| 206 | |
| 207 | db_begin_transaction(); |
| 208 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 209 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| @@ -658,11 +658,11 @@ | |
| 658 | } |
| 659 | }else if( errCode<=0 ){ |
| 660 | if( revision==0 ){ |
| 661 | revision = db_text("current", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 662 | } |
| 663 | fossil_panic("could not parse manifest for checkin: %s", revision); |
| 664 | } |
| 665 | return errCode; |
| 666 | } |
| 667 | |
| 668 | |
| 669 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -199,11 +199,11 @@ | |
| 199 | " ORDER BY event.mtime DESC"); |
| 200 | if( tid==0 ) tid = vid; |
| 201 | } |
| 202 | |
| 203 | if( tid==0 ){ |
| 204 | fossil_panic("unable to find a version to update to."); |
| 205 | } |
| 206 | |
| 207 | db_begin_transaction(); |
| 208 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 209 | if( !dryRunFlag && !internalUpdate ) undo_begin(); |
| @@ -658,11 +658,11 @@ | |
| 658 | } |
| 659 | }else if( errCode<=0 ){ |
| 660 | if( revision==0 ){ |
| 661 | revision = db_text("current", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 662 | } |
| 663 | fossil_fatal("could not parse manifest for checkin: %s", revision); |
| 664 | } |
| 665 | return errCode; |
| 666 | } |
| 667 | |
| 668 | |
| 669 |
+1
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -277,11 +277,11 @@ | ||
| 277 | 277 | g.argv[4], uid |
| 278 | 278 | ); |
| 279 | 279 | } |
| 280 | 280 | fossil_print("%s\n", db_text(0, "SELECT cap FROM user WHERE uid=%d", uid)); |
| 281 | 281 | }else{ |
| 282 | - fossil_panic("user subcommand should be one of: " | |
| 282 | + fossil_fatal("user subcommand should be one of: " | |
| 283 | 283 | "capabilities default list new password"); |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /* |
| 288 | 288 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -277,11 +277,11 @@ | |
| 277 | g.argv[4], uid |
| 278 | ); |
| 279 | } |
| 280 | fossil_print("%s\n", db_text(0, "SELECT cap FROM user WHERE uid=%d", uid)); |
| 281 | }else{ |
| 282 | fossil_panic("user subcommand should be one of: " |
| 283 | "capabilities default list new password"); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /* |
| 288 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -277,11 +277,11 @@ | |
| 277 | g.argv[4], uid |
| 278 | ); |
| 279 | } |
| 280 | fossil_print("%s\n", db_text(0, "SELECT cap FROM user WHERE uid=%d", uid)); |
| 281 | }else{ |
| 282 | fossil_fatal("user subcommand should be one of: " |
| 283 | "capabilities default list new password"); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /* |
| 288 |
+1
-1
| --- src/verify.c | ||
| +++ src/verify.c | ||
| @@ -41,11 +41,11 @@ | ||
| 41 | 41 | return; /* No way to verify phantoms */ |
| 42 | 42 | } |
| 43 | 43 | blob_zero(&uuid); |
| 44 | 44 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 45 | 45 | if( blob_size(&uuid)!=UUID_SIZE ){ |
| 46 | - fossil_panic("not a valid rid: %d", rid); | |
| 46 | + fossil_fatal("not a valid rid: %d", rid); | |
| 47 | 47 | } |
| 48 | 48 | if( content_get(rid, &content) ){ |
| 49 | 49 | sha1sum_blob(&content, &hash); |
| 50 | 50 | blob_reset(&content); |
| 51 | 51 | if( blob_compare(&uuid, &hash) ){ |
| 52 | 52 |
| --- src/verify.c | |
| +++ src/verify.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | return; /* No way to verify phantoms */ |
| 42 | } |
| 43 | blob_zero(&uuid); |
| 44 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 45 | if( blob_size(&uuid)!=UUID_SIZE ){ |
| 46 | fossil_panic("not a valid rid: %d", rid); |
| 47 | } |
| 48 | if( content_get(rid, &content) ){ |
| 49 | sha1sum_blob(&content, &hash); |
| 50 | blob_reset(&content); |
| 51 | if( blob_compare(&uuid, &hash) ){ |
| 52 |
| --- src/verify.c | |
| +++ src/verify.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | return; /* No way to verify phantoms */ |
| 42 | } |
| 43 | blob_zero(&uuid); |
| 44 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 45 | if( blob_size(&uuid)!=UUID_SIZE ){ |
| 46 | fossil_fatal("not a valid rid: %d", rid); |
| 47 | } |
| 48 | if( content_get(rid, &content) ){ |
| 49 | sha1sum_blob(&content, &hash); |
| 50 | blob_reset(&content); |
| 51 | if( blob_compare(&uuid, &hash) ){ |
| 52 |
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -744,11 +744,11 @@ | ||
| 744 | 744 | blob_zero(pManOut); |
| 745 | 745 | } |
| 746 | 746 | db_must_be_within_tree(); |
| 747 | 747 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 748 | 748 | if( pManifest==0 ){ |
| 749 | - fossil_panic("manifest file (%d) is malformed", vid); | |
| 749 | + fossil_fatal("manifest file (%d) is malformed", vid); | |
| 750 | 750 | } |
| 751 | 751 | manifest_file_rewind(pManifest); |
| 752 | 752 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 753 | 753 | if( pFile->zUuid==0 ) continue; |
| 754 | 754 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 755 | 755 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -744,11 +744,11 @@ | |
| 744 | blob_zero(pManOut); |
| 745 | } |
| 746 | db_must_be_within_tree(); |
| 747 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 748 | if( pManifest==0 ){ |
| 749 | fossil_panic("manifest file (%d) is malformed", vid); |
| 750 | } |
| 751 | manifest_file_rewind(pManifest); |
| 752 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 753 | if( pFile->zUuid==0 ) continue; |
| 754 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 755 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -744,11 +744,11 @@ | |
| 744 | blob_zero(pManOut); |
| 745 | } |
| 746 | db_must_be_within_tree(); |
| 747 | pManifest = manifest_get(vid, CFTYPE_MANIFEST); |
| 748 | if( pManifest==0 ){ |
| 749 | fossil_fatal("manifest file (%d) is malformed", vid); |
| 750 | } |
| 751 | manifest_file_rewind(pManifest); |
| 752 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 753 | if( pFile->zUuid==0 ) continue; |
| 754 | fid = uuid_to_rid(pFile->zUuid, 0); |
| 755 |