Fossil SCM
Compute hash if mtime is unchanged but match system time. Discussed in [forum:/forumpost/58bef43842be6fc3|forum thread 58bef43842be6fc3].
Commit
b295f86db5417cea1e7a33c188d5f489b06a8373ce8c5280cb2b1b4ec1dc751b
Parent
c8fda6a62cc5c6e…
1 file changed
+2
-1
+2
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -19,10 +19,11 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "vfile.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 23 | #include <sys/types.h> |
| 24 | +#include <time.h> | |
| 24 | 25 | |
| 25 | 26 | /* |
| 26 | 27 | ** The input is guaranteed to be a 40- or 64-character well-formed |
| 27 | 28 | ** artifact hash. Find its rid. |
| 28 | 29 | */ |
| @@ -232,11 +233,11 @@ | ||
| 232 | 233 | const char *zUuid = db_column_text(&q, 5); |
| 233 | 234 | int nUuid = db_column_bytes(&q, 5); |
| 234 | 235 | assert( origSize==currentSize ); |
| 235 | 236 | if( hname_verify_file_hash(zName, zUuid, nUuid) ) chnged = 0; |
| 236 | 237 | }else if( (chnged==0 || chnged==2 || chnged==4) |
| 237 | - && (useMtime==0 || currentMtime!=oldMtime) ){ | |
| 238 | + && (useMtime==0 || currentMtime!=oldMtime || currentMtime==time(0)) ){ | |
| 238 | 239 | /* For files that were formerly believed to be unchanged or that were |
| 239 | 240 | ** changed by merging, if their mtime changes, or unconditionally |
| 240 | 241 | ** if --hash is used, check to see if they have been edited by |
| 241 | 242 | ** looking at their artifact hashes */ |
| 242 | 243 | const char *zUuid = db_column_text(&q, 5); |
| 243 | 244 |
| --- 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 |