Fossil

Check-in [e25f55dd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix error messages associated with the "scrub" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e25f55dd4d910f6b9a2175839e90cb2454184efc
User & Date: drh 2012-08-21 11:05:27
Context
2012-08-21
14:15
Merge the mingw-w64 compiler warning fixes into trunk. check-in: d89b99e3 user: drh tags: trunk
13:29
Tcl only uses argv0, so it's enough to transfer this argument only Closed-Leaf check-in: b82eacd5 user: jan.nijtmans tags: tcl-argv0-only
13:26
Those two files tell eclipse that it can be checked out as a project, and that the LF eol-convention should be used. check-in: 6c945311 user: jan.nijtmans tags: eclipse-project
11:05
Fix error messages associated with the "scrub" command. check-in: e25f55dd user: drh tags: trunk
2012-08-20
19:01
Expand the "diffFlags" variable to 64-bits in order to accommodate new options to the various "diff" commands. check-in: 2b176750 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/db.c.

997
998
999
1000
1001
1002
1003

1004



1005
1006
1007
1008
1009
1010
1011
    return;
  }
rep_not_found:
  if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
#ifdef FOSSIL_ENABLE_JSON
    g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
#endif

    fossil_fatal("use --repository or -R to specify the repository database");



  }
}

/*
** Return the name of the database "localdb", "configdb", or "repository".
*/
const char *db_name(const char *zDb){







>
|
>
>
>







997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
    return;
  }
rep_not_found:
  if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){
#ifdef FOSSIL_ENABLE_JSON
    g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
#endif
    if( nArgUsed==0 ){
      fossil_fatal("use --repository or -R to specify the repository database");
    }else{
      fossil_fatal("specify the repository name as a command-line argument");
    }
  }
}

/*
** Return the name of the database "localdb", "configdb", or "repository".
*/
const char *db_name(const char *zDb){

Changes to src/rebuild.c.

768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788

789
790
791
792
793
794
795
796
797
**   --verily    scrub real thoroughly (see above)
*/
void scrub_cmd(void){
  int bVerily = find_option("verily",0,0)!=0;
  int bForce = find_option("force", "f", 0)!=0;
  int privateOnly = find_option("private",0,0)!=0;
  int bNeedRebuild = 0;
  if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
  if( g.argc==2 ){
    db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
    if( g.argc!=2 ){
      usage("?REPOSITORY-FILENAME?");
    }
    db_close(1);
    db_open_repository(g.zRepositoryName);
  }else{
    db_open_repository(g.argv[2]);
  }
  if( !bForce ){
    Blob ans;
    blob_zero(&ans);

    prompt_user("Scrubbing the repository will permanently information.\n"
                "Changes cannot be undone.  Continue (y/N)? ", &ans);
    if( blob_str(&ans)[0]!='y' ){
      fossil_exit(1);
    }
  }
  db_begin_transaction();
  if( privateOnly || bVerily ){
    bNeedRebuild = db_exists("SELECT 1 FROM private");







<
<
|
<
<
<
<
<
<
<
<



>
|
|







768
769
770
771
772
773
774


775








776
777
778
779
780
781
782
783
784
785
786
787
788
**   --verily    scrub real thoroughly (see above)
*/
void scrub_cmd(void){
  int bVerily = find_option("verily",0,0)!=0;
  int bForce = find_option("force", "f", 0)!=0;
  int privateOnly = find_option("private",0,0)!=0;
  int bNeedRebuild = 0;


  db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);








  if( !bForce ){
    Blob ans;
    blob_zero(&ans);
    prompt_user(
         "Scrubbing the repository will permanently delete information.\n"
         "Changes cannot be undone.  Continue (y/N)? ", &ans);
    if( blob_str(&ans)[0]!='y' ){
      fossil_exit(1);
    }
  }
  db_begin_transaction();
  if( privateOnly || bVerily ){
    bNeedRebuild = db_exists("SELECT 1 FROM private");