Fossil SCM
Fixed a symmetry problem in the vfile.chnged implementation: it had an explicit check for when a file used to be a regular file and was replaced by a symlink pointing to the same content, but it didn't then check for the inverse case. Since the size and hash checks become nonsense when both files aren't of the same type (whether symlinks or regular files) we have to check for this case, too, else the only way to get the "UNLINK" output from "fossil status" required trickery. See [forum:/forum/forumpost/204ff988263d7795 | this forum post] for a test case and the trick previously needed to get Fossil to report "UNLINK" as a file's change status.
Commit
4cca90338a0f9d2522f8a73db12770a14f5beb1705066a5c87f8f2c9fd89fa93
Parent
b1c0409a56baebf…
2 files changed
+3
+3
+3
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -255,10 +255,13 @@ | ||
| 255 | 255 | } |
| 256 | 256 | #ifndef _WIN32 |
| 257 | 257 | if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){ |
| 258 | 258 | /* Changing to a symlink takes priority over all other change types. */ |
| 259 | 259 | chnged = 7; |
| 260 | + }else if( origPerm==PERM_LNK && currentPerm!=PERM_LNK ){ | |
| 261 | + /* Ditto, other direction */ | |
| 262 | + chnged = 9; | |
| 260 | 263 | }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ |
| 261 | 264 | /* Confirm metadata change types. */ |
| 262 | 265 | if( origPerm==currentPerm ){ |
| 263 | 266 | chnged = 0; |
| 264 | 267 | }else if( currentPerm==PERM_EXE ){ |
| 265 | 268 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -255,10 +255,13 @@ | |
| 255 | } |
| 256 | #ifndef _WIN32 |
| 257 | if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){ |
| 258 | /* Changing to a symlink takes priority over all other change types. */ |
| 259 | chnged = 7; |
| 260 | }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ |
| 261 | /* Confirm metadata change types. */ |
| 262 | if( origPerm==currentPerm ){ |
| 263 | chnged = 0; |
| 264 | }else if( currentPerm==PERM_EXE ){ |
| 265 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -255,10 +255,13 @@ | |
| 255 | } |
| 256 | #ifndef _WIN32 |
| 257 | if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){ |
| 258 | /* Changing to a symlink takes priority over all other change types. */ |
| 259 | chnged = 7; |
| 260 | }else if( origPerm==PERM_LNK && currentPerm!=PERM_LNK ){ |
| 261 | /* Ditto, other direction */ |
| 262 | chnged = 9; |
| 263 | }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){ |
| 264 | /* Confirm metadata change types. */ |
| 265 | if( origPerm==currentPerm ){ |
| 266 | chnged = 0; |
| 267 | }else if( currentPerm==PERM_EXE ){ |
| 268 |
+3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -27,10 +27,13 @@ | ||
| 27 | 27 | searching in Chinese. |
| 28 | 28 | * Comment lines (starting with a '#') are now supported inside |
| 29 | 29 | [./settings.wiki#versionable|versioned settings]. |
| 30 | 30 | * Default permissions for anonymous users in new repositories is |
| 31 | 31 | changed to "hz". |
| 32 | + * "fossil status" now detects when a file used to be a symlink and | |
| 33 | + has been replaced by a regular file with the same content. (It | |
| 34 | + previously checked for the inverse case only.) | |
| 32 | 35 | |
| 33 | 36 | <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2> |
| 34 | 37 | * Users can request a password reset. This feature is disabledby default. Use |
| 35 | 38 | the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it. |
| 36 | 39 | New web pages [/help?cmd=/resetpw|/resetpw] and |
| 37 | 40 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -27,10 +27,13 @@ | |
| 27 | searching in Chinese. |
| 28 | * Comment lines (starting with a '#') are now supported inside |
| 29 | [./settings.wiki#versionable|versioned settings]. |
| 30 | * Default permissions for anonymous users in new repositories is |
| 31 | changed to "hz". |
| 32 | |
| 33 | <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2> |
| 34 | * Users can request a password reset. This feature is disabledby default. Use |
| 35 | the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it. |
| 36 | New web pages [/help?cmd=/resetpw|/resetpw] and |
| 37 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -27,10 +27,13 @@ | |
| 27 | searching in Chinese. |
| 28 | * Comment lines (starting with a '#') are now supported inside |
| 29 | [./settings.wiki#versionable|versioned settings]. |
| 30 | * Default permissions for anonymous users in new repositories is |
| 31 | changed to "hz". |
| 32 | * "fossil status" now detects when a file used to be a symlink and |
| 33 | has been replaced by a regular file with the same content. (It |
| 34 | previously checked for the inverse case only.) |
| 35 | |
| 36 | <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2> |
| 37 | * Users can request a password reset. This feature is disabledby default. Use |
| 38 | the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it. |
| 39 | New web pages [/help?cmd=/resetpw|/resetpw] and |
| 40 |