Overview
SHA1 Hash: | 4452576730808ff4669afba08536c3ef359c4b4e |
---|---|
Date: | 2007-08-11 01:16:31 |
User: | drh |
Comment: | Add the "close" command. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/checkout.c from [8d2964dd5e] to [ce6c20911d].
@@ -123,11 +123,11 @@ db_begin_transaction(); forceFlag = find_option("force","f",0)!=0; noWrite = find_option("dontwrite",0,0)!=0; if( g.argc!=3 ) usage("?--force? VERSION"); if( !forceFlag && unsaved_changes()==1 ){ - fossil_panic("there are unsaved changes in the current checkout"); + fossil_fatal("there are unsaved changes in the current checkout"); } if( forceFlag ){ db_multi_exec("DELETE FROM vfile"); prior = 0; }else{ @@ -154,6 +154,24 @@ } if( blob_compare(&cksum1, &cksum1b) ){ printf("WARNING: manifest checksum does not agree with manifest\n"); } db_end_transaction(0); +} + +/* +** COMMAND: close +** +** The opposite of "open". Close the current database connection. +** Require a -f or --force flag if there are unsaved changed in the +** current check-out. +*/ +void close_cmd(void){ + int forceFlag = find_option("force","f",0)!=0; + db_must_be_within_tree(); + if( !forceFlag && unsaved_changes()==1 ){ + fossil_fatal("there are unsaved changes in the current checkout"); + } + db_close(); + unlink(mprintf("%s_FOSSIL_", g.zLocalRoot)); + unlink(mprintf("%s_FOSSIL_-journal", g.zLocalRoot)); }