Diff
Not logged in

Differences From:

File src/update.c part of check-in [6607844a01] - Added options to the "timeline" CLI command. Additional help comments. by drh on 2007-08-18 11:42:24. [view]

To:

File src/update.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. [view]

@@ -75,8 +75,9 @@
   }
 
   db_begin_transaction();
   vfile_check_signature(vid);
+  undo_begin();
   load_vfile_from_rid(tid);
 
   /*
   ** The record.fn field is used to match files against each other.  The
@@ -144,19 +145,22 @@
       printf("CONFLICT %s\n", zName);
     }else if( idt>0 && idv==0 ){
       /* File added in the target. */
       printf("ADD %s\n", zName);
+      undo_save(zName);
       vfile_to_disk(0, idt, 0);
     }else if( idt>0 && idv>0 && ridt!=ridv && chnged==0 ){
       /* The file is unedited.  Change it to the target version */
       printf("UPDATE %s\n", zName);
+      undo_save(zName);
       vfile_to_disk(0, idt, 0);
     }else if( idt==0 && idv>0 ){
       if( chnged ){
         printf("CONFLICT %s\n", zName);
       }else{
         char *zFullPath;
         printf("REMOVE %s\n", zName);
+        undo_save(zName);
         zFullPath = mprintf("%s/%s", g.zLocalRoot, zName);
         unlink(zFullPath);
         free(zFullPath);
       }
@@ -164,8 +168,9 @@
       /* Merge the changes in the current tree into the target version */
       Blob e, r, t, v;
       char *zFullPath;
       printf("MERGE %s\n", zName);
+      undo_save(zName);
       zFullPath = mprintf("%s/%s", g.zLocalRoot, zName);
       content_get(ridt, &t);
       content_get(ridv, &v);
       blob_zero(&e);