Fossil SCM
Roll back dangling database transaction for some terminal code paths in 'fossil commit'.
Commit
190d138a13741f6c2f44982fd9dd55d545bbf91d8923b3ab99ab14555605d15d
Parent
bfd1a682f3072be…
1 file changed
+4
-4
+4
-4
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2498,11 +2498,11 @@ | ||
| 2498 | 2498 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2499 | 2499 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2500 | 2500 | cReply = blob_str(&ans)[0]; |
| 2501 | 2501 | blob_reset(&ans); |
| 2502 | 2502 | if( cReply!='y' && cReply!='Y' ){ |
| 2503 | - fossil_exit(1); | |
| 2503 | + fossil_fatal("Commit aborted."); | |
| 2504 | 2504 | } |
| 2505 | 2505 | } |
| 2506 | 2506 | free(zInit); |
| 2507 | 2507 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2508 | 2508 | db_end_transaction(0); |
| @@ -2511,11 +2511,11 @@ | ||
| 2511 | 2511 | /* Do another auto-pull, renewing the check-in lock. Then set |
| 2512 | 2512 | ** bRecheck so that we loop back above to verify that the check-in |
| 2513 | 2513 | ** is still not against a closed branch and still won't fork. */ |
| 2514 | 2514 | int syncFlags = SYNC_PULL|SYNC_CKIN_LOCK; |
| 2515 | 2515 | if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){ |
| 2516 | - fossil_exit(1); | |
| 2516 | + fossil_fatal("Auto-pull failed. Commit aborted."); | |
| 2517 | 2517 | } |
| 2518 | 2518 | bRecheck = 1; |
| 2519 | 2519 | } |
| 2520 | 2520 | } |
| 2521 | 2521 | }while( bRecheck ); |
| @@ -2529,11 +2529,11 @@ | ||
| 2529 | 2529 | }else{ |
| 2530 | 2530 | fossil_print("Abandoning commit due to empty check-in comment\n"); |
| 2531 | 2531 | cReply = 'N'; |
| 2532 | 2532 | } |
| 2533 | 2533 | if( cReply!='y' && cReply!='Y' ){ |
| 2534 | - fossil_exit(1); | |
| 2534 | + fossil_fatal("Commit aborted."); | |
| 2535 | 2535 | } |
| 2536 | 2536 | } |
| 2537 | 2537 | } |
| 2538 | 2538 | |
| 2539 | 2539 | if( !noVerify && hook_exists("before-commit") ){ |
| @@ -2682,11 +2682,11 @@ | ||
| 2682 | 2682 | }else{ |
| 2683 | 2683 | fossil_print("Abandoning commit due to manifest signing failure\n"); |
| 2684 | 2684 | cReply = 'N'; |
| 2685 | 2685 | } |
| 2686 | 2686 | if( cReply!='y' && cReply!='Y' ){ |
| 2687 | - fossil_exit(1); | |
| 2687 | + fossil_fatal("Commit aborted."); | |
| 2688 | 2688 | } |
| 2689 | 2689 | } |
| 2690 | 2690 | |
| 2691 | 2691 | /* If the -n|--dry-run option is specified, output the manifest file |
| 2692 | 2692 | ** and rollback the transaction. |
| 2693 | 2693 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2498,11 +2498,11 @@ | |
| 2498 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2499 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2500 | cReply = blob_str(&ans)[0]; |
| 2501 | blob_reset(&ans); |
| 2502 | if( cReply!='y' && cReply!='Y' ){ |
| 2503 | fossil_exit(1); |
| 2504 | } |
| 2505 | } |
| 2506 | free(zInit); |
| 2507 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2508 | db_end_transaction(0); |
| @@ -2511,11 +2511,11 @@ | |
| 2511 | /* Do another auto-pull, renewing the check-in lock. Then set |
| 2512 | ** bRecheck so that we loop back above to verify that the check-in |
| 2513 | ** is still not against a closed branch and still won't fork. */ |
| 2514 | int syncFlags = SYNC_PULL|SYNC_CKIN_LOCK; |
| 2515 | if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){ |
| 2516 | fossil_exit(1); |
| 2517 | } |
| 2518 | bRecheck = 1; |
| 2519 | } |
| 2520 | } |
| 2521 | }while( bRecheck ); |
| @@ -2529,11 +2529,11 @@ | |
| 2529 | }else{ |
| 2530 | fossil_print("Abandoning commit due to empty check-in comment\n"); |
| 2531 | cReply = 'N'; |
| 2532 | } |
| 2533 | if( cReply!='y' && cReply!='Y' ){ |
| 2534 | fossil_exit(1); |
| 2535 | } |
| 2536 | } |
| 2537 | } |
| 2538 | |
| 2539 | if( !noVerify && hook_exists("before-commit") ){ |
| @@ -2682,11 +2682,11 @@ | |
| 2682 | }else{ |
| 2683 | fossil_print("Abandoning commit due to manifest signing failure\n"); |
| 2684 | cReply = 'N'; |
| 2685 | } |
| 2686 | if( cReply!='y' && cReply!='Y' ){ |
| 2687 | fossil_exit(1); |
| 2688 | } |
| 2689 | } |
| 2690 | |
| 2691 | /* If the -n|--dry-run option is specified, output the manifest file |
| 2692 | ** and rollback the transaction. |
| 2693 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2498,11 +2498,11 @@ | |
| 2498 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2499 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2500 | cReply = blob_str(&ans)[0]; |
| 2501 | blob_reset(&ans); |
| 2502 | if( cReply!='y' && cReply!='Y' ){ |
| 2503 | fossil_fatal("Commit aborted."); |
| 2504 | } |
| 2505 | } |
| 2506 | free(zInit); |
| 2507 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2508 | db_end_transaction(0); |
| @@ -2511,11 +2511,11 @@ | |
| 2511 | /* Do another auto-pull, renewing the check-in lock. Then set |
| 2512 | ** bRecheck so that we loop back above to verify that the check-in |
| 2513 | ** is still not against a closed branch and still won't fork. */ |
| 2514 | int syncFlags = SYNC_PULL|SYNC_CKIN_LOCK; |
| 2515 | if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){ |
| 2516 | fossil_fatal("Auto-pull failed. Commit aborted."); |
| 2517 | } |
| 2518 | bRecheck = 1; |
| 2519 | } |
| 2520 | } |
| 2521 | }while( bRecheck ); |
| @@ -2529,11 +2529,11 @@ | |
| 2529 | }else{ |
| 2530 | fossil_print("Abandoning commit due to empty check-in comment\n"); |
| 2531 | cReply = 'N'; |
| 2532 | } |
| 2533 | if( cReply!='y' && cReply!='Y' ){ |
| 2534 | fossil_fatal("Commit aborted."); |
| 2535 | } |
| 2536 | } |
| 2537 | } |
| 2538 | |
| 2539 | if( !noVerify && hook_exists("before-commit") ){ |
| @@ -2682,11 +2682,11 @@ | |
| 2682 | }else{ |
| 2683 | fossil_print("Abandoning commit due to manifest signing failure\n"); |
| 2684 | cReply = 'N'; |
| 2685 | } |
| 2686 | if( cReply!='y' && cReply!='Y' ){ |
| 2687 | fossil_fatal("Commit aborted."); |
| 2688 | } |
| 2689 | } |
| 2690 | |
| 2691 | /* If the -n|--dry-run option is specified, output the manifest file |
| 2692 | ** and rollback the transaction. |
| 2693 |