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.

wyoung 2023-05-22 21:00 trunk
Commit 4cca90338a0f9d2522f8a73db12770a14f5beb1705066a5c87f8f2c9fd89fa93
--- src/vfile.c
+++ src/vfile.c
@@ -255,10 +255,13 @@
255255
}
256256
#ifndef _WIN32
257257
if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){
258258
/* Changing to a symlink takes priority over all other change types. */
259259
chnged = 7;
260
+ }else if( origPerm==PERM_LNK && currentPerm!=PERM_LNK ){
261
+ /* Ditto, other direction */
262
+ chnged = 9;
260263
}else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
261264
/* Confirm metadata change types. */
262265
if( origPerm==currentPerm ){
263266
chnged = 0;
264267
}else if( currentPerm==PERM_EXE ){
265268
--- 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
--- www/changes.wiki
+++ www/changes.wiki
@@ -27,10 +27,13 @@
2727
searching in Chinese.
2828
* Comment lines (starting with a '#') are now supported inside
2929
[./settings.wiki#versionable|versioned settings].
3030
* Default permissions for anonymous users in new repositories is
3131
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.)
3235
3336
<h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
3437
* Users can request a password reset. This feature is disabledby default. Use
3538
the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
3639
New web pages [/help?cmd=/resetpw|/resetpw] and
3740
--- 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

Keyboard Shortcuts

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