Check-in [a040ae6e17]
Not logged in
Overview

SHA1 Hash:a040ae6e17e68b6f4de4ff7f3ec6ebee940c0ff3
Date: 2007-08-08 15:18:53
User: drh
Comment:Write the new manifest file to the root of the check-out tree when doing an update.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/checkout.c from [6ea05f6640] to [8d2964dd5e].

@@ -91,10 +91,26 @@
   vfile_build(vid, &manifest);
   blob_reset(&manifest);
 }
 
 /*
+** Read the manifest file given by vid out of the repository
+** and store it in the root of the local check-out.
+*/
+void manifest_to_disk(int vid){
+  char *zManFile;
+  Blob manifest;
+
+  blob_zero(&manifest);
+  zManFile = mprintf("%smanifest", g.zLocalRoot);
+  content_get(vid, &manifest);
+  blob_write_to_file(&manifest, zManFile);
+  free(zManFile);
+  blob_reset(&manifest);
+}
+
+/*
 ** COMMAND: checkout
 **
 ** Check out a version specified on the command-line.
 */
 void checkout_cmd(void){
@@ -124,18 +140,12 @@
   if( !noWrite ){
     uncheckout(prior);
   }
   db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
   if( !noWrite ){
-    Blob manifest;
-    char *zManFile;
     vfile_to_disk(vid, 0, 1);
-    blob_zero(&manifest);
-    zManFile = mprintf("%smanifest", g.zLocalRoot);
-    content_get(vid, &manifest);
-    blob_write_to_file(&manifest, zManFile);
-    free(zManFile);
+    manifest_to_disk(vid);
     db_lset_int("checkout", vid);
   }
   db_multi_exec("DELETE FROM vmerge");
   vfile_aggregate_checksum_manifest(vid, &cksum1, &cksum1b);
   vfile_aggregate_checksum_disk(vid, &cksum2);

Modified src/update.c from [d64d008fb6] to [167b4a11d3].

@@ -174,8 +174,9 @@
 
   /*
   ** Clean up the mid and pid VFILE entries.  Then commit the changes.
   */
   db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
+  manifest_to_disk(tid);
   db_lset_int("checkout", tid);
   db_end_transaction(0);
 }