Fossil SCM
Since "allow-symlinks" is already ON by default on non-unix platforms (since fossil 1.35 already), no need to do anything special during GIT/SVN import.
Commit
f21820f4abbeada7af373a6dd02f3fa3f6c5d88b6ea93858d825d5b3d8964b58
Parent
cc65959b0fd62b4…
2 files changed
+1
-1
+2
-9
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2859,11 +2859,11 @@ | ||
| 2859 | 2859 | ** |
| 2860 | 2860 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2861 | 2861 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2862 | 2862 | ** (existing links in repository created on Unix become |
| 2863 | 2863 | ** plain-text files with link destination path inside). |
| 2864 | -** Default: off | |
| 2864 | +** Default: on (Unix), off (Windows) | |
| 2865 | 2865 | ** |
| 2866 | 2866 | ** auto-captcha If enabled, the Login page provides a button to |
| 2867 | 2867 | ** fill in the captcha password. Default: on |
| 2868 | 2868 | ** |
| 2869 | 2869 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2870 | 2870 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2859,11 +2859,11 @@ | |
| 2859 | ** |
| 2860 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2861 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2862 | ** (existing links in repository created on Unix become |
| 2863 | ** plain-text files with link destination path inside). |
| 2864 | ** Default: off |
| 2865 | ** |
| 2866 | ** auto-captcha If enabled, the Login page provides a button to |
| 2867 | ** fill in the captcha password. Default: on |
| 2868 | ** |
| 2869 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2870 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2859,11 +2859,11 @@ | |
| 2859 | ** |
| 2860 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2861 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2862 | ** (existing links in repository created on Unix become |
| 2863 | ** plain-text files with link destination path inside). |
| 2864 | ** Default: on (Unix), off (Windows) |
| 2865 | ** |
| 2866 | ** auto-captcha If enabled, the Login page provides a button to |
| 2867 | ** fill in the captcha password. Default: on |
| 2868 | ** |
| 2869 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2870 |
+2
-9
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -69,11 +69,10 @@ | ||
| 69 | 69 | char **azMerge; /* Merge values */ |
| 70 | 70 | int nFile; /* Number of aFile values */ |
| 71 | 71 | int nFileAlloc; /* Number of slots in aFile[] */ |
| 72 | 72 | ImportFile *aFile; /* Information about files in a commit */ |
| 73 | 73 | int fromLoaded; /* True zFrom content loaded into aFile[] */ |
| 74 | - int hasLinks; /* True if git repository contains symlinks */ | |
| 75 | 74 | int tagCommit; /* True if the commit adds a tag */ |
| 76 | 75 | } gg; |
| 77 | 76 | |
| 78 | 77 | /* |
| 79 | 78 | ** Duplicate a string. |
| @@ -273,11 +272,10 @@ | ||
| 273 | 272 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 274 | 273 | if( gg.aFile[i].isExe ){ |
| 275 | 274 | blob_append(&record, " x\n", 3); |
| 276 | 275 | }else if( gg.aFile[i].isLink ){ |
| 277 | 276 | blob_append(&record, " l\n", 3); |
| 278 | - gg.hasLinks = 1; | |
| 279 | 277 | }else{ |
| 280 | 278 | blob_append(&record, "\n", 1); |
| 281 | 279 | } |
| 282 | 280 | } |
| 283 | 281 | if( gg.zFrom ){ |
| @@ -748,13 +746,10 @@ | ||
| 748 | 746 | { |
| 749 | 747 | goto malformed_line; |
| 750 | 748 | } |
| 751 | 749 | } |
| 752 | 750 | gg.xFinish(); |
| 753 | - if( gg.hasLinks ){ | |
| 754 | - db_set_int("allow-symlinks", 1, 0); | |
| 755 | - } | |
| 756 | 751 | import_reset(1); |
| 757 | 752 | return; |
| 758 | 753 | |
| 759 | 754 | malformed_line: |
| 760 | 755 | trim_newline(zLine); |
| @@ -1255,13 +1250,12 @@ | ||
| 1255 | 1250 | return branchId; |
| 1256 | 1251 | } |
| 1257 | 1252 | |
| 1258 | 1253 | /* |
| 1259 | 1254 | ** Insert content of corresponding content blob into the database. |
| 1260 | -** If content is identified as a symbolic link then: | |
| 1261 | -** 1)Trailing "link " characters are removed from content. | |
| 1262 | -** 2)Repository "allow-symlinks" setting is activated. | |
| 1255 | +** If content is identified as a symbolic link, then trailing | |
| 1256 | +** "link " characters are removed from content. | |
| 1263 | 1257 | ** |
| 1264 | 1258 | ** content is considered to be a symlink if zPerm contains at least |
| 1265 | 1259 | ** one "l" character. |
| 1266 | 1260 | */ |
| 1267 | 1261 | static int svn_handle_symlinks(const char *perms, Blob *content){ |
| @@ -1269,11 +1263,10 @@ | ||
| 1269 | 1263 | if( perms && strstr(perms, "l")!=0 ){ |
| 1270 | 1264 | if( blob_size(content)>5 ){ |
| 1271 | 1265 | /* Skip trailing 'link ' characters */ |
| 1272 | 1266 | blob_seek(content, 5, BLOB_SEEK_SET); |
| 1273 | 1267 | blob_tail(content, &link_blob); |
| 1274 | - db_set_int("allow-symlinks", 1, 0); | |
| 1275 | 1268 | return content_put(&link_blob); |
| 1276 | 1269 | }else{ |
| 1277 | 1270 | fossil_fatal("Too short symbolic link path"); |
| 1278 | 1271 | } |
| 1279 | 1272 | }else{ |
| 1280 | 1273 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -69,11 +69,10 @@ | |
| 69 | char **azMerge; /* Merge values */ |
| 70 | int nFile; /* Number of aFile values */ |
| 71 | int nFileAlloc; /* Number of slots in aFile[] */ |
| 72 | ImportFile *aFile; /* Information about files in a commit */ |
| 73 | int fromLoaded; /* True zFrom content loaded into aFile[] */ |
| 74 | int hasLinks; /* True if git repository contains symlinks */ |
| 75 | int tagCommit; /* True if the commit adds a tag */ |
| 76 | } gg; |
| 77 | |
| 78 | /* |
| 79 | ** Duplicate a string. |
| @@ -273,11 +272,10 @@ | |
| 273 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 274 | if( gg.aFile[i].isExe ){ |
| 275 | blob_append(&record, " x\n", 3); |
| 276 | }else if( gg.aFile[i].isLink ){ |
| 277 | blob_append(&record, " l\n", 3); |
| 278 | gg.hasLinks = 1; |
| 279 | }else{ |
| 280 | blob_append(&record, "\n", 1); |
| 281 | } |
| 282 | } |
| 283 | if( gg.zFrom ){ |
| @@ -748,13 +746,10 @@ | |
| 748 | { |
| 749 | goto malformed_line; |
| 750 | } |
| 751 | } |
| 752 | gg.xFinish(); |
| 753 | if( gg.hasLinks ){ |
| 754 | db_set_int("allow-symlinks", 1, 0); |
| 755 | } |
| 756 | import_reset(1); |
| 757 | return; |
| 758 | |
| 759 | malformed_line: |
| 760 | trim_newline(zLine); |
| @@ -1255,13 +1250,12 @@ | |
| 1255 | return branchId; |
| 1256 | } |
| 1257 | |
| 1258 | /* |
| 1259 | ** Insert content of corresponding content blob into the database. |
| 1260 | ** If content is identified as a symbolic link then: |
| 1261 | ** 1)Trailing "link " characters are removed from content. |
| 1262 | ** 2)Repository "allow-symlinks" setting is activated. |
| 1263 | ** |
| 1264 | ** content is considered to be a symlink if zPerm contains at least |
| 1265 | ** one "l" character. |
| 1266 | */ |
| 1267 | static int svn_handle_symlinks(const char *perms, Blob *content){ |
| @@ -1269,11 +1263,10 @@ | |
| 1269 | if( perms && strstr(perms, "l")!=0 ){ |
| 1270 | if( blob_size(content)>5 ){ |
| 1271 | /* Skip trailing 'link ' characters */ |
| 1272 | blob_seek(content, 5, BLOB_SEEK_SET); |
| 1273 | blob_tail(content, &link_blob); |
| 1274 | db_set_int("allow-symlinks", 1, 0); |
| 1275 | return content_put(&link_blob); |
| 1276 | }else{ |
| 1277 | fossil_fatal("Too short symbolic link path"); |
| 1278 | } |
| 1279 | }else{ |
| 1280 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -69,11 +69,10 @@ | |
| 69 | char **azMerge; /* Merge values */ |
| 70 | int nFile; /* Number of aFile values */ |
| 71 | int nFileAlloc; /* Number of slots in aFile[] */ |
| 72 | ImportFile *aFile; /* Information about files in a commit */ |
| 73 | int fromLoaded; /* True zFrom content loaded into aFile[] */ |
| 74 | int tagCommit; /* True if the commit adds a tag */ |
| 75 | } gg; |
| 76 | |
| 77 | /* |
| 78 | ** Duplicate a string. |
| @@ -273,11 +272,10 @@ | |
| 272 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 273 | if( gg.aFile[i].isExe ){ |
| 274 | blob_append(&record, " x\n", 3); |
| 275 | }else if( gg.aFile[i].isLink ){ |
| 276 | blob_append(&record, " l\n", 3); |
| 277 | }else{ |
| 278 | blob_append(&record, "\n", 1); |
| 279 | } |
| 280 | } |
| 281 | if( gg.zFrom ){ |
| @@ -748,13 +746,10 @@ | |
| 746 | { |
| 747 | goto malformed_line; |
| 748 | } |
| 749 | } |
| 750 | gg.xFinish(); |
| 751 | import_reset(1); |
| 752 | return; |
| 753 | |
| 754 | malformed_line: |
| 755 | trim_newline(zLine); |
| @@ -1255,13 +1250,12 @@ | |
| 1250 | return branchId; |
| 1251 | } |
| 1252 | |
| 1253 | /* |
| 1254 | ** Insert content of corresponding content blob into the database. |
| 1255 | ** If content is identified as a symbolic link, then trailing |
| 1256 | ** "link " characters are removed from content. |
| 1257 | ** |
| 1258 | ** content is considered to be a symlink if zPerm contains at least |
| 1259 | ** one "l" character. |
| 1260 | */ |
| 1261 | static int svn_handle_symlinks(const char *perms, Blob *content){ |
| @@ -1269,11 +1263,10 @@ | |
| 1263 | if( perms && strstr(perms, "l")!=0 ){ |
| 1264 | if( blob_size(content)>5 ){ |
| 1265 | /* Skip trailing 'link ' characters */ |
| 1266 | blob_seek(content, 5, BLOB_SEEK_SET); |
| 1267 | blob_tail(content, &link_blob); |
| 1268 | return content_put(&link_blob); |
| 1269 | }else{ |
| 1270 | fossil_fatal("Too short symbolic link path"); |
| 1271 | } |
| 1272 | }else{ |
| 1273 |