Fossil SCM

Compute hash if mtime is unchanged but match system time. Discussed in [forum:/forumpost/58bef43842be6fc3|forum thread 58bef43842be6fc3].

preben 2024-01-07 11:26 trunk
Commit b295f86db5417cea1e7a33c188d5f489b06a8373ce8c5280cb2b1b4ec1dc751b
1 file changed +2 -1
+2 -1
--- src/vfile.c
+++ src/vfile.c
@@ -19,10 +19,11 @@
1919
*/
2020
#include "config.h"
2121
#include "vfile.h"
2222
#include <assert.h>
2323
#include <sys/types.h>
24
+#include <time.h>
2425
2526
/*
2627
** The input is guaranteed to be a 40- or 64-character well-formed
2728
** artifact hash. Find its rid.
2829
*/
@@ -232,11 +233,11 @@
232233
const char *zUuid = db_column_text(&q, 5);
233234
int nUuid = db_column_bytes(&q, 5);
234235
assert( origSize==currentSize );
235236
if( hname_verify_file_hash(zName, zUuid, nUuid) ) chnged = 0;
236237
}else if( (chnged==0 || chnged==2 || chnged==4)
237
- && (useMtime==0 || currentMtime!=oldMtime) ){
238
+ && (useMtime==0 || currentMtime!=oldMtime || currentMtime==time(0)) ){
238239
/* For files that were formerly believed to be unchanged or that were
239240
** changed by merging, if their mtime changes, or unconditionally
240241
** if --hash is used, check to see if they have been edited by
241242
** looking at their artifact hashes */
242243
const char *zUuid = db_column_text(&q, 5);
243244
--- src/vfile.c
+++ src/vfile.c
@@ -19,10 +19,11 @@
19 */
20 #include "config.h"
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
 
24
25 /*
26 ** The input is guaranteed to be a 40- or 64-character well-formed
27 ** artifact hash. Find its rid.
28 */
@@ -232,11 +233,11 @@
232 const char *zUuid = db_column_text(&q, 5);
233 int nUuid = db_column_bytes(&q, 5);
234 assert( origSize==currentSize );
235 if( hname_verify_file_hash(zName, zUuid, nUuid) ) chnged = 0;
236 }else if( (chnged==0 || chnged==2 || chnged==4)
237 && (useMtime==0 || currentMtime!=oldMtime) ){
238 /* For files that were formerly believed to be unchanged or that were
239 ** changed by merging, if their mtime changes, or unconditionally
240 ** if --hash is used, check to see if they have been edited by
241 ** looking at their artifact hashes */
242 const char *zUuid = db_column_text(&q, 5);
243
--- src/vfile.c
+++ src/vfile.c
@@ -19,10 +19,11 @@
19 */
20 #include "config.h"
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
24 #include <time.h>
25
26 /*
27 ** The input is guaranteed to be a 40- or 64-character well-formed
28 ** artifact hash. Find its rid.
29 */
@@ -232,11 +233,11 @@
233 const char *zUuid = db_column_text(&q, 5);
234 int nUuid = db_column_bytes(&q, 5);
235 assert( origSize==currentSize );
236 if( hname_verify_file_hash(zName, zUuid, nUuid) ) chnged = 0;
237 }else if( (chnged==0 || chnged==2 || chnged==4)
238 && (useMtime==0 || currentMtime!=oldMtime || currentMtime==time(0)) ){
239 /* For files that were formerly believed to be unchanged or that were
240 ** changed by merging, if their mtime changes, or unconditionally
241 ** if --hash is used, check to see if they have been edited by
242 ** looking at their artifact hashes */
243 const char *zUuid = db_column_text(&q, 5);
244

Keyboard Shortcuts

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