Fossil SCM
The "fossil open" and "fossil co" commands always prompt before overwriting unless the --force option appears. Ticket [b519c1a375c106].
Commit
824083c36a1052b1cd59e3d456eed452a3bda6e2
Parent
8ae917362c692d8…
1 file changed
+1
-1
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -200,11 +200,11 @@ | ||
| 200 | 200 | db_must_be_within_tree(); |
| 201 | 201 | db_begin_transaction(); |
| 202 | 202 | forceFlag = find_option("force","f",0)!=0; |
| 203 | 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | - promptFlag = find_option("prompt",0,0)!=0; /* Prompt user before overwrite */ | |
| 205 | + promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; | |
| 206 | 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 208 | 208 | } |
| 209 | 209 | if( !forceFlag && unsaved_changes()==1 ){ |
| 210 | 210 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 211 | 211 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | db_must_be_within_tree(); |
| 201 | db_begin_transaction(); |
| 202 | forceFlag = find_option("force","f",0)!=0; |
| 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | promptFlag = find_option("prompt",0,0)!=0; /* Prompt user before overwrite */ |
| 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 208 | } |
| 209 | if( !forceFlag && unsaved_changes()==1 ){ |
| 210 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 211 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | db_must_be_within_tree(); |
| 201 | db_begin_transaction(); |
| 202 | forceFlag = find_option("force","f",0)!=0; |
| 203 | keepFlag = find_option("keep",0,0)!=0; |
| 204 | latestFlag = find_option("latest",0,0)!=0; |
| 205 | promptFlag = find_option("prompt",0,0)!=0 || forceFlag==0; |
| 206 | if( (latestFlag!=0 && g.argc!=2) || (latestFlag==0 && g.argc!=3) ){ |
| 207 | usage("VERSION|--latest ?--force? ?--keep?"); |
| 208 | } |
| 209 | if( !forceFlag && unsaved_changes()==1 ){ |
| 210 | fossil_fatal("there are unsaved changes in the current checkout"); |
| 211 |