Fossil SCM
Preserve timestamps across an "update" to reduce I/O on the next "status". Ticket [809a9612055340d06].
Commit
ffe1b60a36be25258a514d4834f12c07687ded84
Parent
479a2fe0f765cfb…
1 file changed
+13
-3
+13
-3
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -96,10 +96,11 @@ | ||
| 96 | 96 | int debugFlag; /* --debug option */ |
| 97 | 97 | int nChng; /* Number of file renames */ |
| 98 | 98 | int *aChng; /* Array of file renames */ |
| 99 | 99 | int i; /* Loop counter */ |
| 100 | 100 | int nConflict = 0; /* Number of merge conflicts */ |
| 101 | + Stmt mtimeXfer; /* Statment to transfer mtimes */ | |
| 101 | 102 | |
| 102 | 103 | if( !internalUpdate ){ |
| 103 | 104 | undo_capture_command_line(); |
| 104 | 105 | url_proxy_options(); |
| 105 | 106 | } |
| @@ -299,10 +300,14 @@ | ||
| 299 | 300 | ** Alter the content of the checkout so that it conforms with the |
| 300 | 301 | ** target |
| 301 | 302 | */ |
| 302 | 303 | db_prepare(&q, |
| 303 | 304 | "SELECT fn, idv, ridv, idt, ridt, chnged, fnt FROM fv ORDER BY 1" |
| 305 | + ); | |
| 306 | + db_prepare(&mtimeXfer, | |
| 307 | + "UPDATE vfile SET mtime=(SELECT mtime FROM vfile WHERE id=:idv)" | |
| 308 | + " WHERE id=:idt" | |
| 304 | 309 | ); |
| 305 | 310 | assert( g.zLocalRoot!=0 ); |
| 306 | 311 | assert( strlen(g.zLocalRoot)>1 ); |
| 307 | 312 | assert( g.zLocalRoot[strlen(g.zLocalRoot)-1]=='/' ); |
| 308 | 313 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -386,21 +391,26 @@ | ||
| 386 | 391 | if( nameChng && !nochangeFlag ) unlink(zFullPath); |
| 387 | 392 | blob_reset(&v); |
| 388 | 393 | blob_reset(&e); |
| 389 | 394 | blob_reset(&t); |
| 390 | 395 | blob_reset(&r); |
| 391 | - }else if( verboseFlag ){ | |
| 396 | + }else{ | |
| 392 | 397 | if( chnged ){ |
| 393 | - printf("EDITED %s\n", zName); | |
| 398 | + if( verboseFlag ) printf("EDITED %s\n", zName); | |
| 394 | 399 | }else{ |
| 395 | - printf("UNCHANGED %s\n", zName); | |
| 400 | + db_bind_int(&mtimeXfer, ":idv", idv); | |
| 401 | + db_bind_int(&mtimeXfer, ":idt", idt); | |
| 402 | + db_step(&mtimeXfer); | |
| 403 | + db_reset(&mtimeXfer); | |
| 404 | + if( verboseFlag ) printf("UNCHANGED %s\n", zName); | |
| 396 | 405 | } |
| 397 | 406 | } |
| 398 | 407 | free(zFullPath); |
| 399 | 408 | free(zFullNewPath); |
| 400 | 409 | } |
| 401 | 410 | db_finalize(&q); |
| 411 | + db_finalize(&mtimeXfer); | |
| 402 | 412 | printf("--------------\n"); |
| 403 | 413 | show_common_info(tid, "updated-to:", 1, 0); |
| 404 | 414 | |
| 405 | 415 | /* Report on conflicts |
| 406 | 416 | */ |
| 407 | 417 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -96,10 +96,11 @@ | |
| 96 | int debugFlag; /* --debug option */ |
| 97 | int nChng; /* Number of file renames */ |
| 98 | int *aChng; /* Array of file renames */ |
| 99 | int i; /* Loop counter */ |
| 100 | int nConflict = 0; /* Number of merge conflicts */ |
| 101 | |
| 102 | if( !internalUpdate ){ |
| 103 | undo_capture_command_line(); |
| 104 | url_proxy_options(); |
| 105 | } |
| @@ -299,10 +300,14 @@ | |
| 299 | ** Alter the content of the checkout so that it conforms with the |
| 300 | ** target |
| 301 | */ |
| 302 | db_prepare(&q, |
| 303 | "SELECT fn, idv, ridv, idt, ridt, chnged, fnt FROM fv ORDER BY 1" |
| 304 | ); |
| 305 | assert( g.zLocalRoot!=0 ); |
| 306 | assert( strlen(g.zLocalRoot)>1 ); |
| 307 | assert( g.zLocalRoot[strlen(g.zLocalRoot)-1]=='/' ); |
| 308 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -386,21 +391,26 @@ | |
| 386 | if( nameChng && !nochangeFlag ) unlink(zFullPath); |
| 387 | blob_reset(&v); |
| 388 | blob_reset(&e); |
| 389 | blob_reset(&t); |
| 390 | blob_reset(&r); |
| 391 | }else if( verboseFlag ){ |
| 392 | if( chnged ){ |
| 393 | printf("EDITED %s\n", zName); |
| 394 | }else{ |
| 395 | printf("UNCHANGED %s\n", zName); |
| 396 | } |
| 397 | } |
| 398 | free(zFullPath); |
| 399 | free(zFullNewPath); |
| 400 | } |
| 401 | db_finalize(&q); |
| 402 | printf("--------------\n"); |
| 403 | show_common_info(tid, "updated-to:", 1, 0); |
| 404 | |
| 405 | /* Report on conflicts |
| 406 | */ |
| 407 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -96,10 +96,11 @@ | |
| 96 | int debugFlag; /* --debug option */ |
| 97 | int nChng; /* Number of file renames */ |
| 98 | int *aChng; /* Array of file renames */ |
| 99 | int i; /* Loop counter */ |
| 100 | int nConflict = 0; /* Number of merge conflicts */ |
| 101 | Stmt mtimeXfer; /* Statment to transfer mtimes */ |
| 102 | |
| 103 | if( !internalUpdate ){ |
| 104 | undo_capture_command_line(); |
| 105 | url_proxy_options(); |
| 106 | } |
| @@ -299,10 +300,14 @@ | |
| 300 | ** Alter the content of the checkout so that it conforms with the |
| 301 | ** target |
| 302 | */ |
| 303 | db_prepare(&q, |
| 304 | "SELECT fn, idv, ridv, idt, ridt, chnged, fnt FROM fv ORDER BY 1" |
| 305 | ); |
| 306 | db_prepare(&mtimeXfer, |
| 307 | "UPDATE vfile SET mtime=(SELECT mtime FROM vfile WHERE id=:idv)" |
| 308 | " WHERE id=:idt" |
| 309 | ); |
| 310 | assert( g.zLocalRoot!=0 ); |
| 311 | assert( strlen(g.zLocalRoot)>1 ); |
| 312 | assert( g.zLocalRoot[strlen(g.zLocalRoot)-1]=='/' ); |
| 313 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -386,21 +391,26 @@ | |
| 391 | if( nameChng && !nochangeFlag ) unlink(zFullPath); |
| 392 | blob_reset(&v); |
| 393 | blob_reset(&e); |
| 394 | blob_reset(&t); |
| 395 | blob_reset(&r); |
| 396 | }else{ |
| 397 | if( chnged ){ |
| 398 | if( verboseFlag ) printf("EDITED %s\n", zName); |
| 399 | }else{ |
| 400 | db_bind_int(&mtimeXfer, ":idv", idv); |
| 401 | db_bind_int(&mtimeXfer, ":idt", idt); |
| 402 | db_step(&mtimeXfer); |
| 403 | db_reset(&mtimeXfer); |
| 404 | if( verboseFlag ) printf("UNCHANGED %s\n", zName); |
| 405 | } |
| 406 | } |
| 407 | free(zFullPath); |
| 408 | free(zFullNewPath); |
| 409 | } |
| 410 | db_finalize(&q); |
| 411 | db_finalize(&mtimeXfer); |
| 412 | printf("--------------\n"); |
| 413 | show_common_info(tid, "updated-to:", 1, 0); |
| 414 | |
| 415 | /* Report on conflicts |
| 416 | */ |
| 417 |