Fossil SCM
Improved comments and extra abuse defense.
Commit
a1f420c6c6f8087ff0db093278e3bd6979739c3fee7aa1364b803ff6aff3a13c
Parent
9a767601780a077…
1 file changed
+16
-1
+16
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -457,10 +457,14 @@ | ||
| 457 | 457 | ** Options: |
| 458 | 458 | ** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ." |
| 459 | 459 | ** to extract into the local directory. |
| 460 | 460 | ** |
| 461 | 461 | ** -f|--force Overwrite existing files |
| 462 | +** | |
| 463 | +** --list List all the files that would have been checked | |
| 464 | +** out but do not actually write anything to the | |
| 465 | +** filesystem. | |
| 462 | 466 | ** |
| 463 | 467 | ** --sqlar ARCHIVE Store the check-out in an SQL-archive rather |
| 464 | 468 | ** than unpacking them into separate files. |
| 465 | 469 | ** |
| 466 | 470 | ** -v|--verbose Show all files as they are extracted |
| @@ -524,10 +528,21 @@ | ||
| 524 | 528 | if( bDebug ){ |
| 525 | 529 | fossil_print("dest = %s\n", zDest); |
| 526 | 530 | } |
| 527 | 531 | |
| 528 | 532 | /* Error checking */ |
| 533 | + if( zDest!=file_tail(zDest) ){ | |
| 534 | + fossil_fatal("--dest must be a simple directory name, not a path"); | |
| 535 | + } | |
| 536 | + if( zVers!=file_tail(zVers) ){ | |
| 537 | + fossil_fatal("The \"fossil get\" command does not current work with" | |
| 538 | + " version names that contain \"/\". This will be fixed in" | |
| 539 | + " a future release."); | |
| 540 | + } | |
| 541 | + /* To relax the restrictions above, change the subpath URL formula below | |
| 542 | + ** to use query parameters. Ex: /sqlar?r=%t&name=%t */ | |
| 543 | + | |
| 529 | 544 | if( !forceFlag ){ |
| 530 | 545 | if( zSqlArchive ){ |
| 531 | 546 | if( file_isdir(zSqlArchive, ExtFILE)>0 ){ |
| 532 | 547 | fossil_fatal("file already exists: \"%s\"", zSqlArchive); |
| 533 | 548 | } |
| @@ -542,11 +557,11 @@ | ||
| 542 | 557 | } |
| 543 | 558 | } |
| 544 | 559 | |
| 545 | 560 | /* Construct a subpath on the URL if necessary */ |
| 546 | 561 | if( g.url.isSsh || g.url.isFile ){ |
| 547 | - g.url.subpath = mprintf("/sqlar?r=%t&name=%t.sqlar", zVers, zDest); | |
| 562 | + g.url.subpath = mprintf("/sqlar/%t/%t.sqlar", zVers, zDest); | |
| 548 | 563 | } |
| 549 | 564 | |
| 550 | 565 | if( bDebug ){ |
| 551 | 566 | urlparse_print(0); |
| 552 | 567 | } |
| 553 | 568 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -457,10 +457,14 @@ | |
| 457 | ** Options: |
| 458 | ** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ." |
| 459 | ** to extract into the local directory. |
| 460 | ** |
| 461 | ** -f|--force Overwrite existing files |
| 462 | ** |
| 463 | ** --sqlar ARCHIVE Store the check-out in an SQL-archive rather |
| 464 | ** than unpacking them into separate files. |
| 465 | ** |
| 466 | ** -v|--verbose Show all files as they are extracted |
| @@ -524,10 +528,21 @@ | |
| 524 | if( bDebug ){ |
| 525 | fossil_print("dest = %s\n", zDest); |
| 526 | } |
| 527 | |
| 528 | /* Error checking */ |
| 529 | if( !forceFlag ){ |
| 530 | if( zSqlArchive ){ |
| 531 | if( file_isdir(zSqlArchive, ExtFILE)>0 ){ |
| 532 | fossil_fatal("file already exists: \"%s\"", zSqlArchive); |
| 533 | } |
| @@ -542,11 +557,11 @@ | |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | /* Construct a subpath on the URL if necessary */ |
| 546 | if( g.url.isSsh || g.url.isFile ){ |
| 547 | g.url.subpath = mprintf("/sqlar?r=%t&name=%t.sqlar", zVers, zDest); |
| 548 | } |
| 549 | |
| 550 | if( bDebug ){ |
| 551 | urlparse_print(0); |
| 552 | } |
| 553 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -457,10 +457,14 @@ | |
| 457 | ** Options: |
| 458 | ** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ." |
| 459 | ** to extract into the local directory. |
| 460 | ** |
| 461 | ** -f|--force Overwrite existing files |
| 462 | ** |
| 463 | ** --list List all the files that would have been checked |
| 464 | ** out but do not actually write anything to the |
| 465 | ** filesystem. |
| 466 | ** |
| 467 | ** --sqlar ARCHIVE Store the check-out in an SQL-archive rather |
| 468 | ** than unpacking them into separate files. |
| 469 | ** |
| 470 | ** -v|--verbose Show all files as they are extracted |
| @@ -524,10 +528,21 @@ | |
| 528 | if( bDebug ){ |
| 529 | fossil_print("dest = %s\n", zDest); |
| 530 | } |
| 531 | |
| 532 | /* Error checking */ |
| 533 | if( zDest!=file_tail(zDest) ){ |
| 534 | fossil_fatal("--dest must be a simple directory name, not a path"); |
| 535 | } |
| 536 | if( zVers!=file_tail(zVers) ){ |
| 537 | fossil_fatal("The \"fossil get\" command does not current work with" |
| 538 | " version names that contain \"/\". This will be fixed in" |
| 539 | " a future release."); |
| 540 | } |
| 541 | /* To relax the restrictions above, change the subpath URL formula below |
| 542 | ** to use query parameters. Ex: /sqlar?r=%t&name=%t */ |
| 543 | |
| 544 | if( !forceFlag ){ |
| 545 | if( zSqlArchive ){ |
| 546 | if( file_isdir(zSqlArchive, ExtFILE)>0 ){ |
| 547 | fossil_fatal("file already exists: \"%s\"", zSqlArchive); |
| 548 | } |
| @@ -542,11 +557,11 @@ | |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | /* Construct a subpath on the URL if necessary */ |
| 561 | if( g.url.isSsh || g.url.isFile ){ |
| 562 | g.url.subpath = mprintf("/sqlar/%t/%t.sqlar", zVers, zDest); |
| 563 | } |
| 564 | |
| 565 | if( bDebug ){ |
| 566 | urlparse_print(0); |
| 567 | } |
| 568 |