69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
-
+
-
+
|
if( old_exists ){
if( new_exists ){
fossil_print("%s %s\n", redoFlag ? "REDO" : "UNDO", zPathname);
}else{
fossil_print("NEW %s\n", zPathname);
}
if( new_exists && (new_link || old_link) ){
unlink(zFullname);
file_delete(zFullname);
}
if( new_link ){
if( old_link ){
create_symlink(blob_str(&new), zFullname);
}else{
blob_write_to_file(&new, zFullname);
}
file_setexe(zFullname, old_exe);
}else{
fossil_print("DELETE %s\n", zPathname);
|
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
-
+
|
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), file_islink(zFullname)
zPathname, existsFlag, file_isexe(zFullname), isLink
);
if( existsFlag ){
if( isLink ){
blob_read_link(&content, zFullname);
}else{
blob_read_from_file(&content, zFullname);
}
|