Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | All the a=, b=, and c= query parameters of the timeline webpage to be tags and labels in addition to timestamps. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
66f4fa9bd5a5c4bc748d45b10ad476f8 |
User & Date: | drh 2012-08-27 18:36:20.167 |
Context
2012-08-27
| ||
19:05 | Re-do part of [d89b99e383], which was lost by [d7736649cd] ... (check-in: 22806c5f user: jan.nijtmans tags: trunk) | |
18:36 | All the a=, b=, and c= query parameters of the timeline webpage to be tags and labels in addition to timestamps. ... (check-in: 66f4fa9b user: drh tags: trunk) | |
2012-08-25
| ||
01:48 | Update the built-in SQLite to the latest version from the SQLite trunk. ... (check-in: d7736649 user: drh tags: trunk) | |
Changes
Changes to src/name.c.
︙ | ︙ | |||
105 106 107 108 109 110 111 | if( rid ) return rid; } /* Date and times */ if( memcmp(zTag, "date:", 5)==0 ){ rid = db_int(0, "SELECT objid FROM event" | | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | if( rid ) return rid; } /* Date and times */ if( memcmp(zTag, "date:", 5)==0 ){ rid = db_int(0, "SELECT objid FROM event" " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" " ORDER BY mtime DESC LIMIT 1", &zTag[5], zType); return rid; } if( is_date(zTag) ){ rid = db_int(0, "SELECT objid FROM event" " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" " ORDER BY mtime DESC LIMIT 1", zTag, zType); if( rid) return rid; } /* Deprecated date & time formats: "local:" + date-time and ** "utc:" + date-time */ |
︙ | ︙ |
Changes to src/timeline.c.
︙ | ︙ | |||
808 809 810 811 812 813 814 815 816 817 818 819 820 | const char *zRemove /* Parameter to omit */ ){ style_submenu_element(zMenuName, zMenuName, "%s", url_render(pUrl, zParam, zValue, zRemove, 0)); } /* ** zDate is a localtime date. Insert records into the ** "timeline" table to cause <hr> to be inserted before and after ** entries of that date. If zDate==NULL then put dividers around ** the event identified by rid. */ | > > > > > > > > > > > > > > > > > > > | | < | < < | | | | | | | | | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | const char *zRemove /* Parameter to omit */ ){ style_submenu_element(zMenuName, zMenuName, "%s", url_render(pUrl, zParam, zValue, zRemove, 0)); } /* ** Convert a symbolic name used as an argument to the a=, b=, or c= ** query parameters of timeline into a julianday mtime value. */ double symbolic_name_to_mtime(const char *z){ double mtime; int rid; if( z==0 ) return -1.0; rid = symbolic_name_to_rid(z, "ci"); if( rid==0 ) return -1.0; mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); return mtime; } /* ** The value of one second in julianday notation */ #define ONE_SECOND (1.0/86400.0) /* ** zDate is a localtime date. Insert records into the ** "timeline" table to cause <hr> to be inserted before and after ** entries of that date. If zDate==NULL then put dividers around ** the event identified by rid. */ static void timeline_add_dividers(double rDate, int rid){ char *zToDel = 0; if( rDate==0 ){ rDate = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); } db_multi_exec( "INSERT INTO timeline(rid,sortby,etype)" "VALUES(-1,%.16g,'div')", rDate-ONE_SECOND ); db_multi_exec( "INSERT INTO timeline(rid,sortby,etype)" "VALUES(-2,%.17g,'div')", rDate+ONE_SECOND ); fossil_free(zToDel); } /* ** WEBPAGE: timeline ** ** Query parameters: ** ** a=TIMEORTAG after this event ** b=TIMEORTAG before this event ** c=TIMEORTAG "circa" this event ** n=COUNT max number of events in output ** p=UUID artifact and up to COUNT parents and ancestors ** d=UUID artifact and up to COUNT descendants ** dp=UUUID The same as d=UUID&p=UUID ** t=TAGID show only check-ins with the given tagid ** r=TAGID show check-ins related to tagid ** u=USER only if belonging to this user ** y=TYPE 'ci', 'w', 't', 'e' |
︙ | ︙ | |||
899 900 901 902 903 904 905 906 907 908 909 910 911 912 | HQuery url; /* URL for various branch links */ int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */ int noMerge = P("nomerge")!=0; /* Do not follow merge links */ int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ int pd_rid; /* To view the timeline, must have permission to read project data. */ pd_rid = name_to_typed_rid(P("dp"),"ci"); if( pd_rid ){ p_rid = d_rid = pd_rid; } | > | 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 | HQuery url; /* URL for various branch links */ int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */ int noMerge = P("nomerge")!=0; /* Do not follow merge links */ int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ int pd_rid; double rBefore, rAfter, rCirca; /* Boundary times */ /* To view the timeline, must have permission to read project data. */ pd_rid = name_to_typed_rid(P("dp"),"ci"); if( pd_rid ){ p_rid = d_rid = pd_rid; } |
︙ | ︙ | |||
1119 1120 1121 1122 1123 1124 1125 | } if ( zSearch ){ blob_appendf(&sql, " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", zSearch, zSearch); url_add_parameter(&url, "s", zSearch); } | > | > | | | | | > > > | > | < < | < | > | < < < | < < < | | | | | | | | | | | | | | | < < < < < < > > > | > | > | | | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 | } if ( zSearch ){ blob_appendf(&sql, " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", zSearch, zSearch); url_add_parameter(&url, "s", zSearch); } rBefore = symbolic_name_to_mtime(zBefore); rAfter = symbolic_name_to_mtime(zAfter); rCirca = symbolic_name_to_mtime(zCirca); if( rAfter>0.0 ){ if( rBefore>0.0 ){ blob_appendf(&sql, " AND event.mtime>=%.17g AND event.mtime<=%.17g" " ORDER BY event.mtime ASC", rAfter-ONE_SECOND, rBefore+ONE_SECOND); url_add_parameter(&url, "a", zAfter); url_add_parameter(&url, "b", zBefore); nEntry = 1000000; }else{ blob_appendf(&sql, " AND event.mtime>=%.17g ORDER BY event.mtime ASC", rAfter-ONE_SECOND); url_add_parameter(&url, "a", zAfter); } }else if( rBefore>0.0 ){ blob_appendf(&sql, " AND event.mtime<=%.17g ORDER BY event.mtime DESC", rBefore+ONE_SECOND); url_add_parameter(&url, "b", zBefore); }else if( rCirca>0.0 ){ Blob sql2; blob_init(&sql2, blob_str(&sql), -1); blob_appendf(&sql2, " AND event.mtime<=%f ORDER BY event.mtime DESC LIMIT %d", rCirca, (nEntry+1)/2 ); db_multi_exec("%s", blob_str(&sql2)); blob_reset(&sql2); blob_appendf(&sql, " AND event.mtime>=%f ORDER BY event.mtime ASC", rCirca ); nEntry -= (nEntry+1)/2; if( useDividers ) timeline_add_dividers(rCirca, 0); url_add_parameter(&url, "c", zCirca); }else{ blob_appendf(&sql, " ORDER BY event.mtime DESC"); } blob_appendf(&sql, " LIMIT %d", nEntry); db_multi_exec("%s", blob_str(&sql)); n = db_int(0, "SELECT count(*) FROM timeline /*scan*/"); if( zAfter==0 && zBefore==0 && zCirca==0 ){ blob_appendf(&desc, "%d most recent %ss", n, zEType); }else{ blob_appendf(&desc, "%d %ss", n, zEType); } if( zUser ){ blob_appendf(&desc, " by user %h", zUser); tmFlags |= TIMELINE_DISJOINT; } if( zTagName ){ blob_appendf(&desc, " tagged with \"%h\"", zTagName); tmFlags |= TIMELINE_DISJOINT; }else if( zBrName ){ blob_appendf(&desc, " related to \"%h\"", zBrName); tmFlags |= TIMELINE_DISJOINT; } if( rAfter>0.0 ){ if( rBefore>0.0 ){ blob_appendf(&desc, " occurring between %h and %h.<br>", zAfter, zBefore); }else{ blob_appendf(&desc, " occurring on or after %h.<br />", zAfter); } }else if( rBefore>0.0 ){ blob_appendf(&desc, " occurring on or before %h.<br />", zBefore); }else if( rCirca>0.0 ){ blob_appendf(&desc, " occurring around %h.<br />", zCirca); } if( zSearch ){ blob_appendf(&desc, " matching \"%h\"", zSearch); } if( g.perm.Hyperlink ){ if( zAfter || n==nEntry ){ |
︙ | ︙ |