Diff
Not logged in

Differences From:

File src/checkin.c part of check-in [849b94c631] - Avoid the use of chdir() since this seems to cause problems on windows. by drh on 2008-07-17 01:49:16. [view]

To:

File src/checkin.c part of check-in [2ecc407d9b] - The "extra" and "clean" commands ignore the repository file if the repository happens to be within the check-out. Ticket c7b35be88. by drh on 2008-07-23 13:01:23. [view]

@@ -155,8 +155,9 @@
 ** the current checkout.  See also the "clean" command.
 */
 void extra_cmd(void){
   Blob path;
+  Blob repo;
   Stmt q;
   int n;
   db_must_be_within_tree();
   db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
@@ -166,8 +167,11 @@
   db_prepare(&q,
       "SELECT x FROM sfile"
       " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')"
       " ORDER BY 1");
+  if( file_tree_name(g.zRepositoryName, &repo, 0) ){
+    db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
+  }
   while( db_step(&q)==SQLITE_ROW ){
     printf("%s\n", db_column_text(&q, 0));
   }
   db_finalize(&q);
@@ -186,9 +190,9 @@
 ** optional -all flag.
 */
 void clean_cmd(void){
   int allFlag;
-  Blob path;
+  Blob path, repo;
   Stmt q;
   int n;
   allFlag = find_option("all","a",0)!=0;
   db_must_be_within_tree();
@@ -199,8 +203,11 @@
   db_prepare(&q,
       "SELECT %Q || x FROM sfile"
       " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_')"
       " ORDER BY 1", g.zLocalRoot);
+  if( file_tree_name(g.zRepositoryName, &repo, 0) ){
+    db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
+  }
   while( db_step(&q)==SQLITE_ROW ){
     if( allFlag ){
       unlink(db_column_text(&q, 0));
     }else{
@@ -304,9 +311,9 @@
     g.aCommitFile = malloc(sizeof(int)*(g.argc-1));
 
     for(ii=2; ii<g.argc; ii++){
       int iId;
-      file_tree_name(g.argv[ii], &b);
+      file_tree_name(g.argv[ii], &b, 1);
       iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b));
       if( iId<0 ){
         fossil_fatal("fossil knows nothing about: %s", g.argv[ii]);
       }