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.

jan.nijtmans 2017-03-22 16:42 trunk
Commit f21820f4abbeada7af373a6dd02f3fa3f6c5d88b6ea93858d825d5b3d8964b58
2 files changed +1 -1 +2 -9
+1 -1
--- src/db.c
+++ src/db.c
@@ -2859,11 +2859,11 @@
28592859
**
28602860
** allow-symlinks If enabled, don't follow symlinks, and instead treat
28612861
** (versionable) them as symlinks on Unix. Has no effect on Windows
28622862
** (existing links in repository created on Unix become
28632863
** plain-text files with link destination path inside).
2864
-** Default: off
2864
+** Default: on (Unix), off (Windows)
28652865
**
28662866
** auto-captcha If enabled, the Login page provides a button to
28672867
** fill in the captcha password. Default: on
28682868
**
28692869
** auto-hyperlink Use javascript to enable hyperlinks on web pages
28702870
--- 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 @@
6969
char **azMerge; /* Merge values */
7070
int nFile; /* Number of aFile values */
7171
int nFileAlloc; /* Number of slots in aFile[] */
7272
ImportFile *aFile; /* Information about files in a commit */
7373
int fromLoaded; /* True zFrom content loaded into aFile[] */
74
- int hasLinks; /* True if git repository contains symlinks */
7574
int tagCommit; /* True if the commit adds a tag */
7675
} gg;
7776
7877
/*
7978
** Duplicate a string.
@@ -273,11 +272,10 @@
273272
blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid);
274273
if( gg.aFile[i].isExe ){
275274
blob_append(&record, " x\n", 3);
276275
}else if( gg.aFile[i].isLink ){
277276
blob_append(&record, " l\n", 3);
278
- gg.hasLinks = 1;
279277
}else{
280278
blob_append(&record, "\n", 1);
281279
}
282280
}
283281
if( gg.zFrom ){
@@ -748,13 +746,10 @@
748746
{
749747
goto malformed_line;
750748
}
751749
}
752750
gg.xFinish();
753
- if( gg.hasLinks ){
754
- db_set_int("allow-symlinks", 1, 0);
755
- }
756751
import_reset(1);
757752
return;
758753
759754
malformed_line:
760755
trim_newline(zLine);
@@ -1255,13 +1250,12 @@
12551250
return branchId;
12561251
}
12571252
12581253
/*
12591254
** 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.
12631257
**
12641258
** content is considered to be a symlink if zPerm contains at least
12651259
** one "l" character.
12661260
*/
12671261
static int svn_handle_symlinks(const char *perms, Blob *content){
@@ -1269,11 +1263,10 @@
12691263
if( perms && strstr(perms, "l")!=0 ){
12701264
if( blob_size(content)>5 ){
12711265
/* Skip trailing 'link ' characters */
12721266
blob_seek(content, 5, BLOB_SEEK_SET);
12731267
blob_tail(content, &link_blob);
1274
- db_set_int("allow-symlinks", 1, 0);
12751268
return content_put(&link_blob);
12761269
}else{
12771270
fossil_fatal("Too short symbolic link path");
12781271
}
12791272
}else{
12801273
--- 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

Keyboard Shortcuts

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