Fossil SCM

Better descriptions of raw artifacts on the "artifact" URL.

drh 2009-08-29 18:47 trunk
Commit ee544f4843b0d176492a689d839cb79860495517
1 file changed +19 -18
+19 -18
--- src/info.c
+++ src/info.c
@@ -627,11 +627,11 @@
627627
){
628628
Stmt q;
629629
int cnt = 0;
630630
int nWiki = 0;
631631
db_prepare(&q,
632
- "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
632
+ "SELECT filename.name, datetime(event.mtime),"
633633
" coalesce(event.ecomment,event.comment),"
634634
" coalesce(event.euser,event.user),"
635635
" b.uuid"
636636
" FROM mlink, filename, event, blob a, blob b"
637637
" WHERE filename.fnid=mlink.fnid"
@@ -642,21 +642,20 @@
642642
rid
643643
);
644644
while( db_step(&q)==SQLITE_ROW ){
645645
const char *zName = db_column_text(&q, 0);
646646
const char *zDate = db_column_text(&q, 1);
647
- const char *zFuuid = db_column_text(&q, 2);
648
- const char *zCom = db_column_text(&q, 3);
649
- const char *zUser = db_column_text(&q, 4);
650
- const char *zVers = db_column_text(&q, 5);
647
+ const char *zCom = db_column_text(&q, 2);
648
+ const char *zUser = db_column_text(&q, 3);
649
+ const char *zVers = db_column_text(&q, 4);
651650
if( cnt>0 ){
652651
@ Also file
653652
}else{
654653
@ File
655654
}
656655
@ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
657
- @ artifact %s(zFuuid) part of check-in
656
+ @ part of check-in
658657
hyperlink_to_uuid(zVers);
659658
@ - %w(zCom) by
660659
hyperlink_to_user(zUser,zDate," on");
661660
hyperlink_to_date(zDate,".");
662661
cnt++;
@@ -665,31 +664,29 @@
665664
}
666665
}
667666
db_finalize(&q);
668667
db_prepare(&q,
669668
"SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
670
- " coalesce(event.euser, event.user), uuid"
671
- " FROM tagxref, tag, event, blob"
669
+ " coalesce(event.euser, event.user)"
670
+ " FROM tagxref, tag, event"
672671
" WHERE tagxref.rid=%d"
673672
" AND tag.tagid=tagxref.tagid"
674673
" AND tag.tagname LIKE 'wiki-%%'"
675
- " AND event.objid=tagxref.rid"
676
- " AND blob.rid=tagxref.rid",
674
+ " AND event.objid=tagxref.rid",
677675
rid
678676
);
679677
while( db_step(&q)==SQLITE_ROW ){
680678
const char *zPagename = db_column_text(&q, 0);
681679
const char *zDate = db_column_text(&q, 1);
682680
const char *zUser = db_column_text(&q, 2);
683
- const char *zUuid = db_column_text(&q, 3);
684681
if( cnt>0 ){
685682
@ Also wiki page
686683
}else{
687684
@ Wiki page
688685
}
689686
@ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
690
- @ artifact %s(zUuid) by
687
+ @ by
691688
hyperlink_to_user(zUser,zDate," on");
692689
hyperlink_to_date(zDate,".");
693690
nWiki++;
694691
cnt++;
695692
if( pDownloadName && blob_size(pDownloadName)==0 ){
@@ -697,22 +694,22 @@
697694
}
698695
}
699696
db_finalize(&q);
700697
if( nWiki==0 ){
701698
db_prepare(&q,
702
- "SELECT datetime(mtime), user, comment, uuid, type"
699
+ "SELECT datetime(mtime), user, comment, type, uuid"
703700
" FROM event, blob"
704701
" WHERE event.objid=%d"
705702
" AND blob.rid=%d",
706703
rid, rid
707704
);
708705
while( db_step(&q)==SQLITE_ROW ){
709706
const char *zDate = db_column_text(&q, 0);
710
- const char *zUuid = db_column_text(&q, 3);
711707
const char *zUser = db_column_text(&q, 1);
712708
const char *zCom = db_column_text(&q, 2);
713
- const char *zType = db_column_text(&q, 4);
709
+ const char *zType = db_column_text(&q, 3);
710
+ const char *zUuid = db_column_text(&q, 4);
714711
if( cnt>0 ){
715712
@ Also
716713
}
717714
if( zType[0]=='w' ){
718715
@ Wiki edit
@@ -734,11 +731,11 @@
734731
}
735732
db_finalize(&q);
736733
}
737734
if( cnt==0 ){
738735
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
739
- @ Control file %s(zUuid).
736
+ @ Control artifact.
740737
if( pDownloadName && blob_size(pDownloadName)==0 ){
741738
blob_append(pDownloadName, zUuid, -1);
742739
}
743740
}else if( linkToView ){
744741
@ <a href="%s(g.zBaseURL)/artifact/%d(rid)">[view]</a>
@@ -864,10 +861,11 @@
864861
*/
865862
void hexdump_page(void){
866863
int rid;
867864
Blob content;
868865
Blob downloadName;
866
+ char *zUuid;
869867
870868
rid = name_to_rid(PD("name","0"));
871869
login_check_credentials();
872870
if( !g.okRead ){ login_needed(); return; }
873871
if( rid==0 ){ cgi_redirect("/home"); }
@@ -880,11 +878,12 @@
880878
style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
881879
g.zTop, zUuid);
882880
}
883881
}
884882
style_header("Hex Artifact Content");
885
- @ <h2>Hexadecimal Content Of:</h2>
883
+ zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
884
+ @ <h2>Artifact %s(zUuid):</h2>
886885
@ <blockquote>
887886
blob_zero(&downloadName);
888887
object_description(rid, 0, &downloadName);
889888
style_submenu_element("Download", "Download",
890889
"%s/raw/%T?name=%d", g.zBaseURL, blob_str(&downloadName), rid);
@@ -909,10 +908,11 @@
909908
Blob content;
910909
const char *zMime;
911910
Blob downloadName;
912911
int renderAsWiki = 0;
913912
int renderAsHtml = 0;
913
+ const char *zUuid;
914914
915915
rid = name_to_rid(PD("name","0"));
916916
login_check_credentials();
917917
if( !g.okRead ){ login_needed(); return; }
918918
if( rid==0 ){ cgi_redirect("/home"); }
@@ -925,11 +925,12 @@
925925
style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
926926
g.zTop, zUuid);
927927
}
928928
}
929929
style_header("Artifact Content");
930
- @ <h2>Content Of:</h2>
930
+ zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
931
+ @ <h2>Artifact %s(zUuid)</h2>
931932
@ <blockquote>
932933
blob_zero(&downloadName);
933934
object_description(rid, 0, &downloadName);
934935
style_submenu_element("Download", "Download",
935936
"%s/raw/%T?name=%d", g.zTop, blob_str(&downloadName), rid);
936937
--- src/info.c
+++ src/info.c
@@ -627,11 +627,11 @@
627 ){
628 Stmt q;
629 int cnt = 0;
630 int nWiki = 0;
631 db_prepare(&q,
632 "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
633 " coalesce(event.ecomment,event.comment),"
634 " coalesce(event.euser,event.user),"
635 " b.uuid"
636 " FROM mlink, filename, event, blob a, blob b"
637 " WHERE filename.fnid=mlink.fnid"
@@ -642,21 +642,20 @@
642 rid
643 );
644 while( db_step(&q)==SQLITE_ROW ){
645 const char *zName = db_column_text(&q, 0);
646 const char *zDate = db_column_text(&q, 1);
647 const char *zFuuid = db_column_text(&q, 2);
648 const char *zCom = db_column_text(&q, 3);
649 const char *zUser = db_column_text(&q, 4);
650 const char *zVers = db_column_text(&q, 5);
651 if( cnt>0 ){
652 @ Also file
653 }else{
654 @ File
655 }
656 @ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
657 @ artifact %s(zFuuid) part of check-in
658 hyperlink_to_uuid(zVers);
659 @ - %w(zCom) by
660 hyperlink_to_user(zUser,zDate," on");
661 hyperlink_to_date(zDate,".");
662 cnt++;
@@ -665,31 +664,29 @@
665 }
666 }
667 db_finalize(&q);
668 db_prepare(&q,
669 "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
670 " coalesce(event.euser, event.user), uuid"
671 " FROM tagxref, tag, event, blob"
672 " WHERE tagxref.rid=%d"
673 " AND tag.tagid=tagxref.tagid"
674 " AND tag.tagname LIKE 'wiki-%%'"
675 " AND event.objid=tagxref.rid"
676 " AND blob.rid=tagxref.rid",
677 rid
678 );
679 while( db_step(&q)==SQLITE_ROW ){
680 const char *zPagename = db_column_text(&q, 0);
681 const char *zDate = db_column_text(&q, 1);
682 const char *zUser = db_column_text(&q, 2);
683 const char *zUuid = db_column_text(&q, 3);
684 if( cnt>0 ){
685 @ Also wiki page
686 }else{
687 @ Wiki page
688 }
689 @ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
690 @ artifact %s(zUuid) by
691 hyperlink_to_user(zUser,zDate," on");
692 hyperlink_to_date(zDate,".");
693 nWiki++;
694 cnt++;
695 if( pDownloadName && blob_size(pDownloadName)==0 ){
@@ -697,22 +694,22 @@
697 }
698 }
699 db_finalize(&q);
700 if( nWiki==0 ){
701 db_prepare(&q,
702 "SELECT datetime(mtime), user, comment, uuid, type"
703 " FROM event, blob"
704 " WHERE event.objid=%d"
705 " AND blob.rid=%d",
706 rid, rid
707 );
708 while( db_step(&q)==SQLITE_ROW ){
709 const char *zDate = db_column_text(&q, 0);
710 const char *zUuid = db_column_text(&q, 3);
711 const char *zUser = db_column_text(&q, 1);
712 const char *zCom = db_column_text(&q, 2);
713 const char *zType = db_column_text(&q, 4);
 
714 if( cnt>0 ){
715 @ Also
716 }
717 if( zType[0]=='w' ){
718 @ Wiki edit
@@ -734,11 +731,11 @@
734 }
735 db_finalize(&q);
736 }
737 if( cnt==0 ){
738 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
739 @ Control file %s(zUuid).
740 if( pDownloadName && blob_size(pDownloadName)==0 ){
741 blob_append(pDownloadName, zUuid, -1);
742 }
743 }else if( linkToView ){
744 @ <a href="%s(g.zBaseURL)/artifact/%d(rid)">[view]</a>
@@ -864,10 +861,11 @@
864 */
865 void hexdump_page(void){
866 int rid;
867 Blob content;
868 Blob downloadName;
 
869
870 rid = name_to_rid(PD("name","0"));
871 login_check_credentials();
872 if( !g.okRead ){ login_needed(); return; }
873 if( rid==0 ){ cgi_redirect("/home"); }
@@ -880,11 +878,12 @@
880 style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
881 g.zTop, zUuid);
882 }
883 }
884 style_header("Hex Artifact Content");
885 @ <h2>Hexadecimal Content Of:</h2>
 
886 @ <blockquote>
887 blob_zero(&downloadName);
888 object_description(rid, 0, &downloadName);
889 style_submenu_element("Download", "Download",
890 "%s/raw/%T?name=%d", g.zBaseURL, blob_str(&downloadName), rid);
@@ -909,10 +908,11 @@
909 Blob content;
910 const char *zMime;
911 Blob downloadName;
912 int renderAsWiki = 0;
913 int renderAsHtml = 0;
 
914
915 rid = name_to_rid(PD("name","0"));
916 login_check_credentials();
917 if( !g.okRead ){ login_needed(); return; }
918 if( rid==0 ){ cgi_redirect("/home"); }
@@ -925,11 +925,12 @@
925 style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
926 g.zTop, zUuid);
927 }
928 }
929 style_header("Artifact Content");
930 @ <h2>Content Of:</h2>
 
931 @ <blockquote>
932 blob_zero(&downloadName);
933 object_description(rid, 0, &downloadName);
934 style_submenu_element("Download", "Download",
935 "%s/raw/%T?name=%d", g.zTop, blob_str(&downloadName), rid);
936
--- src/info.c
+++ src/info.c
@@ -627,11 +627,11 @@
627 ){
628 Stmt q;
629 int cnt = 0;
630 int nWiki = 0;
631 db_prepare(&q,
632 "SELECT filename.name, datetime(event.mtime),"
633 " coalesce(event.ecomment,event.comment),"
634 " coalesce(event.euser,event.user),"
635 " b.uuid"
636 " FROM mlink, filename, event, blob a, blob b"
637 " WHERE filename.fnid=mlink.fnid"
@@ -642,21 +642,20 @@
642 rid
643 );
644 while( db_step(&q)==SQLITE_ROW ){
645 const char *zName = db_column_text(&q, 0);
646 const char *zDate = db_column_text(&q, 1);
647 const char *zCom = db_column_text(&q, 2);
648 const char *zUser = db_column_text(&q, 3);
649 const char *zVers = db_column_text(&q, 4);
 
650 if( cnt>0 ){
651 @ Also file
652 }else{
653 @ File
654 }
655 @ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
656 @ part of check-in
657 hyperlink_to_uuid(zVers);
658 @ - %w(zCom) by
659 hyperlink_to_user(zUser,zDate," on");
660 hyperlink_to_date(zDate,".");
661 cnt++;
@@ -665,31 +664,29 @@
664 }
665 }
666 db_finalize(&q);
667 db_prepare(&q,
668 "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
669 " coalesce(event.euser, event.user)"
670 " FROM tagxref, tag, event"
671 " WHERE tagxref.rid=%d"
672 " AND tag.tagid=tagxref.tagid"
673 " AND tag.tagname LIKE 'wiki-%%'"
674 " AND event.objid=tagxref.rid",
 
675 rid
676 );
677 while( db_step(&q)==SQLITE_ROW ){
678 const char *zPagename = db_column_text(&q, 0);
679 const char *zDate = db_column_text(&q, 1);
680 const char *zUser = db_column_text(&q, 2);
 
681 if( cnt>0 ){
682 @ Also wiki page
683 }else{
684 @ Wiki page
685 }
686 @ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
687 @ by
688 hyperlink_to_user(zUser,zDate," on");
689 hyperlink_to_date(zDate,".");
690 nWiki++;
691 cnt++;
692 if( pDownloadName && blob_size(pDownloadName)==0 ){
@@ -697,22 +694,22 @@
694 }
695 }
696 db_finalize(&q);
697 if( nWiki==0 ){
698 db_prepare(&q,
699 "SELECT datetime(mtime), user, comment, type, uuid"
700 " FROM event, blob"
701 " WHERE event.objid=%d"
702 " AND blob.rid=%d",
703 rid, rid
704 );
705 while( db_step(&q)==SQLITE_ROW ){
706 const char *zDate = db_column_text(&q, 0);
 
707 const char *zUser = db_column_text(&q, 1);
708 const char *zCom = db_column_text(&q, 2);
709 const char *zType = db_column_text(&q, 3);
710 const char *zUuid = db_column_text(&q, 4);
711 if( cnt>0 ){
712 @ Also
713 }
714 if( zType[0]=='w' ){
715 @ Wiki edit
@@ -734,11 +731,11 @@
731 }
732 db_finalize(&q);
733 }
734 if( cnt==0 ){
735 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
736 @ Control artifact.
737 if( pDownloadName && blob_size(pDownloadName)==0 ){
738 blob_append(pDownloadName, zUuid, -1);
739 }
740 }else if( linkToView ){
741 @ <a href="%s(g.zBaseURL)/artifact/%d(rid)">[view]</a>
@@ -864,10 +861,11 @@
861 */
862 void hexdump_page(void){
863 int rid;
864 Blob content;
865 Blob downloadName;
866 char *zUuid;
867
868 rid = name_to_rid(PD("name","0"));
869 login_check_credentials();
870 if( !g.okRead ){ login_needed(); return; }
871 if( rid==0 ){ cgi_redirect("/home"); }
@@ -880,11 +878,12 @@
878 style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
879 g.zTop, zUuid);
880 }
881 }
882 style_header("Hex Artifact Content");
883 zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
884 @ <h2>Artifact %s(zUuid):</h2>
885 @ <blockquote>
886 blob_zero(&downloadName);
887 object_description(rid, 0, &downloadName);
888 style_submenu_element("Download", "Download",
889 "%s/raw/%T?name=%d", g.zBaseURL, blob_str(&downloadName), rid);
@@ -909,10 +908,11 @@
908 Blob content;
909 const char *zMime;
910 Blob downloadName;
911 int renderAsWiki = 0;
912 int renderAsHtml = 0;
913 const char *zUuid;
914
915 rid = name_to_rid(PD("name","0"));
916 login_check_credentials();
917 if( !g.okRead ){ login_needed(); return; }
918 if( rid==0 ){ cgi_redirect("/home"); }
@@ -925,11 +925,12 @@
925 style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
926 g.zTop, zUuid);
927 }
928 }
929 style_header("Artifact Content");
930 zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
931 @ <h2>Artifact %s(zUuid)</h2>
932 @ <blockquote>
933 blob_zero(&downloadName);
934 object_description(rid, 0, &downloadName);
935 style_submenu_element("Download", "Download",
936 "%s/raw/%T?name=%d", g.zTop, blob_str(&downloadName), rid);
937

Keyboard Shortcuts

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