Fossil SCM
Rename the "test-describe-artifacts" webpage to "bloblist". Provide an index to use for repos with more than 5000 artifacts. Improvements to the bulk artifact describer.
Commit
f3663f9f69c0ce8eb5ca23d7ebd635a6b61f3a18
Parent
59121b9c0d1737c…
2 files changed
+35
-16
+1
-1
+35
-16
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -803,21 +803,21 @@ | ||
| 803 | 803 | db_multi_exec( |
| 804 | 804 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 805 | 805 | "SELECT blob.rid, blob.uuid, event.mtime, 'checkin',\n" |
| 806 | 806 | " 'checkin on ' || strftime('%%Y-%%m-%%d %%H:%%M',event.mtime)\n" |
| 807 | 807 | " FROM event, blob\n" |
| 808 | - " WHERE event.objid %s AND event.type='ci'\n" | |
| 808 | + " WHERE (event.objid %s) AND event.type='ci'\n" | |
| 809 | 809 | " AND event.objid=blob.rid;", |
| 810 | 810 | zWhere /*safe-for-%s*/ |
| 811 | 811 | ); |
| 812 | 812 | |
| 813 | 813 | /* Describe files */ |
| 814 | 814 | db_multi_exec( |
| 815 | 815 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 816 | 816 | "SELECT blob.rid, blob.uuid, event.mtime, 'file', 'file '||filename.name\n" |
| 817 | 817 | " FROM mlink, blob, event, filename\n" |
| 818 | - " WHERE mlink.fid %s\n" | |
| 818 | + " WHERE (mlink.fid %s)\n" | |
| 819 | 819 | " AND mlink.mid=event.objid\n" |
| 820 | 820 | " AND filename.fnid=mlink.fnid\n" |
| 821 | 821 | " AND mlink.fid=blob.rid;", |
| 822 | 822 | zWhere /*safe-for-%s*/ |
| 823 | 823 | ); |
| @@ -826,21 +826,21 @@ | ||
| 826 | 826 | db_multi_exec( |
| 827 | 827 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 828 | 828 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'tag',\n" |
| 829 | 829 | " 'tag '||substr((SELECT uuid FROM blob WHERE rid=tagxref.rid),1,16)\n" |
| 830 | 830 | " FROM tagxref, blob\n" |
| 831 | - " WHERE tagxref.srcid %s AND tagxref.srcid!=tagxref.rid\n" | |
| 831 | + " WHERE (tagxref.srcid %s) AND tagxref.srcid!=tagxref.rid\n" | |
| 832 | 832 | " AND tagxref.srcid=blob.rid;", |
| 833 | 833 | zWhere /*safe-for-%s*/ |
| 834 | 834 | ); |
| 835 | 835 | |
| 836 | 836 | /* Cluster artifacts */ |
| 837 | 837 | db_multi_exec( |
| 838 | 838 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 839 | 839 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'cluster', 'cluster'\n" |
| 840 | 840 | " FROM tagxref, blob\n" |
| 841 | - " WHERE tagxref.rid %s\n" | |
| 841 | + " WHERE (tagxref.rid %s)\n" | |
| 842 | 842 | " AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='cluster')\n" |
| 843 | 843 | " AND blob.rid=tagxref.rid;", |
| 844 | 844 | zWhere /*safe-for-%s*/ |
| 845 | 845 | ); |
| 846 | 846 | |
| @@ -848,11 +848,11 @@ | ||
| 848 | 848 | db_multi_exec( |
| 849 | 849 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 850 | 850 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'ticket',\n" |
| 851 | 851 | " 'ticket '||substr(tag.tagname,5,21)\n" |
| 852 | 852 | " FROM tagxref, tag, blob\n" |
| 853 | - " WHERE tagxref.rid %s\n" | |
| 853 | + " WHERE (tagxref.rid %s)\n" | |
| 854 | 854 | " AND tag.tagid=tagxref.tagid\n" |
| 855 | 855 | " AND tag.tagname GLOB 'tkt-*'" |
| 856 | 856 | " AND blob.rid=tagxref.rid;", |
| 857 | 857 | zWhere /*safe-for-%s*/ |
| 858 | 858 | ); |
| @@ -861,11 +861,11 @@ | ||
| 861 | 861 | db_multi_exec( |
| 862 | 862 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 863 | 863 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'wiki',\n" |
| 864 | 864 | " printf('wiki \"%%s\"',substr(tag.tagname,6))\n" |
| 865 | 865 | " FROM tagxref, tag, blob\n" |
| 866 | - " WHERE tagxref.rid %s\n" | |
| 866 | + " WHERE (tagxref.rid %s)\n" | |
| 867 | 867 | " AND tag.tagid=tagxref.tagid\n" |
| 868 | 868 | " AND tag.tagname GLOB 'wiki-*'" |
| 869 | 869 | " AND blob.rid=tagxref.rid;", |
| 870 | 870 | zWhere /*safe-for-%s*/ |
| 871 | 871 | ); |
| @@ -874,35 +874,45 @@ | ||
| 874 | 874 | db_multi_exec( |
| 875 | 875 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 876 | 876 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'event',\n" |
| 877 | 877 | " 'event '||substr(tag.tagname,7)\n" |
| 878 | 878 | " FROM tagxref, tag, blob\n" |
| 879 | - " WHERE tagxref.rid %s\n" | |
| 879 | + " WHERE (tagxref.rid %s)\n" | |
| 880 | 880 | " AND tag.tagid=tagxref.tagid\n" |
| 881 | 881 | " AND tag.tagname GLOB 'event-*'" |
| 882 | 882 | " AND blob.rid=tagxref.rid;", |
| 883 | 883 | zWhere /*safe-for-%s*/ |
| 884 | 884 | ); |
| 885 | 885 | |
| 886 | 886 | /* Attachments */ |
| 887 | 887 | db_multi_exec( |
| 888 | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" | |
| 888 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" | |
| 889 | + "SELECT blob.rid, blob.uuid, attachment.mtime, 'attach-control',\n" | |
| 890 | + " 'attachment-control for '||attachment.filename\n" | |
| 891 | + " FROM attachment, blob\n" | |
| 892 | + " WHERE (attachment.attachid %s)\n" | |
| 893 | + " AND blob.rid=attachment.attachid", | |
| 894 | + zWhere /*safe-for-%s*/ | |
| 895 | + ); | |
| 896 | + db_multi_exec( | |
| 897 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" | |
| 889 | 898 | "SELECT blob.rid, blob.uuid, attachment.mtime, 'attachment',\n" |
| 890 | 899 | " 'attachment '||attachment.filename\n" |
| 891 | 900 | " FROM attachment, blob\n" |
| 892 | - " WHERE attachment.src %s\n" | |
| 893 | - " AND blob.rid=attachment.src;", | |
| 901 | + " WHERE (blob.rid %s)\n" | |
| 902 | + " AND blob.rid NOT IN (SELECT rid FROM description)\n" | |
| 903 | + " AND blob.uuid=attachment.src", | |
| 894 | 904 | zWhere /*safe-for-%s*/ |
| 895 | 905 | ); |
| 896 | 906 | |
| 897 | 907 | /* Everything else */ |
| 898 | 908 | db_multi_exec( |
| 899 | 909 | "INSERT OR IGNORE INTO description(rid,uuid,type,summary)\n" |
| 900 | 910 | "SELECT blob.rid, blob.uuid," |
| 901 | 911 | " CASE WHEN blob.size<0 THEN 'phantom' ELSE '' END,\n" |
| 902 | 912 | " 'unknown'\n" |
| 903 | - " FROM blob WHERE blob.rid %s;", | |
| 913 | + " FROM blob WHERE (blob.rid %s);", | |
| 904 | 914 | zWhere /*safe-for-%s*/ |
| 905 | 915 | ); |
| 906 | 916 | |
| 907 | 917 | /* Mark private elements */ |
| 908 | 918 | db_multi_exec( |
| @@ -938,21 +948,30 @@ | ||
| 938 | 948 | } |
| 939 | 949 | |
| 940 | 950 | /* |
| 941 | 951 | ** COMMAND: test-describe-artifacts |
| 942 | 952 | ** |
| 943 | -** Usage: %fossil test-describe-artifacts | |
| 953 | +** Usage: %fossil test-describe-artifacts [--from S] [--count N] | |
| 944 | 954 | ** |
| 945 | 955 | ** Display a one-line description of every artifact. |
| 946 | 956 | */ |
| 947 | 957 | void test_describe_artifacts_cmd(void){ |
| 958 | + int iFrom = 0; | |
| 959 | + int iCnt = 1000000; | |
| 960 | + const char *z; | |
| 961 | + char *zRange; | |
| 948 | 962 | db_find_and_open_repository(0,0); |
| 949 | - describe_artifacts_to_stdout(">0", 0); | |
| 963 | + z = find_option("from",0,1); | |
| 964 | + if( z ) iFrom = atoi(z); | |
| 965 | + z = find_option("count",0,1); | |
| 966 | + if( z ) iCnt = atoi(z); | |
| 967 | + zRange = mprintf("BETWEEN %d AND %d", iFrom, iFrom+iCnt-1); | |
| 968 | + describe_artifacts_to_stdout(zRange, 0); | |
| 950 | 969 | } |
| 951 | 970 | |
| 952 | 971 | /* |
| 953 | -** WEBPAGE: test-describe-artifacts | |
| 972 | +** WEBPAGE: bloblist | |
| 954 | 973 | ** |
| 955 | 974 | ** Return a page showing all artifacts in the repository |
| 956 | 975 | */ |
| 957 | 976 | void test_describe_artifacts_page(void){ |
| 958 | 977 | Stmt q; |
| @@ -967,19 +986,19 @@ | ||
| 967 | 986 | if( mx>n && P("s")==0 ){ |
| 968 | 987 | int i; |
| 969 | 988 | @ <p>Select a range of artifacts to view:</p> |
| 970 | 989 | @ <ul> |
| 971 | 990 | for(i=1; i<=mx; i+=n){ |
| 972 | - @ <li> %z(href("%R/test-describe-artifacts?s=%d&n=%d",i,n)) | |
| 991 | + @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) | |
| 973 | 992 | @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a> |
| 974 | 993 | } |
| 975 | 994 | @ </ul> |
| 976 | 995 | style_footer(); |
| 977 | 996 | return; |
| 978 | 997 | } |
| 979 | 998 | if( mx>n ){ |
| 980 | - style_submenu_element("Index", "Index", "test-describe-artifacts"); | |
| 999 | + style_submenu_element("Index", "Index", "bloblist"); | |
| 981 | 1000 | } |
| 982 | 1001 | zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); |
| 983 | 1002 | describe_artifacts(zRange); |
| 984 | 1003 | db_prepare(&q, |
| 985 | 1004 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 986 | 1005 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -803,21 +803,21 @@ | |
| 803 | db_multi_exec( |
| 804 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 805 | "SELECT blob.rid, blob.uuid, event.mtime, 'checkin',\n" |
| 806 | " 'checkin on ' || strftime('%%Y-%%m-%%d %%H:%%M',event.mtime)\n" |
| 807 | " FROM event, blob\n" |
| 808 | " WHERE event.objid %s AND event.type='ci'\n" |
| 809 | " AND event.objid=blob.rid;", |
| 810 | zWhere /*safe-for-%s*/ |
| 811 | ); |
| 812 | |
| 813 | /* Describe files */ |
| 814 | db_multi_exec( |
| 815 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 816 | "SELECT blob.rid, blob.uuid, event.mtime, 'file', 'file '||filename.name\n" |
| 817 | " FROM mlink, blob, event, filename\n" |
| 818 | " WHERE mlink.fid %s\n" |
| 819 | " AND mlink.mid=event.objid\n" |
| 820 | " AND filename.fnid=mlink.fnid\n" |
| 821 | " AND mlink.fid=blob.rid;", |
| 822 | zWhere /*safe-for-%s*/ |
| 823 | ); |
| @@ -826,21 +826,21 @@ | |
| 826 | db_multi_exec( |
| 827 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 828 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'tag',\n" |
| 829 | " 'tag '||substr((SELECT uuid FROM blob WHERE rid=tagxref.rid),1,16)\n" |
| 830 | " FROM tagxref, blob\n" |
| 831 | " WHERE tagxref.srcid %s AND tagxref.srcid!=tagxref.rid\n" |
| 832 | " AND tagxref.srcid=blob.rid;", |
| 833 | zWhere /*safe-for-%s*/ |
| 834 | ); |
| 835 | |
| 836 | /* Cluster artifacts */ |
| 837 | db_multi_exec( |
| 838 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 839 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'cluster', 'cluster'\n" |
| 840 | " FROM tagxref, blob\n" |
| 841 | " WHERE tagxref.rid %s\n" |
| 842 | " AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='cluster')\n" |
| 843 | " AND blob.rid=tagxref.rid;", |
| 844 | zWhere /*safe-for-%s*/ |
| 845 | ); |
| 846 | |
| @@ -848,11 +848,11 @@ | |
| 848 | db_multi_exec( |
| 849 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 850 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'ticket',\n" |
| 851 | " 'ticket '||substr(tag.tagname,5,21)\n" |
| 852 | " FROM tagxref, tag, blob\n" |
| 853 | " WHERE tagxref.rid %s\n" |
| 854 | " AND tag.tagid=tagxref.tagid\n" |
| 855 | " AND tag.tagname GLOB 'tkt-*'" |
| 856 | " AND blob.rid=tagxref.rid;", |
| 857 | zWhere /*safe-for-%s*/ |
| 858 | ); |
| @@ -861,11 +861,11 @@ | |
| 861 | db_multi_exec( |
| 862 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 863 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'wiki',\n" |
| 864 | " printf('wiki \"%%s\"',substr(tag.tagname,6))\n" |
| 865 | " FROM tagxref, tag, blob\n" |
| 866 | " WHERE tagxref.rid %s\n" |
| 867 | " AND tag.tagid=tagxref.tagid\n" |
| 868 | " AND tag.tagname GLOB 'wiki-*'" |
| 869 | " AND blob.rid=tagxref.rid;", |
| 870 | zWhere /*safe-for-%s*/ |
| 871 | ); |
| @@ -874,35 +874,45 @@ | |
| 874 | db_multi_exec( |
| 875 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 876 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'event',\n" |
| 877 | " 'event '||substr(tag.tagname,7)\n" |
| 878 | " FROM tagxref, tag, blob\n" |
| 879 | " WHERE tagxref.rid %s\n" |
| 880 | " AND tag.tagid=tagxref.tagid\n" |
| 881 | " AND tag.tagname GLOB 'event-*'" |
| 882 | " AND blob.rid=tagxref.rid;", |
| 883 | zWhere /*safe-for-%s*/ |
| 884 | ); |
| 885 | |
| 886 | /* Attachments */ |
| 887 | db_multi_exec( |
| 888 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 889 | "SELECT blob.rid, blob.uuid, attachment.mtime, 'attachment',\n" |
| 890 | " 'attachment '||attachment.filename\n" |
| 891 | " FROM attachment, blob\n" |
| 892 | " WHERE attachment.src %s\n" |
| 893 | " AND blob.rid=attachment.src;", |
| 894 | zWhere /*safe-for-%s*/ |
| 895 | ); |
| 896 | |
| 897 | /* Everything else */ |
| 898 | db_multi_exec( |
| 899 | "INSERT OR IGNORE INTO description(rid,uuid,type,summary)\n" |
| 900 | "SELECT blob.rid, blob.uuid," |
| 901 | " CASE WHEN blob.size<0 THEN 'phantom' ELSE '' END,\n" |
| 902 | " 'unknown'\n" |
| 903 | " FROM blob WHERE blob.rid %s;", |
| 904 | zWhere /*safe-for-%s*/ |
| 905 | ); |
| 906 | |
| 907 | /* Mark private elements */ |
| 908 | db_multi_exec( |
| @@ -938,21 +948,30 @@ | |
| 938 | } |
| 939 | |
| 940 | /* |
| 941 | ** COMMAND: test-describe-artifacts |
| 942 | ** |
| 943 | ** Usage: %fossil test-describe-artifacts |
| 944 | ** |
| 945 | ** Display a one-line description of every artifact. |
| 946 | */ |
| 947 | void test_describe_artifacts_cmd(void){ |
| 948 | db_find_and_open_repository(0,0); |
| 949 | describe_artifacts_to_stdout(">0", 0); |
| 950 | } |
| 951 | |
| 952 | /* |
| 953 | ** WEBPAGE: test-describe-artifacts |
| 954 | ** |
| 955 | ** Return a page showing all artifacts in the repository |
| 956 | */ |
| 957 | void test_describe_artifacts_page(void){ |
| 958 | Stmt q; |
| @@ -967,19 +986,19 @@ | |
| 967 | if( mx>n && P("s")==0 ){ |
| 968 | int i; |
| 969 | @ <p>Select a range of artifacts to view:</p> |
| 970 | @ <ul> |
| 971 | for(i=1; i<=mx; i+=n){ |
| 972 | @ <li> %z(href("%R/test-describe-artifacts?s=%d&n=%d",i,n)) |
| 973 | @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a> |
| 974 | } |
| 975 | @ </ul> |
| 976 | style_footer(); |
| 977 | return; |
| 978 | } |
| 979 | if( mx>n ){ |
| 980 | style_submenu_element("Index", "Index", "test-describe-artifacts"); |
| 981 | } |
| 982 | zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); |
| 983 | describe_artifacts(zRange); |
| 984 | db_prepare(&q, |
| 985 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 986 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -803,21 +803,21 @@ | |
| 803 | db_multi_exec( |
| 804 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 805 | "SELECT blob.rid, blob.uuid, event.mtime, 'checkin',\n" |
| 806 | " 'checkin on ' || strftime('%%Y-%%m-%%d %%H:%%M',event.mtime)\n" |
| 807 | " FROM event, blob\n" |
| 808 | " WHERE (event.objid %s) AND event.type='ci'\n" |
| 809 | " AND event.objid=blob.rid;", |
| 810 | zWhere /*safe-for-%s*/ |
| 811 | ); |
| 812 | |
| 813 | /* Describe files */ |
| 814 | db_multi_exec( |
| 815 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 816 | "SELECT blob.rid, blob.uuid, event.mtime, 'file', 'file '||filename.name\n" |
| 817 | " FROM mlink, blob, event, filename\n" |
| 818 | " WHERE (mlink.fid %s)\n" |
| 819 | " AND mlink.mid=event.objid\n" |
| 820 | " AND filename.fnid=mlink.fnid\n" |
| 821 | " AND mlink.fid=blob.rid;", |
| 822 | zWhere /*safe-for-%s*/ |
| 823 | ); |
| @@ -826,21 +826,21 @@ | |
| 826 | db_multi_exec( |
| 827 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 828 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'tag',\n" |
| 829 | " 'tag '||substr((SELECT uuid FROM blob WHERE rid=tagxref.rid),1,16)\n" |
| 830 | " FROM tagxref, blob\n" |
| 831 | " WHERE (tagxref.srcid %s) AND tagxref.srcid!=tagxref.rid\n" |
| 832 | " AND tagxref.srcid=blob.rid;", |
| 833 | zWhere /*safe-for-%s*/ |
| 834 | ); |
| 835 | |
| 836 | /* Cluster artifacts */ |
| 837 | db_multi_exec( |
| 838 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 839 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'cluster', 'cluster'\n" |
| 840 | " FROM tagxref, blob\n" |
| 841 | " WHERE (tagxref.rid %s)\n" |
| 842 | " AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='cluster')\n" |
| 843 | " AND blob.rid=tagxref.rid;", |
| 844 | zWhere /*safe-for-%s*/ |
| 845 | ); |
| 846 | |
| @@ -848,11 +848,11 @@ | |
| 848 | db_multi_exec( |
| 849 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 850 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'ticket',\n" |
| 851 | " 'ticket '||substr(tag.tagname,5,21)\n" |
| 852 | " FROM tagxref, tag, blob\n" |
| 853 | " WHERE (tagxref.rid %s)\n" |
| 854 | " AND tag.tagid=tagxref.tagid\n" |
| 855 | " AND tag.tagname GLOB 'tkt-*'" |
| 856 | " AND blob.rid=tagxref.rid;", |
| 857 | zWhere /*safe-for-%s*/ |
| 858 | ); |
| @@ -861,11 +861,11 @@ | |
| 861 | db_multi_exec( |
| 862 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 863 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'wiki',\n" |
| 864 | " printf('wiki \"%%s\"',substr(tag.tagname,6))\n" |
| 865 | " FROM tagxref, tag, blob\n" |
| 866 | " WHERE (tagxref.rid %s)\n" |
| 867 | " AND tag.tagid=tagxref.tagid\n" |
| 868 | " AND tag.tagname GLOB 'wiki-*'" |
| 869 | " AND blob.rid=tagxref.rid;", |
| 870 | zWhere /*safe-for-%s*/ |
| 871 | ); |
| @@ -874,35 +874,45 @@ | |
| 874 | db_multi_exec( |
| 875 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 876 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'event',\n" |
| 877 | " 'event '||substr(tag.tagname,7)\n" |
| 878 | " FROM tagxref, tag, blob\n" |
| 879 | " WHERE (tagxref.rid %s)\n" |
| 880 | " AND tag.tagid=tagxref.tagid\n" |
| 881 | " AND tag.tagname GLOB 'event-*'" |
| 882 | " AND blob.rid=tagxref.rid;", |
| 883 | zWhere /*safe-for-%s*/ |
| 884 | ); |
| 885 | |
| 886 | /* Attachments */ |
| 887 | db_multi_exec( |
| 888 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 889 | "SELECT blob.rid, blob.uuid, attachment.mtime, 'attach-control',\n" |
| 890 | " 'attachment-control for '||attachment.filename\n" |
| 891 | " FROM attachment, blob\n" |
| 892 | " WHERE (attachment.attachid %s)\n" |
| 893 | " AND blob.rid=attachment.attachid", |
| 894 | zWhere /*safe-for-%s*/ |
| 895 | ); |
| 896 | db_multi_exec( |
| 897 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 898 | "SELECT blob.rid, blob.uuid, attachment.mtime, 'attachment',\n" |
| 899 | " 'attachment '||attachment.filename\n" |
| 900 | " FROM attachment, blob\n" |
| 901 | " WHERE (blob.rid %s)\n" |
| 902 | " AND blob.rid NOT IN (SELECT rid FROM description)\n" |
| 903 | " AND blob.uuid=attachment.src", |
| 904 | zWhere /*safe-for-%s*/ |
| 905 | ); |
| 906 | |
| 907 | /* Everything else */ |
| 908 | db_multi_exec( |
| 909 | "INSERT OR IGNORE INTO description(rid,uuid,type,summary)\n" |
| 910 | "SELECT blob.rid, blob.uuid," |
| 911 | " CASE WHEN blob.size<0 THEN 'phantom' ELSE '' END,\n" |
| 912 | " 'unknown'\n" |
| 913 | " FROM blob WHERE (blob.rid %s);", |
| 914 | zWhere /*safe-for-%s*/ |
| 915 | ); |
| 916 | |
| 917 | /* Mark private elements */ |
| 918 | db_multi_exec( |
| @@ -938,21 +948,30 @@ | |
| 948 | } |
| 949 | |
| 950 | /* |
| 951 | ** COMMAND: test-describe-artifacts |
| 952 | ** |
| 953 | ** Usage: %fossil test-describe-artifacts [--from S] [--count N] |
| 954 | ** |
| 955 | ** Display a one-line description of every artifact. |
| 956 | */ |
| 957 | void test_describe_artifacts_cmd(void){ |
| 958 | int iFrom = 0; |
| 959 | int iCnt = 1000000; |
| 960 | const char *z; |
| 961 | char *zRange; |
| 962 | db_find_and_open_repository(0,0); |
| 963 | z = find_option("from",0,1); |
| 964 | if( z ) iFrom = atoi(z); |
| 965 | z = find_option("count",0,1); |
| 966 | if( z ) iCnt = atoi(z); |
| 967 | zRange = mprintf("BETWEEN %d AND %d", iFrom, iFrom+iCnt-1); |
| 968 | describe_artifacts_to_stdout(zRange, 0); |
| 969 | } |
| 970 | |
| 971 | /* |
| 972 | ** WEBPAGE: bloblist |
| 973 | ** |
| 974 | ** Return a page showing all artifacts in the repository |
| 975 | */ |
| 976 | void test_describe_artifacts_page(void){ |
| 977 | Stmt q; |
| @@ -967,19 +986,19 @@ | |
| 986 | if( mx>n && P("s")==0 ){ |
| 987 | int i; |
| 988 | @ <p>Select a range of artifacts to view:</p> |
| 989 | @ <ul> |
| 990 | for(i=1; i<=mx; i+=n){ |
| 991 | @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) |
| 992 | @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a> |
| 993 | } |
| 994 | @ </ul> |
| 995 | style_footer(); |
| 996 | return; |
| 997 | } |
| 998 | if( mx>n ){ |
| 999 | style_submenu_element("Index", "Index", "bloblist"); |
| 1000 | } |
| 1001 | zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); |
| 1002 | describe_artifacts(zRange); |
| 1003 | db_prepare(&q, |
| 1004 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 1005 |
+1
-1
| --- src/sitemap.c | ||
| +++ src/sitemap.c | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | @ <li>%z(href("%R/attachlist"))List of Attachments</a> |
| 59 | 59 | @ <li>Repository Status |
| 60 | 60 | @ <ul> |
| 61 | 61 | @ <li>%z(href("%R/stat"))Status Summary</a> |
| 62 | 62 | @ <li>%z(href("%R/urllist"))List of URLs used to access this repository</a> |
| 63 | - @ <li>%z(href("%R/test-describe-artifacts"))List of Artifacts</a> | |
| 63 | + @ <li>%z(href("%R/bloblist"))List of Artifacts</a> | |
| 64 | 64 | @ </ul> |
| 65 | 65 | @ <li>On-line Documentation |
| 66 | 66 | @ <ul> |
| 67 | 67 | @ <li>%z(href("%R/help"))List of All Commands and Web Pages</a> |
| 68 | 68 | @ <li>%z(href("%R/test-all-help"))All "help" text on a single page</a> |
| 69 | 69 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | @ <li>%z(href("%R/attachlist"))List of Attachments</a> |
| 59 | @ <li>Repository Status |
| 60 | @ <ul> |
| 61 | @ <li>%z(href("%R/stat"))Status Summary</a> |
| 62 | @ <li>%z(href("%R/urllist"))List of URLs used to access this repository</a> |
| 63 | @ <li>%z(href("%R/test-describe-artifacts"))List of Artifacts</a> |
| 64 | @ </ul> |
| 65 | @ <li>On-line Documentation |
| 66 | @ <ul> |
| 67 | @ <li>%z(href("%R/help"))List of All Commands and Web Pages</a> |
| 68 | @ <li>%z(href("%R/test-all-help"))All "help" text on a single page</a> |
| 69 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | @ <li>%z(href("%R/attachlist"))List of Attachments</a> |
| 59 | @ <li>Repository Status |
| 60 | @ <ul> |
| 61 | @ <li>%z(href("%R/stat"))Status Summary</a> |
| 62 | @ <li>%z(href("%R/urllist"))List of URLs used to access this repository</a> |
| 63 | @ <li>%z(href("%R/bloblist"))List of Artifacts</a> |
| 64 | @ </ul> |
| 65 | @ <li>On-line Documentation |
| 66 | @ <ul> |
| 67 | @ <li>%z(href("%R/help"))List of All Commands and Web Pages</a> |
| 68 | @ <li>%z(href("%R/test-all-help"))All "help" text on a single page</a> |
| 69 |