| | @@ -790,10 +790,11 @@ |
| 790 | 790 | @ rid INTEGER PRIMARY KEY, -- RID of the object |
| 791 | 791 | @ uuid TEXT, -- SHA1 hash of the object |
| 792 | 792 | @ ctime DATETIME, -- Time of creation |
| 793 | 793 | @ isPrivate BOOLEAN DEFAULT 0, -- True for unpublished artifacts |
| 794 | 794 | @ type TEXT, -- file, checkin, wiki, ticket, etc. |
| 795 | +@ summary TEXT, -- Summary comment for the object |
| 795 | 796 | @ detail TEXT -- filename, checkin comment, etc |
| 796 | 797 | @ ); |
| 797 | 798 | ; |
| 798 | 799 | |
| 799 | 800 | /* |
| | @@ -807,22 +808,23 @@ |
| 807 | 808 | |
| 808 | 809 | db_multi_exec("%s", zDescTab/*safe-for-%s*/); |
| 809 | 810 | |
| 810 | 811 | /* Describe checkins */ |
| 811 | 812 | db_multi_exec( |
| 812 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type)\n" |
| 813 | | - "SELECT blob.rid, blob.uuid, event.mtime, 'checkin'\n" |
| 813 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 814 | + "SELECT blob.rid, blob.uuid, event.mtime, 'checkin',\n" |
| 815 | + " 'checkin on ' || strftime('%%Y-%%m-%%d %%H:%%M',event.mtime)\n" |
| 814 | 816 | " FROM event, blob\n" |
| 815 | 817 | " WHERE event.objid %s AND event.type='ci'\n" |
| 816 | 818 | " AND event.objid=blob.rid;", |
| 817 | 819 | zWhere /*safe-for-%s*/ |
| 818 | 820 | ); |
| 819 | 821 | |
| 820 | 822 | /* Describe files */ |
| 821 | 823 | db_multi_exec( |
| 822 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 823 | | - "SELECT blob.rid, blob.uuid, event.mtime, 'file', filename.name\n" |
| 824 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 825 | + "SELECT blob.rid, blob.uuid, event.mtime, 'file', 'file '||filename.name\n" |
| 824 | 826 | " FROM mlink, blob, event, filename\n" |
| 825 | 827 | " WHERE mlink.fid %s\n" |
| 826 | 828 | " AND mlink.mid=event.objid\n" |
| 827 | 829 | " AND filename.fnid=mlink.fnid\n" |
| 828 | 830 | " AND mlink.fid=blob.rid;", |
| | @@ -829,35 +831,35 @@ |
| 829 | 831 | zWhere /*safe-for-%s*/ |
| 830 | 832 | ); |
| 831 | 833 | |
| 832 | 834 | /* Describe tags */ |
| 833 | 835 | db_multi_exec( |
| 834 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 836 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 835 | 837 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'tag',\n" |
| 836 | | - " substr((SELECT uuid FROM blob WHERE rid=tagxref.rid),1,16)\n" |
| 838 | + " 'tag '||substr((SELECT uuid FROM blob WHERE rid=tagxref.rid),1,16)\n" |
| 837 | 839 | " FROM tagxref, blob\n" |
| 838 | 840 | " WHERE tagxref.srcid %s AND tagxref.srcid!=tagxref.rid\n" |
| 839 | 841 | " AND tagxref.srcid=blob.rid;", |
| 840 | 842 | zWhere /*safe-for-%s*/ |
| 841 | 843 | ); |
| 842 | 844 | |
| 843 | 845 | /* Cluster artifacts */ |
| 844 | 846 | db_multi_exec( |
| 845 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type)\n" |
| 846 | | - "SELECT blob.rid, blob.uuid, tagxref.mtime, 'cluster'\n" |
| 847 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 848 | + "SELECT blob.rid, blob.uuid, tagxref.mtime, 'cluster', 'cluster'\n" |
| 847 | 849 | " FROM tagxref, blob\n" |
| 848 | 850 | " WHERE tagxref.rid %s\n" |
| 849 | 851 | " AND tagxref.tagid=(SELECT tagid FROM tag WHERE tagname='cluster')\n" |
| 850 | 852 | " AND blob.rid=tagxref.rid;", |
| 851 | 853 | zWhere /*safe-for-%s*/ |
| 852 | 854 | ); |
| 853 | 855 | |
| 854 | 856 | /* Ticket change artifacts */ |
| 855 | 857 | db_multi_exec( |
| 856 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 858 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 857 | 859 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'ticket',\n" |
| 858 | | - " substr(tag.tagname,5)\n" |
| 860 | + " 'ticket '||substr(tag.tagname,5,21)\n" |
| 859 | 861 | " FROM tagxref, tag, blob\n" |
| 860 | 862 | " WHERE tagxref.rid %s\n" |
| 861 | 863 | " AND tag.tagid=tagxref.tagid\n" |
| 862 | 864 | " AND tag.tagname GLOB 'tkt-*'" |
| 863 | 865 | " AND blob.rid=tagxref.rid;", |
| | @@ -864,13 +866,13 @@ |
| 864 | 866 | zWhere /*safe-for-%s*/ |
| 865 | 867 | ); |
| 866 | 868 | |
| 867 | 869 | /* Wiki edit artifacts */ |
| 868 | 870 | db_multi_exec( |
| 869 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 871 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 870 | 872 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'wiki',\n" |
| 871 | | - " printf('\"%%s\"',substr(tag.tagname,6))\n" |
| 873 | + " printf('wiki \"%%s\"',substr(tag.tagname,6))\n" |
| 872 | 874 | " FROM tagxref, tag, blob\n" |
| 873 | 875 | " WHERE tagxref.rid %s\n" |
| 874 | 876 | " AND tag.tagid=tagxref.tagid\n" |
| 875 | 877 | " AND tag.tagname GLOB 'wiki-*'" |
| 876 | 878 | " AND blob.rid=tagxref.rid;", |
| | @@ -877,13 +879,13 @@ |
| 877 | 879 | zWhere /*safe-for-%s*/ |
| 878 | 880 | ); |
| 879 | 881 | |
| 880 | 882 | /* Event edit artifacts */ |
| 881 | 883 | db_multi_exec( |
| 882 | | - "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 884 | + "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,summary)\n" |
| 883 | 885 | "SELECT blob.rid, blob.uuid, tagxref.mtime, 'event',\n" |
| 884 | | - " substr(tag.tagname,7)\n" |
| 886 | + " 'event '||substr(tag.tagname,7)\n" |
| 885 | 887 | " FROM tagxref, tag, blob\n" |
| 886 | 888 | " WHERE tagxref.rid %s\n" |
| 887 | 889 | " AND tag.tagid=tagxref.tagid\n" |
| 888 | 890 | " AND tag.tagname GLOB 'event-*'" |
| 889 | 891 | " AND blob.rid=tagxref.rid;", |
| | @@ -892,22 +894,23 @@ |
| 892 | 894 | |
| 893 | 895 | /* Attachments */ |
| 894 | 896 | db_multi_exec( |
| 895 | 897 | "INSERT OR IGNORE INTO description(rid,uuid,ctime,type,detail)\n" |
| 896 | 898 | "SELECT blob.rid, blob.uuid, attachment.mtime, 'attachment',\n" |
| 897 | | - " attachment.filename\n" |
| 899 | + " 'attachment '||attachment.filename\n" |
| 898 | 900 | " FROM attachment, blob\n" |
| 899 | 901 | " WHERE attachment.src %s\n" |
| 900 | 902 | " AND blob.rid=attachment.src;", |
| 901 | 903 | zWhere /*safe-for-%s*/ |
| 902 | 904 | ); |
| 903 | 905 | |
| 904 | 906 | /* Everything else */ |
| 905 | 907 | db_multi_exec( |
| 906 | | - "INSERT OR IGNORE INTO description(rid,uuid,type)\n" |
| 908 | + "INSERT OR IGNORE INTO description(rid,uuid,type,summary)\n" |
| 907 | 909 | "SELECT blob.rid, blob.uuid," |
| 908 | | - " CASE WHEN blob.size<0 THEN 'phantom' ELSE '' END\n" |
| 910 | + " CASE WHEN blob.size<0 THEN 'phantom' ELSE '' END,\n" |
| 911 | + " 'unknown'\n" |
| 909 | 912 | " FROM blob WHERE blob.rid %s;", |
| 910 | 913 | zWhere /*safe-for-%s*/ |
| 911 | 914 | ); |
| 912 | 915 | |
| 913 | 916 | /* Mark private elements */ |
| | @@ -922,27 +925,21 @@ |
| 922 | 925 | int describe_artifacts_to_stdout(const char *zWhere, const char *zLabel){ |
| 923 | 926 | Stmt q; |
| 924 | 927 | int cnt = 0; |
| 925 | 928 | describe_artifacts(zWhere); |
| 926 | 929 | db_prepare(&q, |
| 927 | | - "SELECT uuid, datetime(ctime,'localtime'), type, detail, isPrivate\n" |
| 930 | + "SELECT uuid, summary, isPrivate\n" |
| 928 | 931 | " FROM description\n" |
| 929 | 932 | " ORDER BY ctime, type;" |
| 930 | 933 | ); |
| 931 | 934 | while( db_step(&q)==SQLITE_ROW ){ |
| 932 | | - const char *zType = db_column_text(&q,2); |
| 933 | | - if( zLabel ){ fossil_print("%s\n", zLabel); zLabel = 0; } |
| 934 | | - fossil_print(" %.16s %s", db_column_text(&q,0), db_column_text(&q,2)); |
| 935 | | - if( db_column_bytes(&q,3)>0 ){ |
| 936 | | - fossil_print(" %s", db_column_text(&q,3)); |
| 937 | | - } |
| 938 | | - if( db_column_bytes(&q,1)>0 |
| 939 | | - && fossil_strcmp(zType,"checkin")==0 |
| 940 | | - ){ |
| 941 | | - fossil_print(" %s", db_column_text(&q,1)); |
| 942 | | - } |
| 943 | | - if( db_column_int(&q,4) ) fossil_print(" (unpublished)"); |
| 935 | + if( zLabel ){ |
| 936 | + fossil_print("%s\n", zLabel); |
| 937 | + zLabel = 0; |
| 938 | + } |
| 939 | + fossil_print(" %.16s %s", db_column_text(&q,0), db_column_text(&q,1)); |
| 940 | + if( db_column_int(&q,2) ) fossil_print(" (unpublished)"); |
| 944 | 941 | fossil_print("\n"); |
| 945 | 942 | cnt++; |
| 946 | 943 | } |
| 947 | 944 | db_finalize(&q); |
| 948 | 945 | db_multi_exec("DELETE FROM description;"); |
| 949 | 946 | |