Fossil SCM
Change a fatal into a warning, allowing to continue file conversion for other files. Also clean-up internal blobs when this happens.
Commit
b763c3c3eb683282003e63b1951de9c197e6b29c
Parent
7023de95044817c…
1 file changed
+14
-13
+14
-13
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1302,23 +1302,24 @@ | ||
| 1302 | 1302 | FILE *f; |
| 1303 | 1303 | blob_write_to_file(p, zOrig); |
| 1304 | 1304 | fossil_free(zOrig); |
| 1305 | 1305 | f = fossil_fopen(zFilename, "wb"); |
| 1306 | 1306 | if( f==0 ){ |
| 1307 | - fossil_fatal("cannot open %s for writing", zFilename); | |
| 1308 | - } | |
| 1309 | - if( fUnicode ) { | |
| 1310 | - int bomSize; | |
| 1311 | - const unsigned char *bom = get_utf8_bom(&bomSize); | |
| 1312 | - fwrite(bom, 1, bomSize, f); | |
| 1313 | - blob_to_utf8_no_bom(p, 0); | |
| 1314 | - } | |
| 1315 | - if( fHasAnyCr ){ | |
| 1316 | - blob_to_lf_only(p); | |
| 1317 | - } | |
| 1318 | - fwrite(blob_buffer(p), 1, blob_size(p), f); | |
| 1319 | - fclose(f); | |
| 1307 | + fossil_warning("cannot open %s for writing", zFilename); | |
| 1308 | + }else{ | |
| 1309 | + if( fUnicode ) { | |
| 1310 | + int bomSize; | |
| 1311 | + const unsigned char *bom = get_utf8_bom(&bomSize); | |
| 1312 | + fwrite(bom, 1, bomSize, f); | |
| 1313 | + blob_to_utf8_no_bom(p, 0); | |
| 1314 | + } | |
| 1315 | + if( fHasAnyCr ){ | |
| 1316 | + blob_to_lf_only(p); | |
| 1317 | + } | |
| 1318 | + fwrite(blob_buffer(p), 1, blob_size(p), f); | |
| 1319 | + fclose(f); | |
| 1320 | + } | |
| 1320 | 1321 | return 1; |
| 1321 | 1322 | }else if( cReply!='y' && cReply!='Y' ){ |
| 1322 | 1323 | fossil_fatal("Abandoning commit due to %s in %s", |
| 1323 | 1324 | zWarning, blob_str(&fname)); |
| 1324 | 1325 | } |
| 1325 | 1326 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1302,23 +1302,24 @@ | |
| 1302 | FILE *f; |
| 1303 | blob_write_to_file(p, zOrig); |
| 1304 | fossil_free(zOrig); |
| 1305 | f = fossil_fopen(zFilename, "wb"); |
| 1306 | if( f==0 ){ |
| 1307 | fossil_fatal("cannot open %s for writing", zFilename); |
| 1308 | } |
| 1309 | if( fUnicode ) { |
| 1310 | int bomSize; |
| 1311 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 1312 | fwrite(bom, 1, bomSize, f); |
| 1313 | blob_to_utf8_no_bom(p, 0); |
| 1314 | } |
| 1315 | if( fHasAnyCr ){ |
| 1316 | blob_to_lf_only(p); |
| 1317 | } |
| 1318 | fwrite(blob_buffer(p), 1, blob_size(p), f); |
| 1319 | fclose(f); |
| 1320 | return 1; |
| 1321 | }else if( cReply!='y' && cReply!='Y' ){ |
| 1322 | fossil_fatal("Abandoning commit due to %s in %s", |
| 1323 | zWarning, blob_str(&fname)); |
| 1324 | } |
| 1325 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1302,23 +1302,24 @@ | |
| 1302 | FILE *f; |
| 1303 | blob_write_to_file(p, zOrig); |
| 1304 | fossil_free(zOrig); |
| 1305 | f = fossil_fopen(zFilename, "wb"); |
| 1306 | if( f==0 ){ |
| 1307 | fossil_warning("cannot open %s for writing", zFilename); |
| 1308 | }else{ |
| 1309 | if( fUnicode ) { |
| 1310 | int bomSize; |
| 1311 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 1312 | fwrite(bom, 1, bomSize, f); |
| 1313 | blob_to_utf8_no_bom(p, 0); |
| 1314 | } |
| 1315 | if( fHasAnyCr ){ |
| 1316 | blob_to_lf_only(p); |
| 1317 | } |
| 1318 | fwrite(blob_buffer(p), 1, blob_size(p), f); |
| 1319 | fclose(f); |
| 1320 | } |
| 1321 | return 1; |
| 1322 | }else if( cReply!='y' && cReply!='Y' ){ |
| 1323 | fossil_fatal("Abandoning commit due to %s in %s", |
| 1324 | zWarning, blob_str(&fname)); |
| 1325 | } |
| 1326 |