Fossil SCM

Improved detection of changes to a file after a merge that do not change the size of the file.

drh 2012-06-25 15:43 trunk
Commit 23022a8546d9fdc6bfb0560eb9c6b69db754b1c4
1 file changed +6 -4
+6 -4
--- src/vfile.c
+++ src/vfile.c
@@ -206,14 +206,16 @@
206206
blob_zero(&fileCksum);
207207
}
208208
if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
209209
blob_reset(&origCksum);
210210
blob_reset(&fileCksum);
211
- }else if( chnged==0 && (useMtime==0 || currentMtime!=oldMtime) ){
212
- /* For files that were formerly believed to be unchanged, if their
213
- ** mtime changes, or unconditionally if --sha1sum is used, check
214
- ** to see if they have been edited by looking at their SHA1 sum */
211
+ }else if( (chnged==0 || chnged==2)
212
+ && (useMtime==0 || currentMtime!=oldMtime) ){
213
+ /* For files that were formerly believed to be unchanged or that were
214
+ ** changed by merging, if their mtime changes, or unconditionally
215
+ ** if --sha1sum is used, check to see if they have been edited by
216
+ ** looking at their SHA1 sum */
215217
assert( origSize==currentSize );
216218
db_ephemeral_blob(&q, 5, &origCksum);
217219
if( sha1sum_file(zName, &fileCksum) ){
218220
blob_zero(&fileCksum);
219221
}
220222
--- src/vfile.c
+++ src/vfile.c
@@ -206,14 +206,16 @@
206 blob_zero(&fileCksum);
207 }
208 if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
209 blob_reset(&origCksum);
210 blob_reset(&fileCksum);
211 }else if( chnged==0 && (useMtime==0 || currentMtime!=oldMtime) ){
212 /* For files that were formerly believed to be unchanged, if their
213 ** mtime changes, or unconditionally if --sha1sum is used, check
214 ** to see if they have been edited by looking at their SHA1 sum */
 
 
215 assert( origSize==currentSize );
216 db_ephemeral_blob(&q, 5, &origCksum);
217 if( sha1sum_file(zName, &fileCksum) ){
218 blob_zero(&fileCksum);
219 }
220
--- src/vfile.c
+++ src/vfile.c
@@ -206,14 +206,16 @@
206 blob_zero(&fileCksum);
207 }
208 if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
209 blob_reset(&origCksum);
210 blob_reset(&fileCksum);
211 }else if( (chnged==0 || chnged==2)
212 && (useMtime==0 || currentMtime!=oldMtime) ){
213 /* For files that were formerly believed to be unchanged or that were
214 ** changed by merging, if their mtime changes, or unconditionally
215 ** if --sha1sum is used, check to see if they have been edited by
216 ** looking at their SHA1 sum */
217 assert( origSize==currentSize );
218 db_ephemeral_blob(&q, 5, &origCksum);
219 if( sha1sum_file(zName, &fileCksum) ){
220 blob_zero(&fileCksum);
221 }
222

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button