Fossil SCM

Changed name of checked_symlink_create to create_symlink_or_file as it is more accurate / descriptive. Also changed some parameter names, and fixed a couple spelling errors (accidentally typed blog instead of blob and never compiled; oops).

sdr 2014-09-20 18:41 bad-winsymlink
Commit 31b0a9d737c6417a946c52a014975267c5bf983a
+4 -4
--- src/file.c
+++ src/file.c
@@ -242,17 +242,17 @@
242242
blob_write_to_file(&content, zLinkFile);
243243
blob_reset(&content);
244244
}
245245
}
246246
247
-void checked_symlink_create(int needDelete, int needLink, int maybeLink, Blob* blob, const char* zName){
248
- if (needDelete && (needLink || maybeLink))
247
+void create_symlink_or_file(int mayNeedDelete, int needLink, int mayBeLink, Blob* blob, const char* zName){
248
+ if (mayNeedDelete && (needLink || mayBeLink))
249249
link_delete(zName);
250250
if (needLink)
251
- symlink_create(blog_str(blob), zName);
251
+ symlink_create(blob_str(blob), zName);
252252
else
253
- blog_write_to_file(blob, zName);
253
+ blob_write_to_file(blob, zName);
254254
}
255255
256256
/*
257257
** Copy symbolic link from zFrom to zTo.
258258
*/
259259
--- src/file.c
+++ src/file.c
@@ -242,17 +242,17 @@
242 blob_write_to_file(&content, zLinkFile);
243 blob_reset(&content);
244 }
245 }
246
247 void checked_symlink_create(int needDelete, int needLink, int maybeLink, Blob* blob, const char* zName){
248 if (needDelete && (needLink || maybeLink))
249 link_delete(zName);
250 if (needLink)
251 symlink_create(blog_str(blob), zName);
252 else
253 blog_write_to_file(blob, zName);
254 }
255
256 /*
257 ** Copy symbolic link from zFrom to zTo.
258 */
259
--- src/file.c
+++ src/file.c
@@ -242,17 +242,17 @@
242 blob_write_to_file(&content, zLinkFile);
243 blob_reset(&content);
244 }
245 }
246
247 void create_symlink_or_file(int mayNeedDelete, int needLink, int mayBeLink, Blob* blob, const char* zName){
248 if (mayNeedDelete && (needLink || mayBeLink))
249 link_delete(zName);
250 if (needLink)
251 symlink_create(blob_str(blob), zName);
252 else
253 blob_write_to_file(blob, zName);
254 }
255
256 /*
257 ** Copy symbolic link from zFrom to zTo.
258 */
259
+1 -1
--- src/stash.c
+++ src/stash.c
@@ -241,11 +241,11 @@
241241
blob_read_from_file(&disk, zOPath);
242242
}
243243
content_get(rid, &a);
244244
blob_delta_apply(&a, &delta, &b);
245245
if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){
246
- checked_symlink_create(1, isLink, isNewLink, &b, zNPath);
246
+ create_symlink_or_file(1, isLink, isNewLink, &b, zNPath);
247247
file_wd_setexe(zNPath, isExec);
248248
fossil_print("UPDATE %s\n", zNew);
249249
}else{
250250
int rc;
251251
if( isLink || isNewLink ){
252252
--- src/stash.c
+++ src/stash.c
@@ -241,11 +241,11 @@
241 blob_read_from_file(&disk, zOPath);
242 }
243 content_get(rid, &a);
244 blob_delta_apply(&a, &delta, &b);
245 if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){
246 checked_symlink_create(1, isLink, isNewLink, &b, zNPath);
247 file_wd_setexe(zNPath, isExec);
248 fossil_print("UPDATE %s\n", zNew);
249 }else{
250 int rc;
251 if( isLink || isNewLink ){
252
--- src/stash.c
+++ src/stash.c
@@ -241,11 +241,11 @@
241 blob_read_from_file(&disk, zOPath);
242 }
243 content_get(rid, &a);
244 blob_delta_apply(&a, &delta, &b);
245 if( isLink == isNewLink && blob_compare(&disk, &a)==0 ){
246 create_symlink_or_file(1, isLink, isNewLink, &b, zNPath);
247 file_wd_setexe(zNPath, isExec);
248 fossil_print("UPDATE %s\n", zNew);
249 }else{
250 int rc;
251 if( isLink || isNewLink ){
252
+1 -1
--- src/undo.c
+++ src/undo.c
@@ -70,11 +70,11 @@
7070
if( new_exists ){
7171
fossil_print("%s %s\n", redoFlag ? "REDO" : "UNDO", zPathname);
7272
}else{
7373
fossil_print("NEW %s\n", zPathname);
7474
}
75
- checked_symlink_create(new_exists, old_link, new_link, &new, zFullname);
75
+ create_symlink_or_file(new_exists, old_link, new_link, &new, zFullname);
7676
file_wd_setexe(zFullname, old_exe);
7777
}else{
7878
fossil_print("DELETE %s\n", zPathname);
7979
file_delete(zFullname);
8080
}
8181
--- src/undo.c
+++ src/undo.c
@@ -70,11 +70,11 @@
70 if( new_exists ){
71 fossil_print("%s %s\n", redoFlag ? "REDO" : "UNDO", zPathname);
72 }else{
73 fossil_print("NEW %s\n", zPathname);
74 }
75 checked_symlink_create(new_exists, old_link, new_link, &new, zFullname);
76 file_wd_setexe(zFullname, old_exe);
77 }else{
78 fossil_print("DELETE %s\n", zPathname);
79 file_delete(zFullname);
80 }
81
--- src/undo.c
+++ src/undo.c
@@ -70,11 +70,11 @@
70 if( new_exists ){
71 fossil_print("%s %s\n", redoFlag ? "REDO" : "UNDO", zPathname);
72 }else{
73 fossil_print("NEW %s\n", zPathname);
74 }
75 create_symlink_or_file(new_exists, old_link, new_link, &new, zFullname);
76 file_wd_setexe(zFullname, old_exe);
77 }else{
78 fossil_print("DELETE %s\n", zPathname);
79 file_delete(zFullname);
80 }
81
+1 -1
--- src/update.c
+++ src/update.c
@@ -808,11 +808,11 @@
808808
zFile, zFile
809809
);
810810
}else{
811811
sqlite3_int64 mtime;
812812
undo_save(zFile);
813
- checked_symlink_create(file_wd_size(zFull)>=0, isLink, file_wd_islink(zFull), &record, zFull);
813
+ create_symlink_or_file(file_wd_size(zFull)>=0, isLink, file_wd_islink(zFull), &record, zFull);
814814
file_wd_setexe(zFull, isExe);
815815
fossil_print("REVERTED: %s\n", zFile);
816816
mtime = file_wd_mtime(zFull);
817817
db_multi_exec(
818818
"UPDATE vfile"
819819
--- src/update.c
+++ src/update.c
@@ -808,11 +808,11 @@
808 zFile, zFile
809 );
810 }else{
811 sqlite3_int64 mtime;
812 undo_save(zFile);
813 checked_symlink_create(file_wd_size(zFull)>=0, isLink, file_wd_islink(zFull), &record, zFull);
814 file_wd_setexe(zFull, isExe);
815 fossil_print("REVERTED: %s\n", zFile);
816 mtime = file_wd_mtime(zFull);
817 db_multi_exec(
818 "UPDATE vfile"
819
--- src/update.c
+++ src/update.c
@@ -808,11 +808,11 @@
808 zFile, zFile
809 );
810 }else{
811 sqlite3_int64 mtime;
812 undo_save(zFile);
813 create_symlink_or_file(file_wd_size(zFull)>=0, isLink, file_wd_islink(zFull), &record, zFull);
814 file_wd_setexe(zFull, isExe);
815 fossil_print("REVERTED: %s\n", zFile);
816 mtime = file_wd_mtime(zFull);
817 db_multi_exec(
818 "UPDATE vfile"
819
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -320,11 +320,11 @@
320320
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
321321
if( file_wd_isdir(zName) == 1 ){
322322
/*TODO(dchest): remove directories? */
323323
fossil_fatal("%s is directory, cannot overwrite\n", zName);
324324
}
325
- checked_symlink_create(file_wd_size(zName)>=0, isLink, file_wd_islink(zName), &content, zName);
325
+ create_symlink_or_file(file_wd_size(zName)>=0, isLink, file_wd_islink(zName), &content, zName);
326326
file_wd_setexe(zName, isExe);
327327
blob_reset(&content);
328328
db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d",
329329
file_wd_mtime(zName), id);
330330
}
331331
--- src/vfile.c
+++ src/vfile.c
@@ -320,11 +320,11 @@
320 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
321 if( file_wd_isdir(zName) == 1 ){
322 /*TODO(dchest): remove directories? */
323 fossil_fatal("%s is directory, cannot overwrite\n", zName);
324 }
325 checked_symlink_create(file_wd_size(zName)>=0, isLink, file_wd_islink(zName), &content, zName);
326 file_wd_setexe(zName, isExe);
327 blob_reset(&content);
328 db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d",
329 file_wd_mtime(zName), id);
330 }
331
--- src/vfile.c
+++ src/vfile.c
@@ -320,11 +320,11 @@
320 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
321 if( file_wd_isdir(zName) == 1 ){
322 /*TODO(dchest): remove directories? */
323 fossil_fatal("%s is directory, cannot overwrite\n", zName);
324 }
325 create_symlink_or_file(file_wd_size(zName)>=0, isLink, file_wd_islink(zName), &content, zName);
326 file_wd_setexe(zName, isExe);
327 blob_reset(&content);
328 db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d",
329 file_wd_mtime(zName), id);
330 }
331

Keyboard Shortcuts

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