Fossil SCM
On the /tarball and /zip pages, use r= as the query parameter to select which check-in to download. The uuid= query parameter is still accepted as an alias for backwards compatibility.
Commit
ece33ee1b6dd14e1cbb79815fee52addc4964a6f7b8d1aed73095f1a6448abbb
Parent
a6993f9bd485cc1…
2 files changed
+11
-4
+12
-4
+11
-4
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -644,11 +644,11 @@ | ||
| 644 | 644 | |
| 645 | 645 | /* |
| 646 | 646 | ** WEBPAGE: tarball |
| 647 | 647 | ** URL: /tarball |
| 648 | 648 | ** |
| 649 | -** Generate a compressed tarball for the check-in specified by the "uuid" | |
| 649 | +** Generate a compressed tarball for the check-in specified by the "r" | |
| 650 | 650 | ** query parameter. Return that compressed tarball as the HTTP reply |
| 651 | 651 | ** content. |
| 652 | 652 | ** |
| 653 | 653 | ** Query parameters: |
| 654 | 654 | ** |
| @@ -655,12 +655,15 @@ | ||
| 655 | 655 | ** name=NAME[.tar.gz] The base name of the output file. The default |
| 656 | 656 | ** value is a configuration parameter in the project |
| 657 | 657 | ** settings. A prefix of the name, omitting the |
| 658 | 658 | ** extension, is used as the top-most directory name. |
| 659 | 659 | ** |
| 660 | -** uuid=TAG The check-in that is turned into a compressed tarball. | |
| 661 | -** Defaults to "trunk". | |
| 660 | +** r=TAG The check-in that is turned into a compressed tarball. | |
| 661 | +** Defaults to "trunk". This query parameter used to | |
| 662 | +** be called "uuid" and "uuid" is still accepted for | |
| 663 | +** backwards compatibility. If omitted, the default | |
| 664 | +** check-in name is "trunk". | |
| 662 | 665 | ** |
| 663 | 666 | ** in=PATTERN Only include files that match the comma-separate |
| 664 | 667 | ** list of GLOB patterns in PATTERN, as with ex= |
| 665 | 668 | ** |
| 666 | 669 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -676,17 +679,21 @@ | ||
| 676 | 679 | const char *zExclude; /* The ex= query parameter */ |
| 677 | 680 | Blob cacheKey; /* The key to cache */ |
| 678 | 681 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 679 | 682 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 680 | 683 | Blob tarball; /* Tarball accumulated here */ |
| 684 | + const char *z; | |
| 681 | 685 | |
| 682 | 686 | login_check_credentials(); |
| 683 | 687 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 684 | 688 | load_control(); |
| 685 | 689 | zName = mprintf("%s", PD("name","")); |
| 686 | 690 | nName = strlen(zName); |
| 687 | - zRid = mprintf("%s", PD("uuid","trunk")); | |
| 691 | + z = P("r"); | |
| 692 | + if( z==0 ) z = P("uuid"); | |
| 693 | + if( z==0 ) z = "trunk"; | |
| 694 | + zRid = fossil_strdup(z); | |
| 688 | 695 | nRid = strlen(zRid); |
| 689 | 696 | zInclude = P("in"); |
| 690 | 697 | if( zInclude ) pInclude = glob_create(zInclude); |
| 691 | 698 | zExclude = P("ex"); |
| 692 | 699 | if( zExclude ) pExclude = glob_create(zExclude); |
| 693 | 700 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -644,11 +644,11 @@ | |
| 644 | |
| 645 | /* |
| 646 | ** WEBPAGE: tarball |
| 647 | ** URL: /tarball |
| 648 | ** |
| 649 | ** Generate a compressed tarball for the check-in specified by the "uuid" |
| 650 | ** query parameter. Return that compressed tarball as the HTTP reply |
| 651 | ** content. |
| 652 | ** |
| 653 | ** Query parameters: |
| 654 | ** |
| @@ -655,12 +655,15 @@ | |
| 655 | ** name=NAME[.tar.gz] The base name of the output file. The default |
| 656 | ** value is a configuration parameter in the project |
| 657 | ** settings. A prefix of the name, omitting the |
| 658 | ** extension, is used as the top-most directory name. |
| 659 | ** |
| 660 | ** uuid=TAG The check-in that is turned into a compressed tarball. |
| 661 | ** Defaults to "trunk". |
| 662 | ** |
| 663 | ** in=PATTERN Only include files that match the comma-separate |
| 664 | ** list of GLOB patterns in PATTERN, as with ex= |
| 665 | ** |
| 666 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -676,17 +679,21 @@ | |
| 676 | const char *zExclude; /* The ex= query parameter */ |
| 677 | Blob cacheKey; /* The key to cache */ |
| 678 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 679 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 680 | Blob tarball; /* Tarball accumulated here */ |
| 681 | |
| 682 | login_check_credentials(); |
| 683 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 684 | load_control(); |
| 685 | zName = mprintf("%s", PD("name","")); |
| 686 | nName = strlen(zName); |
| 687 | zRid = mprintf("%s", PD("uuid","trunk")); |
| 688 | nRid = strlen(zRid); |
| 689 | zInclude = P("in"); |
| 690 | if( zInclude ) pInclude = glob_create(zInclude); |
| 691 | zExclude = P("ex"); |
| 692 | if( zExclude ) pExclude = glob_create(zExclude); |
| 693 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -644,11 +644,11 @@ | |
| 644 | |
| 645 | /* |
| 646 | ** WEBPAGE: tarball |
| 647 | ** URL: /tarball |
| 648 | ** |
| 649 | ** Generate a compressed tarball for the check-in specified by the "r" |
| 650 | ** query parameter. Return that compressed tarball as the HTTP reply |
| 651 | ** content. |
| 652 | ** |
| 653 | ** Query parameters: |
| 654 | ** |
| @@ -655,12 +655,15 @@ | |
| 655 | ** name=NAME[.tar.gz] The base name of the output file. The default |
| 656 | ** value is a configuration parameter in the project |
| 657 | ** settings. A prefix of the name, omitting the |
| 658 | ** extension, is used as the top-most directory name. |
| 659 | ** |
| 660 | ** r=TAG The check-in that is turned into a compressed tarball. |
| 661 | ** Defaults to "trunk". This query parameter used to |
| 662 | ** be called "uuid" and "uuid" is still accepted for |
| 663 | ** backwards compatibility. If omitted, the default |
| 664 | ** check-in name is "trunk". |
| 665 | ** |
| 666 | ** in=PATTERN Only include files that match the comma-separate |
| 667 | ** list of GLOB patterns in PATTERN, as with ex= |
| 668 | ** |
| 669 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -676,17 +679,21 @@ | |
| 679 | const char *zExclude; /* The ex= query parameter */ |
| 680 | Blob cacheKey; /* The key to cache */ |
| 681 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 682 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 683 | Blob tarball; /* Tarball accumulated here */ |
| 684 | const char *z; |
| 685 | |
| 686 | login_check_credentials(); |
| 687 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 688 | load_control(); |
| 689 | zName = mprintf("%s", PD("name","")); |
| 690 | nName = strlen(zName); |
| 691 | z = P("r"); |
| 692 | if( z==0 ) z = P("uuid"); |
| 693 | if( z==0 ) z = "trunk"; |
| 694 | zRid = fossil_strdup(z); |
| 695 | nRid = strlen(zRid); |
| 696 | zInclude = P("in"); |
| 697 | if( zInclude ) pInclude = glob_create(zInclude); |
| 698 | zExclude = P("ex"); |
| 699 | if( zExclude ) pExclude = glob_create(zExclude); |
| 700 |
+12
-4
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -500,22 +500,26 @@ | ||
| 500 | 500 | |
| 501 | 501 | /* |
| 502 | 502 | ** WEBPAGE: zip |
| 503 | 503 | ** URL: /zip |
| 504 | 504 | ** |
| 505 | -** Generate a ZIP archive for the check-in specified by the "uuid" | |
| 505 | +** Generate a ZIP archive for the check-in specified by the "r" | |
| 506 | 506 | ** query parameter. Return that ZIP archive as the HTTP reply content. |
| 507 | 507 | ** |
| 508 | 508 | ** Query parameters: |
| 509 | 509 | ** |
| 510 | 510 | ** name=NAME[.zip] The base name of the output file. The default |
| 511 | 511 | ** value is a configuration parameter in the project |
| 512 | 512 | ** settings. A prefix of the name, omitting the |
| 513 | 513 | ** extension, is used as the top-most directory name. |
| 514 | 514 | ** |
| 515 | -** uuid=TAG The check-in that is turned into a ZIP archive. | |
| 516 | -** Defaults to "trunk". | |
| 515 | +** r=TAG The check-in that is turned into a ZIP archive. | |
| 516 | +** Defaults to "trunk". This query parameter used to | |
| 517 | +** be called "uuid" and the older "uuid" name is still | |
| 518 | +** accepted for backwards compatibility. If this | |
| 519 | +** query paramater is omitted, the latest "trunk" | |
| 520 | +** check-in is used. | |
| 517 | 521 | ** |
| 518 | 522 | ** in=PATTERN Only include files that match the comma-separate |
| 519 | 523 | ** list of GLOB patterns in PATTERN, as with ex= |
| 520 | 524 | ** |
| 521 | 525 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -523,10 +527,11 @@ | ||
| 523 | 527 | ** pattern can optionally be quoted using ".." or '..'. |
| 524 | 528 | ** Any file matching both ex= and in= is excluded. |
| 525 | 529 | */ |
| 526 | 530 | void baseline_zip_page(void){ |
| 527 | 531 | int rid; |
| 532 | + const char *z; | |
| 528 | 533 | char *zName, *zRid, *zKey; |
| 529 | 534 | int nName, nRid; |
| 530 | 535 | const char *zInclude; /* The in= query parameter */ |
| 531 | 536 | const char *zExclude; /* The ex= query parameter */ |
| 532 | 537 | Blob cacheKey; /* The key to cache */ |
| @@ -537,11 +542,14 @@ | ||
| 537 | 542 | login_check_credentials(); |
| 538 | 543 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 539 | 544 | load_control(); |
| 540 | 545 | zName = mprintf("%s", PD("name","")); |
| 541 | 546 | nName = strlen(zName); |
| 542 | - zRid = mprintf("%s", PD("uuid","trunk")); | |
| 547 | + z = P("r"); | |
| 548 | + if( z==0 ) z = P("uuid"); | |
| 549 | + if( z==0 ) z = "trunk"; | |
| 550 | + zRid = fossil_strdup(z); | |
| 543 | 551 | nRid = strlen(zRid); |
| 544 | 552 | zInclude = P("in"); |
| 545 | 553 | if( zInclude ) pInclude = glob_create(zInclude); |
| 546 | 554 | zExclude = P("ex"); |
| 547 | 555 | if( zExclude ) pExclude = glob_create(zExclude); |
| 548 | 556 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -500,22 +500,26 @@ | |
| 500 | |
| 501 | /* |
| 502 | ** WEBPAGE: zip |
| 503 | ** URL: /zip |
| 504 | ** |
| 505 | ** Generate a ZIP archive for the check-in specified by the "uuid" |
| 506 | ** query parameter. Return that ZIP archive as the HTTP reply content. |
| 507 | ** |
| 508 | ** Query parameters: |
| 509 | ** |
| 510 | ** name=NAME[.zip] The base name of the output file. The default |
| 511 | ** value is a configuration parameter in the project |
| 512 | ** settings. A prefix of the name, omitting the |
| 513 | ** extension, is used as the top-most directory name. |
| 514 | ** |
| 515 | ** uuid=TAG The check-in that is turned into a ZIP archive. |
| 516 | ** Defaults to "trunk". |
| 517 | ** |
| 518 | ** in=PATTERN Only include files that match the comma-separate |
| 519 | ** list of GLOB patterns in PATTERN, as with ex= |
| 520 | ** |
| 521 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -523,10 +527,11 @@ | |
| 523 | ** pattern can optionally be quoted using ".." or '..'. |
| 524 | ** Any file matching both ex= and in= is excluded. |
| 525 | */ |
| 526 | void baseline_zip_page(void){ |
| 527 | int rid; |
| 528 | char *zName, *zRid, *zKey; |
| 529 | int nName, nRid; |
| 530 | const char *zInclude; /* The in= query parameter */ |
| 531 | const char *zExclude; /* The ex= query parameter */ |
| 532 | Blob cacheKey; /* The key to cache */ |
| @@ -537,11 +542,14 @@ | |
| 537 | login_check_credentials(); |
| 538 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 539 | load_control(); |
| 540 | zName = mprintf("%s", PD("name","")); |
| 541 | nName = strlen(zName); |
| 542 | zRid = mprintf("%s", PD("uuid","trunk")); |
| 543 | nRid = strlen(zRid); |
| 544 | zInclude = P("in"); |
| 545 | if( zInclude ) pInclude = glob_create(zInclude); |
| 546 | zExclude = P("ex"); |
| 547 | if( zExclude ) pExclude = glob_create(zExclude); |
| 548 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -500,22 +500,26 @@ | |
| 500 | |
| 501 | /* |
| 502 | ** WEBPAGE: zip |
| 503 | ** URL: /zip |
| 504 | ** |
| 505 | ** Generate a ZIP archive for the check-in specified by the "r" |
| 506 | ** query parameter. Return that ZIP archive as the HTTP reply content. |
| 507 | ** |
| 508 | ** Query parameters: |
| 509 | ** |
| 510 | ** name=NAME[.zip] The base name of the output file. The default |
| 511 | ** value is a configuration parameter in the project |
| 512 | ** settings. A prefix of the name, omitting the |
| 513 | ** extension, is used as the top-most directory name. |
| 514 | ** |
| 515 | ** r=TAG The check-in that is turned into a ZIP archive. |
| 516 | ** Defaults to "trunk". This query parameter used to |
| 517 | ** be called "uuid" and the older "uuid" name is still |
| 518 | ** accepted for backwards compatibility. If this |
| 519 | ** query paramater is omitted, the latest "trunk" |
| 520 | ** check-in is used. |
| 521 | ** |
| 522 | ** in=PATTERN Only include files that match the comma-separate |
| 523 | ** list of GLOB patterns in PATTERN, as with ex= |
| 524 | ** |
| 525 | ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a |
| @@ -523,10 +527,11 @@ | |
| 527 | ** pattern can optionally be quoted using ".." or '..'. |
| 528 | ** Any file matching both ex= and in= is excluded. |
| 529 | */ |
| 530 | void baseline_zip_page(void){ |
| 531 | int rid; |
| 532 | const char *z; |
| 533 | char *zName, *zRid, *zKey; |
| 534 | int nName, nRid; |
| 535 | const char *zInclude; /* The in= query parameter */ |
| 536 | const char *zExclude; /* The ex= query parameter */ |
| 537 | Blob cacheKey; /* The key to cache */ |
| @@ -537,11 +542,14 @@ | |
| 542 | login_check_credentials(); |
| 543 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 544 | load_control(); |
| 545 | zName = mprintf("%s", PD("name","")); |
| 546 | nName = strlen(zName); |
| 547 | z = P("r"); |
| 548 | if( z==0 ) z = P("uuid"); |
| 549 | if( z==0 ) z = "trunk"; |
| 550 | zRid = fossil_strdup(z); |
| 551 | nRid = strlen(zRid); |
| 552 | zInclude = P("in"); |
| 553 | if( zInclude ) pInclude = glob_create(zInclude); |
| 554 | zExclude = P("ex"); |
| 555 | if( zExclude ) pExclude = glob_create(zExclude); |
| 556 |