Fossil SCM

Fix error messages associated with the "scrub" command.

drh 2012-08-21 11:05 trunk
Commit e25f55dd4d910f6b9a2175839e90cb2454184efc
2 files changed +5 -1 +4 -13
+5 -1
--- src/db.c
+++ src/db.c
@@ -999,11 +999,15 @@
999999
rep_not_found:
10001000
if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
10011001
#ifdef FOSSIL_ENABLE_JSON
10021002
g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
10031003
#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
+ }
10051009
}
10061010
}
10071011
10081012
/*
10091013
** Return the name of the database "localdb", "configdb", or "repository".
10101014
--- 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 @@
770770
void scrub_cmd(void){
771771
int bVerily = find_option("verily",0,0)!=0;
772772
int bForce = find_option("force", "f", 0)!=0;
773773
int privateOnly = find_option("private",0,0)!=0;
774774
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);
786776
if( !bForce ){
787777
Blob ans;
788778
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);
791782
if( blob_str(&ans)[0]!='y' ){
792783
fossil_exit(1);
793784
}
794785
}
795786
db_begin_transaction();
796787
--- 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

Keyboard Shortcuts

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