Fossil SCM

Fix saving undo for symlinks.

dmitry 2011-09-01 22:15 symlinks
Commit 0762b1d9c6cc13b1c64669798da7ef74685fa54d
1 file changed +2 -1
+2 -1
--- src/undo.c
+++ src/undo.c
@@ -271,14 +271,15 @@
271271
Stmt q;
272272
273273
if( !undoActive ) return;
274274
zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
275275
existsFlag = file_size(zFullname)>=0;
276
+ isLink = file_islink(zFullname);
276277
db_prepare(&q,
277278
"INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
278279
" VALUES(%Q,0,%d,%d,%d,:c)",
279
- zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname)
280
+ zPathname, existsFlag, file_isexe(zFullname), isLink
280281
);
281282
if( existsFlag ){
282283
if( isLink ){
283284
blob_read_link(&content, zFullname);
284285
}else{
285286
--- src/undo.c
+++ src/undo.c
@@ -271,14 +271,15 @@
271 Stmt q;
272
273 if( !undoActive ) return;
274 zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
275 existsFlag = file_size(zFullname)>=0;
 
276 db_prepare(&q,
277 "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
278 " VALUES(%Q,0,%d,%d,%d,:c)",
279 zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname)
280 );
281 if( existsFlag ){
282 if( isLink ){
283 blob_read_link(&content, zFullname);
284 }else{
285
--- src/undo.c
+++ src/undo.c
@@ -271,14 +271,15 @@
271 Stmt q;
272
273 if( !undoActive ) return;
274 zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
275 existsFlag = file_size(zFullname)>=0;
276 isLink = file_islink(zFullname);
277 db_prepare(&q,
278 "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
279 " VALUES(%Q,0,%d,%d,%d,:c)",
280 zPathname, existsFlag, file_isexe(zFullname), isLink
281 );
282 if( existsFlag ){
283 if( isLink ){
284 blob_read_link(&content, zFullname);
285 }else{
286

Keyboard Shortcuts

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