Differences From:
File
src/checkin.c
part of check-in
[a36177bcce]
- Add the "undo" and "redo" commands. Untested at this point so don't
try to use them yet.
by
drh on
2007-09-11 02:25:19.
Also file
src/checkin.c
part of check-in
[f76192b245]
- Pulled the latest CLI, website, and sqlite changes into the importer branch.
by
aku on
2007-09-17 01:00:32.
[view]
To:
File
src/checkin.c
part of check-in
[8372cc0b81]
- Socket operations now functional in Win32 port. Added quotes around the filename portion of the command to edit thus working of windows in paths where the temp directory contains spaces. Added -all flag to clean command. If not specified each file is prompted for before removing.
by
jnc on
2007-09-22 18:34:49.
Also file
src/checkin.c
part of check-in
[3c5482959c]
- Merge in the w32 changes.
by
drh on
2007-09-22 19:43:55.
[view]
@@ -163,16 +163,22 @@
}
/*
** COMMAND: clean
-** Usage: %fossil clean
+** Usage: %fossil clean ?-all
** Delete all "extra" files in the source tree. "Extra" files are
** files that are not officially part of the checkout. See also
-** the "extra" command.
+** the "extra" command. This operation cannot be undone.
+**
+** You will be prompted before removing each file. If you are
+** sure you wish to remove all "extra" files you can specify the
+** optional -all flag.
*/
void clean_cmd(void){
+ int allFlag;
Blob path;
Stmt q;
+ allFlag = find_option("all","a",0)!=0;
db_must_be_within_tree();
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
chdir(g.zLocalRoot);
blob_zero(&path);
@@ -181,9 +187,21 @@
"SELECT %Q || x FROM sfile"
" WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')"
" ORDER BY 1", g.zLocalRoot);
while( db_step(&q)==SQLITE_ROW ){
- unlink(db_column_text(&q, 0));
+ if( allFlag ){
+ unlink(db_column_text(&q, 0));
+ continue;
+ }
+
+ Blob ans;
+ char *prompt = mprintf("remove unmanaged file \"%s\" [y/N]? ",
+ db_column_text(&q, 0));
+ blob_zero(&ans);
+ prompt_user(prompt, &ans);
+ if( blob_str(&ans)[0]=='y' ){
+ unlink(db_column_text(&q, 0));
+ }
}
db_finalize(&q);
}
@@ -219,9 +237,9 @@
}
zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
g.zLocalRoot);
blob_write_to_file(&text, zFile);
- zCmd = mprintf("%s %s", zEditor, zFile);
+ zCmd = mprintf("%s \"%s\"", zEditor, zFile);
printf("%s\n", zCmd);
if( system(zCmd) ){
fossil_panic("editor aborted");
}