Fossil SCM

Roll back dangling database transaction for some terminal code paths in 'fossil commit'.

danield 2021-02-04 10:50 trunk
Commit 190d138a13741f6c2f44982fd9dd55d545bbf91d8923b3ab99ab14555605d15d
1 file changed +4 -4
+4 -4
--- src/checkin.c
+++ src/checkin.c
@@ -2498,11 +2498,11 @@
24982498
if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
24992499
prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
25002500
cReply = blob_str(&ans)[0];
25012501
blob_reset(&ans);
25022502
if( cReply!='y' && cReply!='Y' ){
2503
- fossil_exit(1);
2503
+ fossil_fatal("Commit aborted.");
25042504
}
25052505
}
25062506
free(zInit);
25072507
db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
25082508
db_end_transaction(0);
@@ -2511,11 +2511,11 @@
25112511
/* Do another auto-pull, renewing the check-in lock. Then set
25122512
** bRecheck so that we loop back above to verify that the check-in
25132513
** is still not against a closed branch and still won't fork. */
25142514
int syncFlags = SYNC_PULL|SYNC_CKIN_LOCK;
25152515
if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){
2516
- fossil_exit(1);
2516
+ fossil_fatal("Auto-pull failed. Commit aborted.");
25172517
}
25182518
bRecheck = 1;
25192519
}
25202520
}
25212521
}while( bRecheck );
@@ -2529,11 +2529,11 @@
25292529
}else{
25302530
fossil_print("Abandoning commit due to empty check-in comment\n");
25312531
cReply = 'N';
25322532
}
25332533
if( cReply!='y' && cReply!='Y' ){
2534
- fossil_exit(1);
2534
+ fossil_fatal("Commit aborted.");
25352535
}
25362536
}
25372537
}
25382538
25392539
if( !noVerify && hook_exists("before-commit") ){
@@ -2682,11 +2682,11 @@
26822682
}else{
26832683
fossil_print("Abandoning commit due to manifest signing failure\n");
26842684
cReply = 'N';
26852685
}
26862686
if( cReply!='y' && cReply!='Y' ){
2687
- fossil_exit(1);
2687
+ fossil_fatal("Commit aborted.");
26882688
}
26892689
}
26902690
26912691
/* If the -n|--dry-run option is specified, output the manifest file
26922692
** and rollback the transaction.
26932693
--- 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

Keyboard Shortcuts

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