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.

andygoth 2016-11-15 23:23 trunk
Commit f10a284abb6eb1b42592aa6a02f24c79d377ce8d
1 file changed +5 -3
+5 -3
--- src/vfile.c
+++ src/vfile.c
@@ -263,17 +263,19 @@
263263
currentMtime = file_wd_mtime(zName);
264264
}
265265
}
266266
}
267267
#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. */
269273
if( origPerm==currentPerm ){
270274
chnged = 0;
271275
}else if( currentPerm==PERM_EXE ){
272276
chnged = 6;
273
- }else if( currentPerm==PERM_LNK ){
274
- chnged = 7;
275277
}else if( origPerm==PERM_EXE ){
276278
chnged = 8;
277279
}else if( origPerm==PERM_LNK ){
278280
chnged = 9;
279281
}
280282
--- 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

Keyboard Shortcuts

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