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).
Commit
31b0a9d737c6417a946c52a014975267c5bf983a
Parent
2d3ff7bd23b1703…
5 files changed
+4
-4
+1
-1
+1
-1
+1
-1
+1
-1
+4
-4
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -242,17 +242,17 @@ | ||
| 242 | 242 | blob_write_to_file(&content, zLinkFile); |
| 243 | 243 | blob_reset(&content); |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 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)) | |
| 249 | 249 | link_delete(zName); |
| 250 | 250 | if (needLink) |
| 251 | - symlink_create(blog_str(blob), zName); | |
| 251 | + symlink_create(blob_str(blob), zName); | |
| 252 | 252 | else |
| 253 | - blog_write_to_file(blob, zName); | |
| 253 | + blob_write_to_file(blob, zName); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /* |
| 257 | 257 | ** Copy symbolic link from zFrom to zTo. |
| 258 | 258 | */ |
| 259 | 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 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 @@ | ||
| 241 | 241 | blob_read_from_file(&disk, zOPath); |
| 242 | 242 | } |
| 243 | 243 | content_get(rid, &a); |
| 244 | 244 | blob_delta_apply(&a, &delta, &b); |
| 245 | 245 | 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); | |
| 247 | 247 | file_wd_setexe(zNPath, isExec); |
| 248 | 248 | fossil_print("UPDATE %s\n", zNew); |
| 249 | 249 | }else{ |
| 250 | 250 | int rc; |
| 251 | 251 | if( isLink || isNewLink ){ |
| 252 | 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 | 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 @@ | ||
| 70 | 70 | if( new_exists ){ |
| 71 | 71 | fossil_print("%s %s\n", redoFlag ? "REDO" : "UNDO", zPathname); |
| 72 | 72 | }else{ |
| 73 | 73 | fossil_print("NEW %s\n", zPathname); |
| 74 | 74 | } |
| 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); | |
| 76 | 76 | file_wd_setexe(zFullname, old_exe); |
| 77 | 77 | }else{ |
| 78 | 78 | fossil_print("DELETE %s\n", zPathname); |
| 79 | 79 | file_delete(zFullname); |
| 80 | 80 | } |
| 81 | 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 | 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 @@ | ||
| 808 | 808 | zFile, zFile |
| 809 | 809 | ); |
| 810 | 810 | }else{ |
| 811 | 811 | sqlite3_int64 mtime; |
| 812 | 812 | 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); | |
| 814 | 814 | file_wd_setexe(zFull, isExe); |
| 815 | 815 | fossil_print("REVERTED: %s\n", zFile); |
| 816 | 816 | mtime = file_wd_mtime(zFull); |
| 817 | 817 | db_multi_exec( |
| 818 | 818 | "UPDATE vfile" |
| 819 | 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 | 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 @@ | ||
| 320 | 320 | if( verbose ) fossil_print("%s\n", &zName[nRepos]); |
| 321 | 321 | if( file_wd_isdir(zName) == 1 ){ |
| 322 | 322 | /*TODO(dchest): remove directories? */ |
| 323 | 323 | fossil_fatal("%s is directory, cannot overwrite\n", zName); |
| 324 | 324 | } |
| 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); | |
| 326 | 326 | file_wd_setexe(zName, isExe); |
| 327 | 327 | blob_reset(&content); |
| 328 | 328 | db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d", |
| 329 | 329 | file_wd_mtime(zName), id); |
| 330 | 330 | } |
| 331 | 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 | 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 |