Fossil

Check-in [f10a284a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f10a284abb6eb1b42592aa6a02f24c79d377ce8d
User & Date: andygoth 2016-11-15 23:23:11.656
Context
2016-11-15
23:29
Fix revert -r option to mark a reverted file as edited if the reverted-to version does not exactly match the checkout version, even if the file size is equal ... (check-in: f9080683 user: andygoth tags: trunk)
23:23
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. ... (check-in: f10a284a user: andygoth tags: trunk)
23:11
Don't rely on vfile.islink to tell whether or not a file is currently a symlink for the purpose of avoiding calling file_contains_merge_marker(). It is possible for a file to have become a symlink since the last commit. If the link target's string length is not equal to the former file size, vfile_check_signature() will treat it as a normal change and not mark it as chnged==8 (SYMLINK), so execution can fall through to the undesirable call to file_contains_merge_marker(). ... (check-in: 43140feb user: andygoth tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vfile.c.
261
262
263
264
265
266
267



268

269
270
271
272
273
274
275
276
277
278
279
280
281
        if( currentMtime!=desiredMtime ){
          file_set_mtime(zName, desiredMtime);
          currentMtime = file_wd_mtime(zName);
        }
      }
    }
#ifndef _WIN32



    if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){

      if( origPerm==currentPerm ){
        chnged = 0;
      }else if( currentPerm==PERM_EXE ){
        chnged = 6;
      }else if( currentPerm==PERM_LNK ){
        chnged = 7;
      }else if( origPerm==PERM_EXE ){
        chnged = 8;
      }else if( origPerm==PERM_LNK ){
        chnged = 9;
      }
    }
#endif







>
>
>
|
>




<
<







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276


277
278
279
280
281
282
283
        if( currentMtime!=desiredMtime ){
          file_set_mtime(zName, desiredMtime);
          currentMtime = file_wd_mtime(zName);
        }
      }
    }
#ifndef _WIN32
    if( origPerm!=PERM_LNK && currentPerm==PERM_LNK ){
       /* Changing to a symlink takes priority over all other change types. */
       chnged = 7;
    }else if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
       /* Confirm metadata change types. */
      if( origPerm==currentPerm ){
        chnged = 0;
      }else if( currentPerm==PERM_EXE ){
        chnged = 6;


      }else if( origPerm==PERM_EXE ){
        chnged = 8;
      }else if( origPerm==PERM_LNK ){
        chnged = 9;
      }
    }
#endif