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.

drh 2017-03-15 18:34 trunk
Commit ece33ee1b6dd14e1cbb79815fee52addc4964a6f7b8d1aed73095f1a6448abbb
2 files changed +11 -4 +12 -4
+11 -4
--- src/tar.c
+++ src/tar.c
@@ -644,11 +644,11 @@
644644
645645
/*
646646
** WEBPAGE: tarball
647647
** URL: /tarball
648648
**
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"
650650
** query parameter. Return that compressed tarball as the HTTP reply
651651
** content.
652652
**
653653
** Query parameters:
654654
**
@@ -655,12 +655,15 @@
655655
** name=NAME[.tar.gz] The base name of the output file. The default
656656
** value is a configuration parameter in the project
657657
** settings. A prefix of the name, omitting the
658658
** extension, is used as the top-most directory name.
659659
**
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".
662665
**
663666
** in=PATTERN Only include files that match the comma-separate
664667
** list of GLOB patterns in PATTERN, as with ex=
665668
**
666669
** ex=PATTERN Omit any file that match PATTERN. PATTERN is a
@@ -676,17 +679,21 @@
676679
const char *zExclude; /* The ex= query parameter */
677680
Blob cacheKey; /* The key to cache */
678681
Glob *pInclude = 0; /* The compiled in= glob pattern */
679682
Glob *pExclude = 0; /* The compiled ex= glob pattern */
680683
Blob tarball; /* Tarball accumulated here */
684
+ const char *z;
681685
682686
login_check_credentials();
683687
if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
684688
load_control();
685689
zName = mprintf("%s", PD("name",""));
686690
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);
688695
nRid = strlen(zRid);
689696
zInclude = P("in");
690697
if( zInclude ) pInclude = glob_create(zInclude);
691698
zExclude = P("ex");
692699
if( zExclude ) pExclude = glob_create(zExclude);
693700
--- 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 @@
500500
501501
/*
502502
** WEBPAGE: zip
503503
** URL: /zip
504504
**
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"
506506
** query parameter. Return that ZIP archive as the HTTP reply content.
507507
**
508508
** Query parameters:
509509
**
510510
** name=NAME[.zip] The base name of the output file. The default
511511
** value is a configuration parameter in the project
512512
** settings. A prefix of the name, omitting the
513513
** extension, is used as the top-most directory name.
514514
**
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.
517521
**
518522
** in=PATTERN Only include files that match the comma-separate
519523
** list of GLOB patterns in PATTERN, as with ex=
520524
**
521525
** ex=PATTERN Omit any file that match PATTERN. PATTERN is a
@@ -523,10 +527,11 @@
523527
** pattern can optionally be quoted using ".." or '..'.
524528
** Any file matching both ex= and in= is excluded.
525529
*/
526530
void baseline_zip_page(void){
527531
int rid;
532
+ const char *z;
528533
char *zName, *zRid, *zKey;
529534
int nName, nRid;
530535
const char *zInclude; /* The in= query parameter */
531536
const char *zExclude; /* The ex= query parameter */
532537
Blob cacheKey; /* The key to cache */
@@ -537,11 +542,14 @@
537542
login_check_credentials();
538543
if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
539544
load_control();
540545
zName = mprintf("%s", PD("name",""));
541546
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);
543551
nRid = strlen(zRid);
544552
zInclude = P("in");
545553
if( zInclude ) pInclude = glob_create(zInclude);
546554
zExclude = P("ex");
547555
if( zExclude ) pExclude = glob_create(zExclude);
548556
--- 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

Keyboard Shortcuts

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