Index: src/checkin.c ================================================================== --- src/checkin.c +++ src/checkin.c @@ -393,28 +393,29 @@ ** files that are ignored. The GLOBPATTERN specified by the "ignore-glob" ** is used if the --ignore option is omitted. ** ** Options: ** --dotfiles include files beginning with a dot (".") -** --force Remove files without prompting +** --no-warnings Remove files without prompting ** --ignore <CSG> ignore files matching patterns from the ** comma separated list of glob patterns. ** --temp Remove only Fossil-generated temporary files ** ** See also: addremove, extra, status */ void clean_cmd(void){ - int allFlag; + int allFlag, bForce; unsigned scanFlags = 0; const char *zIgnoreFlag; Blob path, repo; Stmt q; int n; Glob *pIgnore; int testFlag = 0; - allFlag = find_option("force","f",0)!=0; + bForce = find_option("force","f",0)!=0; + allFlag = find_option("no-warnings", 0, 0)!=0 || bForce; if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; zIgnoreFlag = find_option("ignore",0,1); testFlag = find_option("test",0,0)!=0; db_must_be_within_tree(); @@ -1002,16 +1003,16 @@ ** --bgcolor COLOR apply COLOR to this one check-in only ** --branch NEW-BRANCH-NAME check in to this new branch ** --branchcolor COLOR apply given COLOR to the branch ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment ** --delta use a delta manifest in the commit process -** --force|-f allow forking with this commit +** --force|-f allow forking/unresolved merge conflicts with this commit ** --message-file|-M FILE read the commit comment from given file ** --nosign do not attempt to sign this commit with gpg +** --no-warnings do not warn about anything ** --private do not sync changes and their descendants ** --tag TAG-NAME assign given tag TAG-NAME to the checkin -** --conflict allow unresolved merge conflicts ** --binary-ok do not warn about committing binary files ** ** See also: branch, changes, checkout, extra, sync */ void commit_cmd(void){ @@ -1024,14 +1025,13 @@ Stmt q; /* Query to find files that have been modified */ char *zUuid; /* UUID of the new check-in */ int noSign = 0; /* True to omit signing the manifest using GPG */ int isAMerge = 0; /* True if checking in a merge */ int noWarningFlag = 0; /* True if skipping all warnings */ - int forceFlag = 0; /* Force a fork */ + int forceFlag = 0; /* Force a fork/commit with unresolved merge conflicts */ int forceDelta = 0; /* Force a delta-manifest */ int forceBaseline = 0; /* Force a baseline-manifest */ - int allowConflict = 0; /* Allow unresolve merge conflicts */ int binaryOk = 0; /* The --binary-ok flag */ char *zManifestFile; /* Name of the manifest file */ int useCksum; /* True if checksums should be computed and verified */ int outputManifest; /* True to output "manifest" and "manifest.uuid" */ int testRun; /* True for a test run. Debugging only */ @@ -1062,11 +1062,11 @@ fossil_fatal("cannot use --delta and --baseline together"); } testRun = find_option("test",0,0)!=0; zComment = find_option("comment","m",1); forceFlag = find_option("force", "f", 0)!=0; - noWarningFlag = find_option("no-warnings", 0, 0)!=0; + noWarningFlag = find_option("no-warnings", 0, 0)!=0 || forceFlag; zBranch = find_option("branch","b",1); zColor = find_option("bgcolor",0,1); zBrClr = find_option("branchcolor",0,1); binaryOk = find_option("binary-ok",0,0)!=0; while( (zTag = find_option("tag",0,1))!=0 ){ @@ -1081,11 +1081,10 @@ if( zBranch==0 ) zBranch = "private"; if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */ } zDateOvrd = find_option("date-override",0,1); zUserOvrd = find_option("user-override",0,1); - allowConflict = find_option("conflict",0,0)!=0; db_must_be_within_tree(); noSign = db_get_boolean("omitsign", 0)|noSign; if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; } useCksum = db_get_boolean("repo-cksum", 1); outputManifest = db_get_boolean("manifest", 0); @@ -1189,11 +1188,11 @@ hasChanges = unsaved_changes(); db_begin_transaction(); db_record_repository_filename(0); if( hasChanges==0 && !isAMerge && !forceFlag ){ - fossil_fatal("nothing has changed"); + fossil_fatal("nothing has changed; use -f or --force."); } /* If none of the files that were named on the command line have ** been modified, bail out now unless the --force flag is used. */ @@ -1310,12 +1309,13 @@ } db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id); db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid); } db_finalize(&q); - if( nConflict && !allowConflict ){ - fossil_fatal("abort due to unresolve merge conflicts"); + if( nConflict && !forceFlag ){ + fossil_fatal("abort due to unresolved merge conflicts; use -f" + " or --force."); } /* Create the new manifest */ if( blob_size(&comment)==0 ){ blob_append(&comment, "(no comment)", -1); Index: src/rebuild.c ================================================================== --- src/rebuild.c +++ src/rebuild.c @@ -582,11 +582,11 @@ "REPLACE INTO config(name,value,mtime) VALUES('aux-schema','%s',now());", CONTENT_SCHEMA, AUX_SCHEMA ); if( errCnt && !forceFlag ){ fossil_print( - "%d errors. Rolling back changes. Use --force to force a commit.\n", + "%d errors. Rolling back changes. Use -f or --force to force a commit.\n", errCnt ); db_end_transaction(1); }else{ if( runCompress ){ @@ -767,21 +767,22 @@ ** ** The user is prompted to confirm the scrub unless the --force option ** is used. ** ** Options: -** --force do not prompt for confirmation -** --private only private branches are removed from the repository -** --verily scrub real thoroughly (see above) +** --no-warnings do not prompt for confirmation +** --private only private branches are removed from the repository +** --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 bNoWarning = find_option("no-warnings", 0, 0)!=0 || bForce; int privateOnly = find_option("private",0,0)!=0; int bNeedRebuild = 0; db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); - if( !bForce ){ + if( !bNoWarning ){ Blob ans; char cReply; blob_zero(&ans); prompt_user( "Scrubbing the repository will permanently delete information.\n"