Fossil SCM
(cherry-pick): Fixes to SVN import received from Christophe Gouiran (bechris13250 at gmail)
Commit
dec3383ed428203f28f1740bd6592962158ddbf68d28805d0c6ab468520a8336
Parent
c6a20403c642554…
12 files changed
+1
-1
+1
-1
+43
-9
+43
-9
+1
-1
+1
-1
+2
-3
+2
-3
+1
-1
+1
-1
+1
-1
+1
-1
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2855,11 +2855,11 @@ | ||
| 2855 | 2855 | ** |
| 2856 | 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | 2858 | ** (existing links in repository created on Unix become |
| 2859 | 2859 | ** plain-text files with link destination path inside). |
| 2860 | -** Default: off | |
| 2860 | +** Default: on | |
| 2861 | 2861 | ** |
| 2862 | 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | 2863 | ** fill in the captcha password. Default: on |
| 2864 | 2864 | ** |
| 2865 | 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 | 2866 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2855,11 +2855,11 @@ | |
| 2855 | ** |
| 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | ** (existing links in repository created on Unix become |
| 2859 | ** plain-text files with link destination path inside). |
| 2860 | ** Default: off |
| 2861 | ** |
| 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | ** fill in the captcha password. Default: on |
| 2864 | ** |
| 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2855,11 +2855,11 @@ | |
| 2855 | ** |
| 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | ** (existing links in repository created on Unix become |
| 2859 | ** plain-text files with link destination path inside). |
| 2860 | ** Default: on |
| 2861 | ** |
| 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | ** fill in the captcha password. Default: on |
| 2864 | ** |
| 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2855,11 +2855,11 @@ | ||
| 2855 | 2855 | ** |
| 2856 | 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | 2858 | ** (existing links in repository created on Unix become |
| 2859 | 2859 | ** plain-text files with link destination path inside). |
| 2860 | -** Default: off | |
| 2860 | +** Default: on | |
| 2861 | 2861 | ** |
| 2862 | 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | 2863 | ** fill in the captcha password. Default: on |
| 2864 | 2864 | ** |
| 2865 | 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 | 2866 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2855,11 +2855,11 @@ | |
| 2855 | ** |
| 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | ** (existing links in repository created on Unix become |
| 2859 | ** plain-text files with link destination path inside). |
| 2860 | ** Default: off |
| 2861 | ** |
| 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | ** fill in the captcha password. Default: on |
| 2864 | ** |
| 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2855,11 +2855,11 @@ | |
| 2855 | ** |
| 2856 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2857 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2858 | ** (existing links in repository created on Unix become |
| 2859 | ** plain-text files with link destination path inside). |
| 2860 | ** Default: on |
| 2861 | ** |
| 2862 | ** auto-captcha If enabled, the Login page provides a button to |
| 2863 | ** fill in the captcha password. Default: on |
| 2864 | ** |
| 2865 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2866 |
+43
-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); |
| @@ -1252,10 +1247,34 @@ | ||
| 1252 | 1247 | branchId = db_last_insert_rowid(); |
| 1253 | 1248 | } |
| 1254 | 1249 | } |
| 1255 | 1250 | return branchId; |
| 1256 | 1251 | } |
| 1252 | + | |
| 1253 | +/* | |
| 1254 | +** Insert content of corresponding content blob into the database. | |
| 1255 | +** If content is identified as a symbolic link then: | |
| 1256 | +** 1)Trailing "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){ | |
| 1262 | + Blob link_blob; | |
| 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 | + return content_put(content); | |
| 1274 | + } | |
| 1275 | +} | |
| 1257 | 1276 | |
| 1258 | 1277 | /* |
| 1259 | 1278 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1260 | 1279 | ** content into the database. |
| 1261 | 1280 | */ |
| @@ -1351,10 +1370,13 @@ | ||
| 1351 | 1370 | int branchType; |
| 1352 | 1371 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1353 | 1372 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1354 | 1373 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1355 | 1374 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1375 | + if ( zPerm==0 ){ | |
| 1376 | + zPerm = svn_find_prop(rec, "svn:special") ? "l" : 0; | |
| 1377 | + } | |
| 1356 | 1378 | int deltaFlag = 0; |
| 1357 | 1379 | int srcRev = 0; |
| 1358 | 1380 | if( branchId==0 ){ |
| 1359 | 1381 | svn_free_rec(&rec); |
| 1360 | 1382 | continue; |
| @@ -1464,13 +1486,19 @@ | ||
| 1464 | 1486 | content_get(rid, &deltaSrc); |
| 1465 | 1487 | }else{ |
| 1466 | 1488 | blob_zero(&deltaSrc); |
| 1467 | 1489 | } |
| 1468 | 1490 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1469 | - rid = content_put(&target); | |
| 1491 | + rid = svn_handle_symlinks(zPerm, &target); | |
| 1470 | 1492 | }else if( rec.contentFlag ){ |
| 1471 | - rid = content_put(&rec.content); | |
| 1493 | + rid = svn_handle_symlinks(zPerm, &rec.content); | |
| 1494 | + }else if( zSrcPath ){ | |
| 1495 | + if ( zPerm==0 ){ | |
| 1496 | + zPerm = db_text(0, "SELECT tperm FROM xfiles" | |
| 1497 | + " WHERE tpath=%Q AND tbranch=%d" | |
| 1498 | + "", zSrcPath, branchId); | |
| 1499 | + } | |
| 1472 | 1500 | } |
| 1473 | 1501 | db_bind_text(&addFile, ":path", zFile); |
| 1474 | 1502 | db_bind_int(&addFile, ":branch", branchId); |
| 1475 | 1503 | db_bind_int(&addFile, ":rid", rid); |
| 1476 | 1504 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | ||
| 1485 | 1513 | int rid = 0; |
| 1486 | 1514 | if( zKind==0 ){ |
| 1487 | 1515 | fossil_fatal("Missing Node-kind"); |
| 1488 | 1516 | } |
| 1489 | 1517 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1518 | + if ( zPerm==0 ){ | |
| 1519 | + zPerm = db_text(0, "SELECT tperm FROM xfiles" | |
| 1520 | + " WHERE tpath=%Q AND tbranch=%d" | |
| 1521 | + "", zFile, branchId); | |
| 1522 | + } | |
| 1523 | + | |
| 1490 | 1524 | if( deltaFlag ){ |
| 1491 | 1525 | Blob deltaSrc; |
| 1492 | 1526 | Blob target; |
| 1493 | 1527 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1494 | 1528 | " SELECT tuuid FROM xfiles" |
| 1495 | 1529 | " WHERE tpath=%Q AND tbranch=%d" |
| 1496 | 1530 | ")", zFile, branchId); |
| 1497 | 1531 | content_get(rid, &deltaSrc); |
| 1498 | 1532 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1499 | - rid = content_put(&target); | |
| 1533 | + rid = svn_handle_symlinks(zPerm, &target); | |
| 1500 | 1534 | }else{ |
| 1501 | - rid = content_put(&rec.content); | |
| 1535 | + rid = svn_handle_symlinks(zPerm, &rec.content); | |
| 1502 | 1536 | } |
| 1503 | 1537 | db_bind_text(&addFile, ":path", zFile); |
| 1504 | 1538 | db_bind_int(&addFile, ":branch", branchId); |
| 1505 | 1539 | db_bind_int(&addFile, ":rid", rid); |
| 1506 | 1540 | db_bind_text(&addFile, ":perm", zPerm); |
| 1507 | 1541 |
| --- 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); |
| @@ -1252,10 +1247,34 @@ | |
| 1252 | branchId = db_last_insert_rowid(); |
| 1253 | } |
| 1254 | } |
| 1255 | return branchId; |
| 1256 | } |
| 1257 | |
| 1258 | /* |
| 1259 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1260 | ** content into the database. |
| 1261 | */ |
| @@ -1351,10 +1370,13 @@ | |
| 1351 | int branchType; |
| 1352 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1353 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1354 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1355 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1356 | int deltaFlag = 0; |
| 1357 | int srcRev = 0; |
| 1358 | if( branchId==0 ){ |
| 1359 | svn_free_rec(&rec); |
| 1360 | continue; |
| @@ -1464,13 +1486,19 @@ | |
| 1464 | content_get(rid, &deltaSrc); |
| 1465 | }else{ |
| 1466 | blob_zero(&deltaSrc); |
| 1467 | } |
| 1468 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1469 | rid = content_put(&target); |
| 1470 | }else if( rec.contentFlag ){ |
| 1471 | rid = content_put(&rec.content); |
| 1472 | } |
| 1473 | db_bind_text(&addFile, ":path", zFile); |
| 1474 | db_bind_int(&addFile, ":branch", branchId); |
| 1475 | db_bind_int(&addFile, ":rid", rid); |
| 1476 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | |
| 1485 | int rid = 0; |
| 1486 | if( zKind==0 ){ |
| 1487 | fossil_fatal("Missing Node-kind"); |
| 1488 | } |
| 1489 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1490 | if( deltaFlag ){ |
| 1491 | Blob deltaSrc; |
| 1492 | Blob target; |
| 1493 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1494 | " SELECT tuuid FROM xfiles" |
| 1495 | " WHERE tpath=%Q AND tbranch=%d" |
| 1496 | ")", zFile, branchId); |
| 1497 | content_get(rid, &deltaSrc); |
| 1498 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1499 | rid = content_put(&target); |
| 1500 | }else{ |
| 1501 | rid = content_put(&rec.content); |
| 1502 | } |
| 1503 | db_bind_text(&addFile, ":path", zFile); |
| 1504 | db_bind_int(&addFile, ":branch", branchId); |
| 1505 | db_bind_int(&addFile, ":rid", rid); |
| 1506 | db_bind_text(&addFile, ":perm", zPerm); |
| 1507 |
| --- 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); |
| @@ -1252,10 +1247,34 @@ | |
| 1247 | branchId = db_last_insert_rowid(); |
| 1248 | } |
| 1249 | } |
| 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: |
| 1256 | ** 1)Trailing "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){ |
| 1262 | Blob link_blob; |
| 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 | return content_put(content); |
| 1274 | } |
| 1275 | } |
| 1276 | |
| 1277 | /* |
| 1278 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1279 | ** content into the database. |
| 1280 | */ |
| @@ -1351,10 +1370,13 @@ | |
| 1370 | int branchType; |
| 1371 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1372 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1373 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1374 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1375 | if ( zPerm==0 ){ |
| 1376 | zPerm = svn_find_prop(rec, "svn:special") ? "l" : 0; |
| 1377 | } |
| 1378 | int deltaFlag = 0; |
| 1379 | int srcRev = 0; |
| 1380 | if( branchId==0 ){ |
| 1381 | svn_free_rec(&rec); |
| 1382 | continue; |
| @@ -1464,13 +1486,19 @@ | |
| 1486 | content_get(rid, &deltaSrc); |
| 1487 | }else{ |
| 1488 | blob_zero(&deltaSrc); |
| 1489 | } |
| 1490 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1491 | rid = svn_handle_symlinks(zPerm, &target); |
| 1492 | }else if( rec.contentFlag ){ |
| 1493 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1494 | }else if( zSrcPath ){ |
| 1495 | if ( zPerm==0 ){ |
| 1496 | zPerm = db_text(0, "SELECT tperm FROM xfiles" |
| 1497 | " WHERE tpath=%Q AND tbranch=%d" |
| 1498 | "", zSrcPath, branchId); |
| 1499 | } |
| 1500 | } |
| 1501 | db_bind_text(&addFile, ":path", zFile); |
| 1502 | db_bind_int(&addFile, ":branch", branchId); |
| 1503 | db_bind_int(&addFile, ":rid", rid); |
| 1504 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | |
| 1513 | int rid = 0; |
| 1514 | if( zKind==0 ){ |
| 1515 | fossil_fatal("Missing Node-kind"); |
| 1516 | } |
| 1517 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1518 | if ( zPerm==0 ){ |
| 1519 | zPerm = db_text(0, "SELECT tperm FROM xfiles" |
| 1520 | " WHERE tpath=%Q AND tbranch=%d" |
| 1521 | "", zFile, branchId); |
| 1522 | } |
| 1523 | |
| 1524 | if( deltaFlag ){ |
| 1525 | Blob deltaSrc; |
| 1526 | Blob target; |
| 1527 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1528 | " SELECT tuuid FROM xfiles" |
| 1529 | " WHERE tpath=%Q AND tbranch=%d" |
| 1530 | ")", zFile, branchId); |
| 1531 | content_get(rid, &deltaSrc); |
| 1532 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1533 | rid = svn_handle_symlinks(zPerm, &target); |
| 1534 | }else{ |
| 1535 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1536 | } |
| 1537 | db_bind_text(&addFile, ":path", zFile); |
| 1538 | db_bind_int(&addFile, ":branch", branchId); |
| 1539 | db_bind_int(&addFile, ":rid", rid); |
| 1540 | db_bind_text(&addFile, ":perm", zPerm); |
| 1541 |
+43
-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); |
| @@ -1252,10 +1247,34 @@ | ||
| 1252 | 1247 | branchId = db_last_insert_rowid(); |
| 1253 | 1248 | } |
| 1254 | 1249 | } |
| 1255 | 1250 | return branchId; |
| 1256 | 1251 | } |
| 1252 | + | |
| 1253 | +/* | |
| 1254 | +** Insert content of corresponding content blob into the database. | |
| 1255 | +** If content is identified as a symbolic link then: | |
| 1256 | +** 1)Trailing "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){ | |
| 1262 | + Blob link_blob; | |
| 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 | + return content_put(content); | |
| 1274 | + } | |
| 1275 | +} | |
| 1257 | 1276 | |
| 1258 | 1277 | /* |
| 1259 | 1278 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1260 | 1279 | ** content into the database. |
| 1261 | 1280 | */ |
| @@ -1351,10 +1370,13 @@ | ||
| 1351 | 1370 | int branchType; |
| 1352 | 1371 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1353 | 1372 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1354 | 1373 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1355 | 1374 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1375 | + if ( zPerm==0 ){ | |
| 1376 | + zPerm = svn_find_prop(rec, "svn:special") ? "l" : 0; | |
| 1377 | + } | |
| 1356 | 1378 | int deltaFlag = 0; |
| 1357 | 1379 | int srcRev = 0; |
| 1358 | 1380 | if( branchId==0 ){ |
| 1359 | 1381 | svn_free_rec(&rec); |
| 1360 | 1382 | continue; |
| @@ -1464,13 +1486,19 @@ | ||
| 1464 | 1486 | content_get(rid, &deltaSrc); |
| 1465 | 1487 | }else{ |
| 1466 | 1488 | blob_zero(&deltaSrc); |
| 1467 | 1489 | } |
| 1468 | 1490 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1469 | - rid = content_put(&target); | |
| 1491 | + rid = svn_handle_symlinks(zPerm, &target); | |
| 1470 | 1492 | }else if( rec.contentFlag ){ |
| 1471 | - rid = content_put(&rec.content); | |
| 1493 | + rid = svn_handle_symlinks(zPerm, &rec.content); | |
| 1494 | + }else if( zSrcPath ){ | |
| 1495 | + if ( zPerm==0 ){ | |
| 1496 | + zPerm = db_text(0, "SELECT tperm FROM xfiles" | |
| 1497 | + " WHERE tpath=%Q AND tbranch=%d" | |
| 1498 | + "", zSrcPath, branchId); | |
| 1499 | + } | |
| 1472 | 1500 | } |
| 1473 | 1501 | db_bind_text(&addFile, ":path", zFile); |
| 1474 | 1502 | db_bind_int(&addFile, ":branch", branchId); |
| 1475 | 1503 | db_bind_int(&addFile, ":rid", rid); |
| 1476 | 1504 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | ||
| 1485 | 1513 | int rid = 0; |
| 1486 | 1514 | if( zKind==0 ){ |
| 1487 | 1515 | fossil_fatal("Missing Node-kind"); |
| 1488 | 1516 | } |
| 1489 | 1517 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1518 | + if ( zPerm==0 ){ | |
| 1519 | + zPerm = db_text(0, "SELECT tperm FROM xfiles" | |
| 1520 | + " WHERE tpath=%Q AND tbranch=%d" | |
| 1521 | + "", zFile, branchId); | |
| 1522 | + } | |
| 1523 | + | |
| 1490 | 1524 | if( deltaFlag ){ |
| 1491 | 1525 | Blob deltaSrc; |
| 1492 | 1526 | Blob target; |
| 1493 | 1527 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1494 | 1528 | " SELECT tuuid FROM xfiles" |
| 1495 | 1529 | " WHERE tpath=%Q AND tbranch=%d" |
| 1496 | 1530 | ")", zFile, branchId); |
| 1497 | 1531 | content_get(rid, &deltaSrc); |
| 1498 | 1532 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1499 | - rid = content_put(&target); | |
| 1533 | + rid = svn_handle_symlinks(zPerm, &target); | |
| 1500 | 1534 | }else{ |
| 1501 | - rid = content_put(&rec.content); | |
| 1535 | + rid = svn_handle_symlinks(zPerm, &rec.content); | |
| 1502 | 1536 | } |
| 1503 | 1537 | db_bind_text(&addFile, ":path", zFile); |
| 1504 | 1538 | db_bind_int(&addFile, ":branch", branchId); |
| 1505 | 1539 | db_bind_int(&addFile, ":rid", rid); |
| 1506 | 1540 | db_bind_text(&addFile, ":perm", zPerm); |
| 1507 | 1541 |
| --- 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); |
| @@ -1252,10 +1247,34 @@ | |
| 1252 | branchId = db_last_insert_rowid(); |
| 1253 | } |
| 1254 | } |
| 1255 | return branchId; |
| 1256 | } |
| 1257 | |
| 1258 | /* |
| 1259 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1260 | ** content into the database. |
| 1261 | */ |
| @@ -1351,10 +1370,13 @@ | |
| 1351 | int branchType; |
| 1352 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1353 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1354 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1355 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1356 | int deltaFlag = 0; |
| 1357 | int srcRev = 0; |
| 1358 | if( branchId==0 ){ |
| 1359 | svn_free_rec(&rec); |
| 1360 | continue; |
| @@ -1464,13 +1486,19 @@ | |
| 1464 | content_get(rid, &deltaSrc); |
| 1465 | }else{ |
| 1466 | blob_zero(&deltaSrc); |
| 1467 | } |
| 1468 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1469 | rid = content_put(&target); |
| 1470 | }else if( rec.contentFlag ){ |
| 1471 | rid = content_put(&rec.content); |
| 1472 | } |
| 1473 | db_bind_text(&addFile, ":path", zFile); |
| 1474 | db_bind_int(&addFile, ":branch", branchId); |
| 1475 | db_bind_int(&addFile, ":rid", rid); |
| 1476 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | |
| 1485 | int rid = 0; |
| 1486 | if( zKind==0 ){ |
| 1487 | fossil_fatal("Missing Node-kind"); |
| 1488 | } |
| 1489 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1490 | if( deltaFlag ){ |
| 1491 | Blob deltaSrc; |
| 1492 | Blob target; |
| 1493 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1494 | " SELECT tuuid FROM xfiles" |
| 1495 | " WHERE tpath=%Q AND tbranch=%d" |
| 1496 | ")", zFile, branchId); |
| 1497 | content_get(rid, &deltaSrc); |
| 1498 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1499 | rid = content_put(&target); |
| 1500 | }else{ |
| 1501 | rid = content_put(&rec.content); |
| 1502 | } |
| 1503 | db_bind_text(&addFile, ":path", zFile); |
| 1504 | db_bind_int(&addFile, ":branch", branchId); |
| 1505 | db_bind_int(&addFile, ":rid", rid); |
| 1506 | db_bind_text(&addFile, ":perm", zPerm); |
| 1507 |
| --- 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); |
| @@ -1252,10 +1247,34 @@ | |
| 1247 | branchId = db_last_insert_rowid(); |
| 1248 | } |
| 1249 | } |
| 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: |
| 1256 | ** 1)Trailing "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){ |
| 1262 | Blob link_blob; |
| 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 | return content_put(content); |
| 1274 | } |
| 1275 | } |
| 1276 | |
| 1277 | /* |
| 1278 | ** Read the svn-dump format from pIn and insert the corresponding |
| 1279 | ** content into the database. |
| 1280 | */ |
| @@ -1351,10 +1370,13 @@ | |
| 1370 | int branchType; |
| 1371 | int branchId = svn_parse_path(zTemp, &zFile, &branchType); |
| 1372 | char *zAction = svn_find_header(rec, "Node-action"); |
| 1373 | char *zKind = svn_find_header(rec, "Node-kind"); |
| 1374 | char *zPerm = svn_find_prop(rec, "svn:executable") ? "x" : 0; |
| 1375 | if ( zPerm==0 ){ |
| 1376 | zPerm = svn_find_prop(rec, "svn:special") ? "l" : 0; |
| 1377 | } |
| 1378 | int deltaFlag = 0; |
| 1379 | int srcRev = 0; |
| 1380 | if( branchId==0 ){ |
| 1381 | svn_free_rec(&rec); |
| 1382 | continue; |
| @@ -1464,13 +1486,19 @@ | |
| 1486 | content_get(rid, &deltaSrc); |
| 1487 | }else{ |
| 1488 | blob_zero(&deltaSrc); |
| 1489 | } |
| 1490 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1491 | rid = svn_handle_symlinks(zPerm, &target); |
| 1492 | }else if( rec.contentFlag ){ |
| 1493 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1494 | }else if( zSrcPath ){ |
| 1495 | if ( zPerm==0 ){ |
| 1496 | zPerm = db_text(0, "SELECT tperm FROM xfiles" |
| 1497 | " WHERE tpath=%Q AND tbranch=%d" |
| 1498 | "", zSrcPath, branchId); |
| 1499 | } |
| 1500 | } |
| 1501 | db_bind_text(&addFile, ":path", zFile); |
| 1502 | db_bind_int(&addFile, ":branch", branchId); |
| 1503 | db_bind_int(&addFile, ":rid", rid); |
| 1504 | db_bind_text(&addFile, ":perm", zPerm); |
| @@ -1485,22 +1513,28 @@ | |
| 1513 | int rid = 0; |
| 1514 | if( zKind==0 ){ |
| 1515 | fossil_fatal("Missing Node-kind"); |
| 1516 | } |
| 1517 | if( rec.contentFlag && strncmp(zKind, "dir", 3)!=0 ){ |
| 1518 | if ( zPerm==0 ){ |
| 1519 | zPerm = db_text(0, "SELECT tperm FROM xfiles" |
| 1520 | " WHERE tpath=%Q AND tbranch=%d" |
| 1521 | "", zFile, branchId); |
| 1522 | } |
| 1523 | |
| 1524 | if( deltaFlag ){ |
| 1525 | Blob deltaSrc; |
| 1526 | Blob target; |
| 1527 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=(" |
| 1528 | " SELECT tuuid FROM xfiles" |
| 1529 | " WHERE tpath=%Q AND tbranch=%d" |
| 1530 | ")", zFile, branchId); |
| 1531 | content_get(rid, &deltaSrc); |
| 1532 | svn_apply_svndiff(&rec.content, &deltaSrc, &target); |
| 1533 | rid = svn_handle_symlinks(zPerm, &target); |
| 1534 | }else{ |
| 1535 | rid = svn_handle_symlinks(zPerm, &rec.content); |
| 1536 | } |
| 1537 | db_bind_text(&addFile, ":path", zFile); |
| 1538 | db_bind_int(&addFile, ":branch", branchId); |
| 1539 | db_bind_int(&addFile, ":rid", rid); |
| 1540 | db_bind_text(&addFile, ":perm", zPerm); |
| 1541 |
+1
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -728,11 +728,11 @@ | ||
| 728 | 728 | # run on the target platform. This is usually the almost the same |
| 729 | 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | 731 | # for building intermediate code-generator tools. |
| 732 | 732 | # |
| 733 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 733 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 734 | 734 | |
| 735 | 735 | #### Add the necessary command line options to build with debugging |
| 736 | 736 | # symbols, if enabled. |
| 737 | 737 | # |
| 738 | 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 | 739 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -728,11 +728,11 @@ | |
| 728 | # run on the target platform. This is usually the almost the same |
| 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | # for building intermediate code-generator tools. |
| 732 | # |
| 733 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 734 | |
| 735 | #### Add the necessary command line options to build with debugging |
| 736 | # symbols, if enabled. |
| 737 | # |
| 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -728,11 +728,11 @@ | |
| 728 | # run on the target platform. This is usually the almost the same |
| 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | # for building intermediate code-generator tools. |
| 732 | # |
| 733 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 734 | |
| 735 | #### Add the necessary command line options to build with debugging |
| 736 | # symbols, if enabled. |
| 737 | # |
| 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 |
+1
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -728,11 +728,11 @@ | ||
| 728 | 728 | # run on the target platform. This is usually the almost the same |
| 729 | 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | 731 | # for building intermediate code-generator tools. |
| 732 | 732 | # |
| 733 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 733 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 734 | 734 | |
| 735 | 735 | #### Add the necessary command line options to build with debugging |
| 736 | 736 | # symbols, if enabled. |
| 737 | 737 | # |
| 738 | 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 | 739 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -728,11 +728,11 @@ | |
| 728 | # run on the target platform. This is usually the almost the same |
| 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | # for building intermediate code-generator tools. |
| 732 | # |
| 733 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 734 | |
| 735 | #### Add the necessary command line options to build with debugging |
| 736 | # symbols, if enabled. |
| 737 | # |
| 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -728,11 +728,11 @@ | |
| 728 | # run on the target platform. This is usually the almost the same |
| 729 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 730 | # the finished binary for fossil. The BCC compiler above is used |
| 731 | # for building intermediate code-generator tools. |
| 732 | # |
| 733 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 734 | |
| 735 | #### Add the necessary command line options to build with debugging |
| 736 | # symbols, if enabled. |
| 737 | # |
| 738 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 739 |
+2
-3
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -2924,11 +2924,10 @@ | ||
| 2924 | 2924 | if( i>nCol ){ |
| 2925 | 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | 2928 | ** tables will fail this last check */ |
| 2929 | - int rc; | |
| 2930 | 2929 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2931 | 2930 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2932 | 2931 | break; |
| 2933 | 2932 | } |
| 2934 | 2933 | } |
| @@ -2957,18 +2956,18 @@ | ||
| 2957 | 2956 | ** This is a different callback routine used for dumping the database. |
| 2958 | 2957 | ** Each row received by this callback consists of a table name, |
| 2959 | 2958 | ** the table type ("index" or "table") and SQL to create the table. |
| 2960 | 2959 | ** This routine should print text sufficient to recreate the table. |
| 2961 | 2960 | */ |
| 2962 | -static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ | |
| 2961 | +static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ | |
| 2963 | 2962 | int rc; |
| 2964 | 2963 | const char *zTable; |
| 2965 | 2964 | const char *zType; |
| 2966 | 2965 | const char *zSql; |
| 2967 | 2966 | ShellState *p = (ShellState *)pArg; |
| 2968 | 2967 | |
| 2969 | - UNUSED_PARAMETER(azCol); | |
| 2968 | + UNUSED_PARAMETER(azNotUsed); | |
| 2970 | 2969 | if( nArg!=3 ) return 1; |
| 2971 | 2970 | zTable = azArg[0]; |
| 2972 | 2971 | zType = azArg[1]; |
| 2973 | 2972 | zSql = azArg[2]; |
| 2974 | 2973 | |
| 2975 | 2974 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -2924,11 +2924,10 @@ | |
| 2924 | if( i>nCol ){ |
| 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | ** tables will fail this last check */ |
| 2929 | int rc; |
| 2930 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2931 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2932 | break; |
| 2933 | } |
| 2934 | } |
| @@ -2957,18 +2956,18 @@ | |
| 2957 | ** This is a different callback routine used for dumping the database. |
| 2958 | ** Each row received by this callback consists of a table name, |
| 2959 | ** the table type ("index" or "table") and SQL to create the table. |
| 2960 | ** This routine should print text sufficient to recreate the table. |
| 2961 | */ |
| 2962 | static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ |
| 2963 | int rc; |
| 2964 | const char *zTable; |
| 2965 | const char *zType; |
| 2966 | const char *zSql; |
| 2967 | ShellState *p = (ShellState *)pArg; |
| 2968 | |
| 2969 | UNUSED_PARAMETER(azCol); |
| 2970 | if( nArg!=3 ) return 1; |
| 2971 | zTable = azArg[0]; |
| 2972 | zType = azArg[1]; |
| 2973 | zSql = azArg[2]; |
| 2974 | |
| 2975 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -2924,11 +2924,10 @@ | |
| 2924 | if( i>nCol ){ |
| 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | ** tables will fail this last check */ |
| 2929 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2930 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2931 | break; |
| 2932 | } |
| 2933 | } |
| @@ -2957,18 +2956,18 @@ | |
| 2956 | ** This is a different callback routine used for dumping the database. |
| 2957 | ** Each row received by this callback consists of a table name, |
| 2958 | ** the table type ("index" or "table") and SQL to create the table. |
| 2959 | ** This routine should print text sufficient to recreate the table. |
| 2960 | */ |
| 2961 | static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ |
| 2962 | int rc; |
| 2963 | const char *zTable; |
| 2964 | const char *zType; |
| 2965 | const char *zSql; |
| 2966 | ShellState *p = (ShellState *)pArg; |
| 2967 | |
| 2968 | UNUSED_PARAMETER(azNotUsed); |
| 2969 | if( nArg!=3 ) return 1; |
| 2970 | zTable = azArg[0]; |
| 2971 | zType = azArg[1]; |
| 2972 | zSql = azArg[2]; |
| 2973 | |
| 2974 |
+2
-3
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -2924,11 +2924,10 @@ | ||
| 2924 | 2924 | if( i>nCol ){ |
| 2925 | 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | 2928 | ** tables will fail this last check */ |
| 2929 | - int rc; | |
| 2930 | 2929 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2931 | 2930 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2932 | 2931 | break; |
| 2933 | 2932 | } |
| 2934 | 2933 | } |
| @@ -2957,18 +2956,18 @@ | ||
| 2957 | 2956 | ** This is a different callback routine used for dumping the database. |
| 2958 | 2957 | ** Each row received by this callback consists of a table name, |
| 2959 | 2958 | ** the table type ("index" or "table") and SQL to create the table. |
| 2960 | 2959 | ** This routine should print text sufficient to recreate the table. |
| 2961 | 2960 | */ |
| 2962 | -static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ | |
| 2961 | +static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ | |
| 2963 | 2962 | int rc; |
| 2964 | 2963 | const char *zTable; |
| 2965 | 2964 | const char *zType; |
| 2966 | 2965 | const char *zSql; |
| 2967 | 2966 | ShellState *p = (ShellState *)pArg; |
| 2968 | 2967 | |
| 2969 | - UNUSED_PARAMETER(azCol); | |
| 2968 | + UNUSED_PARAMETER(azNotUsed); | |
| 2970 | 2969 | if( nArg!=3 ) return 1; |
| 2971 | 2970 | zTable = azArg[0]; |
| 2972 | 2971 | zType = azArg[1]; |
| 2973 | 2972 | zSql = azArg[2]; |
| 2974 | 2973 | |
| 2975 | 2974 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -2924,11 +2924,10 @@ | |
| 2924 | if( i>nCol ){ |
| 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | ** tables will fail this last check */ |
| 2929 | int rc; |
| 2930 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2931 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2932 | break; |
| 2933 | } |
| 2934 | } |
| @@ -2957,18 +2956,18 @@ | |
| 2957 | ** This is a different callback routine used for dumping the database. |
| 2958 | ** Each row received by this callback consists of a table name, |
| 2959 | ** the table type ("index" or "table") and SQL to create the table. |
| 2960 | ** This routine should print text sufficient to recreate the table. |
| 2961 | */ |
| 2962 | static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ |
| 2963 | int rc; |
| 2964 | const char *zTable; |
| 2965 | const char *zType; |
| 2966 | const char *zSql; |
| 2967 | ShellState *p = (ShellState *)pArg; |
| 2968 | |
| 2969 | UNUSED_PARAMETER(azCol); |
| 2970 | if( nArg!=3 ) return 1; |
| 2971 | zTable = azArg[0]; |
| 2972 | zType = azArg[1]; |
| 2973 | zSql = azArg[2]; |
| 2974 | |
| 2975 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -2924,11 +2924,10 @@ | |
| 2924 | if( i>nCol ){ |
| 2925 | /* At this point, we know that azRowid[j] is not the name of any |
| 2926 | ** ordinary column in the table. Verify that azRowid[j] is a valid |
| 2927 | ** name for the rowid before adding it to azCol[0]. WITHOUT ROWID |
| 2928 | ** tables will fail this last check */ |
| 2929 | rc = sqlite3_table_column_metadata(p->db,0,zTab,azRowid[j],0,0,0,0,0); |
| 2930 | if( rc==SQLITE_OK ) azCol[0] = azRowid[j]; |
| 2931 | break; |
| 2932 | } |
| 2933 | } |
| @@ -2957,18 +2956,18 @@ | |
| 2956 | ** This is a different callback routine used for dumping the database. |
| 2957 | ** Each row received by this callback consists of a table name, |
| 2958 | ** the table type ("index" or "table") and SQL to create the table. |
| 2959 | ** This routine should print text sufficient to recreate the table. |
| 2960 | */ |
| 2961 | static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ |
| 2962 | int rc; |
| 2963 | const char *zTable; |
| 2964 | const char *zType; |
| 2965 | const char *zSql; |
| 2966 | ShellState *p = (ShellState *)pArg; |
| 2967 | |
| 2968 | UNUSED_PARAMETER(azNotUsed); |
| 2969 | if( nArg!=3 ) return 1; |
| 2970 | zTable = azArg[0]; |
| 2971 | zType = azArg[1]; |
| 2972 | zSql = azArg[2]; |
| 2973 | |
| 2974 |
+1
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -225,11 +225,11 @@ | ||
| 225 | 225 | # run on the target platform. This is usually the almost the same |
| 226 | 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | 228 | # for building intermediate code-generator tools. |
| 229 | 229 | # |
| 230 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 230 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 231 | 231 | |
| 232 | 232 | #### Add the necessary command line options to build with debugging |
| 233 | 233 | # symbols, if enabled. |
| 234 | 234 | # |
| 235 | 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 | 236 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
+1
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -225,11 +225,11 @@ | ||
| 225 | 225 | # run on the target platform. This is usually the almost the same |
| 226 | 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | 228 | # for building intermediate code-generator tools. |
| 229 | 229 | # |
| 230 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 230 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 231 | 231 | |
| 232 | 232 | #### Add the necessary command line options to build with debugging |
| 233 | 233 | # symbols, if enabled. |
| 234 | 234 | # |
| 235 | 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 | 236 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
+1
-1
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -225,11 +225,11 @@ | ||
| 225 | 225 | # run on the target platform. This is usually the almost the same |
| 226 | 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | 228 | # for building intermediate code-generator tools. |
| 229 | 229 | # |
| 230 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 230 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 231 | 231 | |
| 232 | 232 | #### Add the necessary command line options to build with debugging |
| 233 | 233 | # symbols, if enabled. |
| 234 | 234 | # |
| 235 | 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 | 236 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
+1
-1
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -225,11 +225,11 @@ | ||
| 225 | 225 | # run on the target platform. This is usually the almost the same |
| 226 | 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | 228 | # for building intermediate code-generator tools. |
| 229 | 229 | # |
| 230 | -TCC = $(PREFIX)$(TCCEXE) -Wall | |
| 230 | +TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement | |
| 231 | 231 | |
| 232 | 232 | #### Add the necessary command line options to build with debugging |
| 233 | 233 | # symbols, if enabled. |
| 234 | 234 | # |
| 235 | 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 | 236 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -225,11 +225,11 @@ | |
| 225 | # run on the target platform. This is usually the almost the same |
| 226 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 227 | # the finished binary for fossil. The BCC compiler above is used |
| 228 | # for building intermediate code-generator tools. |
| 229 | # |
| 230 | TCC = $(PREFIX)$(TCCEXE) -Wall -Wdeclaration-after-statement |
| 231 | |
| 232 | #### Add the necessary command line options to build with debugging |
| 233 | # symbols, if enabled. |
| 234 | # |
| 235 | ifdef FOSSIL_ENABLE_SYMBOLS |
| 236 |