Check-in [aafd536a5c]
Not logged in
Overview

SHA1 Hash:aafd536a5cced0647c402e7c820e8aaa3c232ac2
Date: 2007-08-04 00:26:40
User: drh
Comment:Prohibit partial check-ins of a merge. To allow such a thing would confuse the branch tracking logic. There are still problems in the partial check-in logic for cases were new files have been added to the repository.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/checkin.c from [43e2abb7c2] to [f79a5fbc49].

@@ -230,11 +230,11 @@
 */
 void select_commit_files(void){
   if( g.argc>2 ){
     int ii;
     Blob b;
-    memset(&b, 0, sizeof(Blob));
+    blob_zero(&b);
     g.aCommitFile = malloc(sizeof(int)*(g.argc-1));
 
     for(ii=2; ii<g.argc; ii++){
       int iId;
       if( !file_tree_name(g.argv[ii], &b) ){
@@ -243,10 +243,11 @@
       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]);
       }
       g.aCommitFile[ii-2] = iId;
+      blob_reset(&b);
     }
     g.aCommitFile[ii-2] = 0;
   }
 }
 
@@ -288,10 +289,13 @@
   ** array is allocated to contain the "id" field from the vfile table
   ** for each file to be committed. Or, if aCommitFile is NULL, all files
   ** should be committed.
   */
   select_commit_files();
+  if( g.aCommitFile && db_exists("SELECT 1 FROM vmerge") ){
+    fossil_fatal("cannot do a partial commit of a merge");
+  }
 
   user_select();
   db_begin_transaction();
   rc = unsaved_changes();
   if( rc==0 ){