Fossil SCM
Fix error messages associated with the "scrub" command.
Commit
e25f55dd4d910f6b9a2175839e90cb2454184efc
Parent
2b1767500e3cd9d…
2 files changed
+5
-1
+4
-13
M
src/db.c
+5
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -999,11 +999,15 @@ | ||
| 999 | 999 | rep_not_found: |
| 1000 | 1000 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1001 | 1001 | #ifdef FOSSIL_ENABLE_JSON |
| 1002 | 1002 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1003 | 1003 | #endif |
| 1004 | - fossil_fatal("use --repository or -R to specify the repository database"); | |
| 1004 | + if( nArgUsed==0 ){ | |
| 1005 | + fossil_fatal("use --repository or -R to specify the repository database"); | |
| 1006 | + }else{ | |
| 1007 | + fossil_fatal("specify the repository name as a command-line argument"); | |
| 1008 | + } | |
| 1005 | 1009 | } |
| 1006 | 1010 | } |
| 1007 | 1011 | |
| 1008 | 1012 | /* |
| 1009 | 1013 | ** Return the name of the database "localdb", "configdb", or "repository". |
| 1010 | 1014 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -999,11 +999,15 @@ | |
| 999 | rep_not_found: |
| 1000 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1001 | #ifdef FOSSIL_ENABLE_JSON |
| 1002 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1003 | #endif |
| 1004 | fossil_fatal("use --repository or -R to specify the repository database"); |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | /* |
| 1009 | ** Return the name of the database "localdb", "configdb", or "repository". |
| 1010 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -999,11 +999,15 @@ | |
| 999 | rep_not_found: |
| 1000 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1001 | #ifdef FOSSIL_ENABLE_JSON |
| 1002 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1003 | #endif |
| 1004 | if( nArgUsed==0 ){ |
| 1005 | fossil_fatal("use --repository or -R to specify the repository database"); |
| 1006 | }else{ |
| 1007 | fossil_fatal("specify the repository name as a command-line argument"); |
| 1008 | } |
| 1009 | } |
| 1010 | } |
| 1011 | |
| 1012 | /* |
| 1013 | ** Return the name of the database "localdb", "configdb", or "repository". |
| 1014 |
+4
-13
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -770,26 +770,17 @@ | ||
| 770 | 770 | void scrub_cmd(void){ |
| 771 | 771 | int bVerily = find_option("verily",0,0)!=0; |
| 772 | 772 | int bForce = find_option("force", "f", 0)!=0; |
| 773 | 773 | int privateOnly = find_option("private",0,0)!=0; |
| 774 | 774 | int bNeedRebuild = 0; |
| 775 | - if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); | |
| 776 | - if( g.argc==2 ){ | |
| 777 | - db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); | |
| 778 | - if( g.argc!=2 ){ | |
| 779 | - usage("?REPOSITORY-FILENAME?"); | |
| 780 | - } | |
| 781 | - db_close(1); | |
| 782 | - db_open_repository(g.zRepositoryName); | |
| 783 | - }else{ | |
| 784 | - db_open_repository(g.argv[2]); | |
| 785 | - } | |
| 775 | + db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); | |
| 786 | 776 | if( !bForce ){ |
| 787 | 777 | Blob ans; |
| 788 | 778 | blob_zero(&ans); |
| 789 | - prompt_user("Scrubbing the repository will permanently information.\n" | |
| 790 | - "Changes cannot be undone. Continue (y/N)? ", &ans); | |
| 779 | + prompt_user( | |
| 780 | + "Scrubbing the repository will permanently delete information.\n" | |
| 781 | + "Changes cannot be undone. Continue (y/N)? ", &ans); | |
| 791 | 782 | if( blob_str(&ans)[0]!='y' ){ |
| 792 | 783 | fossil_exit(1); |
| 793 | 784 | } |
| 794 | 785 | } |
| 795 | 786 | db_begin_transaction(); |
| 796 | 787 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -770,26 +770,17 @@ | |
| 770 | void scrub_cmd(void){ |
| 771 | int bVerily = find_option("verily",0,0)!=0; |
| 772 | int bForce = find_option("force", "f", 0)!=0; |
| 773 | int privateOnly = find_option("private",0,0)!=0; |
| 774 | int bNeedRebuild = 0; |
| 775 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 776 | if( g.argc==2 ){ |
| 777 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 778 | if( g.argc!=2 ){ |
| 779 | usage("?REPOSITORY-FILENAME?"); |
| 780 | } |
| 781 | db_close(1); |
| 782 | db_open_repository(g.zRepositoryName); |
| 783 | }else{ |
| 784 | db_open_repository(g.argv[2]); |
| 785 | } |
| 786 | if( !bForce ){ |
| 787 | Blob ans; |
| 788 | blob_zero(&ans); |
| 789 | prompt_user("Scrubbing the repository will permanently information.\n" |
| 790 | "Changes cannot be undone. Continue (y/N)? ", &ans); |
| 791 | if( blob_str(&ans)[0]!='y' ){ |
| 792 | fossil_exit(1); |
| 793 | } |
| 794 | } |
| 795 | db_begin_transaction(); |
| 796 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -770,26 +770,17 @@ | |
| 770 | void scrub_cmd(void){ |
| 771 | int bVerily = find_option("verily",0,0)!=0; |
| 772 | int bForce = find_option("force", "f", 0)!=0; |
| 773 | int privateOnly = find_option("private",0,0)!=0; |
| 774 | int bNeedRebuild = 0; |
| 775 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); |
| 776 | if( !bForce ){ |
| 777 | Blob ans; |
| 778 | blob_zero(&ans); |
| 779 | prompt_user( |
| 780 | "Scrubbing the repository will permanently delete information.\n" |
| 781 | "Changes cannot be undone. Continue (y/N)? ", &ans); |
| 782 | if( blob_str(&ans)[0]!='y' ){ |
| 783 | fossil_exit(1); |
| 784 | } |
| 785 | } |
| 786 | db_begin_transaction(); |
| 787 |