Diff
Not logged in

Differences From:

File src/checkin.c part of check-in [5c3e87171a] - Fix a problem in the commit logic that caused it to ignore merge changes. Add another test to the commit to detect future problems of a similar nature. by drh on 2007-08-01 12:17:14. [view]

To:

File src/checkin.c part of check-in [394505791628e] - Add primitive start-time and duration controols to the timeline. Additional checksums on check-in and check-out. by drh on 2007-08-01 21:03:03. [view]

@@ -228,8 +228,9 @@
   char *zManifestFile;   /* Name of the manifest file */
   Blob manifest;
   Blob mcksum;           /* Self-checksum on the manifest */
   Blob cksum1, cksum2;   /* Before and after commit checksums */
+  Blob cksum1b;          /* Checksum recorded in the manifest */
 
   db_must_be_within_tree();
   user_select();
   db_begin_transaction();
@@ -323,11 +324,16 @@
   vfile_aggregate_checksum_repository(nvid, &cksum2);
   if( blob_compare(&cksum1, &cksum2) ){
     fossil_panic("tree checksum does not match repository after commit");
   }
-  vfile_aggregate_checksum_manifest(nvid, &cksum2);
+  vfile_aggregate_checksum_manifest(nvid, &cksum2, &cksum1b);
+  if( blob_compare(&cksum1, &cksum1b) ){
+    fossil_panic("manifest checksum does not agree with manifest: "
+                 "%b versus %b", &cksum1, &cksum1b);
+  }
   if( blob_compare(&cksum1, &cksum2) ){
-    fossil_panic("tree checksum does not match manifest after commit");
+    fossil_panic("tree checksum does not match manifest after commit: "
+                 "%b versus %b", &cksum1, &cksum2);
   }
   vfile_aggregate_checksum_disk(nvid, &cksum2);
   if( blob_compare(&cksum1, &cksum2) ){
     fossil_panic("tree checksums before and after commit do not match");