Fossil

Check-in [0762b1d9]
Login

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

Overview
Comment:Fix saving undo for symlinks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | symlinks
Files: files | file ages | folders
SHA1: 0762b1d9c6cc13b1c64669798da7ef74685fa54d
User & Date: dmitry 2011-09-01 22:15:00
Context
2011-09-01
22:52
Fix undo when having a regular file on disk and symlink in undo. check-in: 324763b9 user: dmitry tags: symlinks
22:15
Fix saving undo for symlinks. check-in: 0762b1d9 user: dmitry tags: symlinks
20:56
Merge latest trunk. check-in: 02ee688a user: dmitry tags: symlinks
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/undo.c.

269
270
271
272
273
274
275

276
277
278
279
280
281
282
283
284
285
286
  int existsFlag;
  int isLink;
  Stmt q;

  if( !undoActive ) return;
  zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
  existsFlag = file_size(zFullname)>=0;

  db_prepare(&q,
    "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
    " VALUES(%Q,0,%d,%d,%d,:c)",
    zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname)
  );
  if( existsFlag ){
    if( isLink ){
      blob_read_link(&content, zFullname); 
    }else{
      blob_read_from_file(&content, zFullname);
    }







>



|







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
  int existsFlag;
  int isLink;
  Stmt q;

  if( !undoActive ) return;
  zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
  existsFlag = file_size(zFullname)>=0;
  isLink = file_islink(zFullname);
  db_prepare(&q,
    "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
    " VALUES(%Q,0,%d,%d,%d,:c)",
    zPathname, existsFlag, file_isexe(zFullname), isLink
  );
  if( existsFlag ){
    if( isLink ){
      blob_read_link(&content, zFullname); 
    }else{
      blob_read_from_file(&content, zFullname);
    }