Fossil SCM
Make changing to a symlink take priority over all other change types. This might also be a solution to the problem fixed by the previous commit, but it also avoids having a file that becomes a symlink (with target string length not equal to former file size) being marked as an ordinary edit.
Commit
f10a284abb6eb1b42592aa6a02f24c79d377ce8d
Parent
43140feb1d059e9…
1 file changed
+5
-3
+5
-3
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -263,17 +263,19 @@ | ||
| 263 | 263 | currentMtime = file_wd_mtime(zName); |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | #ifndef _WIN32 |
| 268 | - if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ | |
| 268 | + if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){ | |
| 269 | + /* Changing to a symlink takes priority over all other change types. */ | |
| 270 | + chnged = 7; | |
| 271 | + }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ | |
| 272 | + /* Confirm metadata change types. */ | |
| 269 | 273 | if( origPerm==currentPerm ){ |
| 270 | 274 | chnged = 0; |
| 271 | 275 | }else if( currentPerm==PERM_EXE ){ |
| 272 | 276 | chnged = 6; |
| 273 | - }else if( currentPerm==PERM_LNK ){ | |
| 274 | - chnged = 7; | |
| 275 | 277 | }else if( origPerm==PERM_EXE ){ |
| 276 | 278 | chnged = 8; |
| 277 | 279 | }else if( origPerm==PERM_LNK ){ |
| 278 | 280 | chnged = 9; |
| 279 | 281 | } |
| 280 | 282 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -263,17 +263,19 @@ | |
| 263 | currentMtime = file_wd_mtime(zName); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | #ifndef _WIN32 |
| 268 | if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ |
| 269 | if( origPerm==currentPerm ){ |
| 270 | chnged = 0; |
| 271 | }else if( currentPerm==PERM_EXE ){ |
| 272 | chnged = 6; |
| 273 | }else if( currentPerm==PERM_LNK ){ |
| 274 | chnged = 7; |
| 275 | }else if( origPerm==PERM_EXE ){ |
| 276 | chnged = 8; |
| 277 | }else if( origPerm==PERM_LNK ){ |
| 278 | chnged = 9; |
| 279 | } |
| 280 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -263,17 +263,19 @@ | |
| 263 | currentMtime = file_wd_mtime(zName); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | #ifndef _WIN32 |
| 268 | if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){ |
| 269 | /* Changing to a symlink takes priority over all other change types. */ |
| 270 | chnged = 7; |
| 271 | }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ |
| 272 | /* Confirm metadata change types. */ |
| 273 | if( origPerm==currentPerm ){ |
| 274 | chnged = 0; |
| 275 | }else if( currentPerm==PERM_EXE ){ |
| 276 | chnged = 6; |
| 277 | }else if( origPerm==PERM_EXE ){ |
| 278 | chnged = 8; |
| 279 | }else if( origPerm==PERM_LNK ){ |
| 280 | chnged = 9; |
| 281 | } |
| 282 |