Fossil SCM

Make it easier to debug the ZIP web page. Enhance consistency between the Tarball and ZIP web pages.

mistachkin 2016-09-15 04:01 UTC trunk
Commit b94587625384355665121001c0aebf4a01947406
2 files changed +1 -1 +27 -14
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -680,13 +680,13 @@
680680
if( nRid==0 && nName>10 ) zName[10] = 0;
681681
682682
/* Compute a unique key for the cache entry based on query parameters */
683683
blob_init(&cacheKey, 0, 0);
684684
blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
685
+ blob_appendf(&cacheKey, "/%q", zName);
685686
if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
686687
if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
687
- blob_appendf(&cacheKey, "/%q", zName);
688688
zKey = blob_str(&cacheKey);
689689
690690
if( P("debug")!=0 ){
691691
style_header("Tarball Generator Debug Screen");
692692
@ zName = "%h(zName)"<br />
693693
--- src/tar.c
+++ src/tar.c
@@ -680,13 +680,13 @@
680 if( nRid==0 && nName>10 ) zName[10] = 0;
681
682 /* Compute a unique key for the cache entry based on query parameters */
683 blob_init(&cacheKey, 0, 0);
684 blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
 
685 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
686 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
687 blob_appendf(&cacheKey, "/%q", zName);
688 zKey = blob_str(&cacheKey);
689
690 if( P("debug")!=0 ){
691 style_header("Tarball Generator Debug Screen");
692 @ zName = "%h(zName)"<br />
693
--- src/tar.c
+++ src/tar.c
@@ -680,13 +680,13 @@
680 if( nRid==0 && nName>10 ) zName[10] = 0;
681
682 /* Compute a unique key for the cache entry based on query parameters */
683 blob_init(&cacheKey, 0, 0);
684 blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
685 blob_appendf(&cacheKey, "/%q", zName);
686 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
687 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
 
688 zKey = blob_str(&cacheKey);
689
690 if( P("debug")!=0 ){
691 style_header("Tarball Generator Debug Screen");
692 @ zName = "%h(zName)"<br />
693
+27 -14
--- src/zip.c
+++ src/zip.c
@@ -468,11 +468,10 @@
468468
**
469469
** name=NAME[.zip] The base name of the output file. The default
470470
** value is a configuration parameter in the project
471471
** settings. A prefix of the name, omitting the extension,
472472
** is used as the top-most directory name.
473
-
474473
**
475474
** uuid=TAG The check-in that is turned into a ZIP file.
476475
** Defaults to "trunk".
477476
**
478477
** in=PATTERN Only include files that match the comma-separate
@@ -522,10 +521,34 @@
522521
}
523522
rid = name_to_typed_rid(nRid?zRid:zName,"ci");
524523
if( rid==0 ){
525524
@ Not found
526525
return;
526
+ }
527
+ if( nRid==0 && nName>10 ) zName[10] = 0;
528
+
529
+ /* Compute a unique key for the cache entry based on query parameters */
530
+ blob_init(&cacheKey, 0, 0);
531
+ blob_appendf(&cacheKey, "/zip/%z", rid_to_uuid(rid));
532
+ blob_appendf(&cacheKey, "/%q", zName);
533
+ if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
534
+ if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
535
+ zKey = blob_str(&cacheKey);
536
+
537
+ if( P("debug")!=0 ){
538
+ style_header("ZIP Archive Generator Debug Screen");
539
+ @ zName = "%h(zName)"<br />
540
+ @ rid = %d(rid)<br />
541
+ if( zInclude ){
542
+ @ zInclude = "%h(zInclude)"<br />
543
+ }
544
+ if( zExclude ){
545
+ @ zExclude = "%h(zExclude)"<br />
546
+ }
547
+ @ zKey = "%h(zKey)"
548
+ style_footer();
549
+ return;
527550
}
528551
if( referred_from_login() ){
529552
style_header("ZIP Archive Download");
530553
@ <form action='%R/zip/%h(zName).zip'>
531554
cgi_query_parameters_to_hidden();
@@ -534,28 +557,18 @@
534557
@ <input type="submit" value="Download" />
535558
@ </form>
536559
style_footer();
537560
return;
538561
}
539
- if( nRid==0 && nName>10 ) zName[10] = 0;
540
-
541
- /* Compute a unique key for the cache entry based on query parameters */
542
- blob_init(&cacheKey, 0, 0);
543
- blob_appendf(&cacheKey, "/zip/%z", rid_to_uuid(rid));
544
- if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
545
- if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
546
- blob_appendf(&cacheKey, "/%q", zName);
547
- zKey = blob_str(&cacheKey);
548
-
549562
blob_zero(&zip);
550563
if( cache_read(&zip, zKey)==0 ){
551564
zip_of_checkin(rid, &zip, zName, pInclude, pExclude);
552565
cache_write(&zip, zKey);
553566
}
554
- fossil_free( zName );
555
- fossil_free( zRid );
556
- blob_reset(&cacheKey);
557567
glob_free(pInclude);
558568
glob_free(pExclude);
569
+ fossil_free(zName);
570
+ fossil_free(zRid);
571
+ blob_reset(&cacheKey);
559572
cgi_set_content(&zip);
560573
cgi_set_content_type("application/zip");
561574
}
562575
--- src/zip.c
+++ src/zip.c
@@ -468,11 +468,10 @@
468 **
469 ** name=NAME[.zip] The base name of the output file. The default
470 ** value is a configuration parameter in the project
471 ** settings. A prefix of the name, omitting the extension,
472 ** is used as the top-most directory name.
473
474 **
475 ** uuid=TAG The check-in that is turned into a ZIP file.
476 ** Defaults to "trunk".
477 **
478 ** in=PATTERN Only include files that match the comma-separate
@@ -522,10 +521,34 @@
522 }
523 rid = name_to_typed_rid(nRid?zRid:zName,"ci");
524 if( rid==0 ){
525 @ Not found
526 return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527 }
528 if( referred_from_login() ){
529 style_header("ZIP Archive Download");
530 @ <form action='%R/zip/%h(zName).zip'>
531 cgi_query_parameters_to_hidden();
@@ -534,28 +557,18 @@
534 @ <input type="submit" value="Download" />
535 @ </form>
536 style_footer();
537 return;
538 }
539 if( nRid==0 && nName>10 ) zName[10] = 0;
540
541 /* Compute a unique key for the cache entry based on query parameters */
542 blob_init(&cacheKey, 0, 0);
543 blob_appendf(&cacheKey, "/zip/%z", rid_to_uuid(rid));
544 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
545 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
546 blob_appendf(&cacheKey, "/%q", zName);
547 zKey = blob_str(&cacheKey);
548
549 blob_zero(&zip);
550 if( cache_read(&zip, zKey)==0 ){
551 zip_of_checkin(rid, &zip, zName, pInclude, pExclude);
552 cache_write(&zip, zKey);
553 }
554 fossil_free( zName );
555 fossil_free( zRid );
556 blob_reset(&cacheKey);
557 glob_free(pInclude);
558 glob_free(pExclude);
 
 
 
559 cgi_set_content(&zip);
560 cgi_set_content_type("application/zip");
561 }
562
--- src/zip.c
+++ src/zip.c
@@ -468,11 +468,10 @@
468 **
469 ** name=NAME[.zip] The base name of the output file. The default
470 ** value is a configuration parameter in the project
471 ** settings. A prefix of the name, omitting the extension,
472 ** is used as the top-most directory name.
 
473 **
474 ** uuid=TAG The check-in that is turned into a ZIP file.
475 ** Defaults to "trunk".
476 **
477 ** in=PATTERN Only include files that match the comma-separate
@@ -522,10 +521,34 @@
521 }
522 rid = name_to_typed_rid(nRid?zRid:zName,"ci");
523 if( rid==0 ){
524 @ Not found
525 return;
526 }
527 if( nRid==0 && nName>10 ) zName[10] = 0;
528
529 /* Compute a unique key for the cache entry based on query parameters */
530 blob_init(&cacheKey, 0, 0);
531 blob_appendf(&cacheKey, "/zip/%z", rid_to_uuid(rid));
532 blob_appendf(&cacheKey, "/%q", zName);
533 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
534 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
535 zKey = blob_str(&cacheKey);
536
537 if( P("debug")!=0 ){
538 style_header("ZIP Archive Generator Debug Screen");
539 @ zName = "%h(zName)"<br />
540 @ rid = %d(rid)<br />
541 if( zInclude ){
542 @ zInclude = "%h(zInclude)"<br />
543 }
544 if( zExclude ){
545 @ zExclude = "%h(zExclude)"<br />
546 }
547 @ zKey = "%h(zKey)"
548 style_footer();
549 return;
550 }
551 if( referred_from_login() ){
552 style_header("ZIP Archive Download");
553 @ <form action='%R/zip/%h(zName).zip'>
554 cgi_query_parameters_to_hidden();
@@ -534,28 +557,18 @@
557 @ <input type="submit" value="Download" />
558 @ </form>
559 style_footer();
560 return;
561 }
 
 
 
 
 
 
 
 
 
 
562 blob_zero(&zip);
563 if( cache_read(&zip, zKey)==0 ){
564 zip_of_checkin(rid, &zip, zName, pInclude, pExclude);
565 cache_write(&zip, zKey);
566 }
 
 
 
567 glob_free(pInclude);
568 glob_free(pExclude);
569 fossil_free(zName);
570 fossil_free(zRid);
571 blob_reset(&cacheKey);
572 cgi_set_content(&zip);
573 cgi_set_content_type("application/zip");
574 }
575

Keyboard Shortcuts

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