Fossil SCM

Allow events to be referenced using a prefix of their full event-id.

drh 2010-10-11 13:43 trunk
Commit f2025072b4bf72bad061d21f48485a95607789e8
1 file changed +7 -2
+7 -2
--- src/event.c
+++ src/event.c
@@ -46,11 +46,16 @@
4646
free(zEventId);
4747
}
4848
4949
/*
5050
** WEBPAGE: event
51
-** URL: /event?name=EVENTID&detail=BOOLEAN&aid=ARTIFACTID
51
+** URL: /event
52
+** PARAMETERS:
53
+**
54
+** name=EVENTID // Identify the event to display EVENTID must be complete
55
+** detail=BOOLEAN // Show details if TRUE. Default is FALSE. Optional.
56
+** aid=ARTIFACTID // Which specific version of the event. Optional.
5257
**
5358
** Display an existing event identified by EVENTID
5459
*/
5560
void event_page(void){
5661
int rid = 0; /* rid of the event artifact */
@@ -82,11 +87,11 @@
8287
zUuid = (char*)P("aid");
8388
specRid = zUuid ? uuid_to_rid(zUuid, 0) : 0;
8489
rid = nextRid = prevRid = 0;
8590
db_prepare(&q1,
8691
"SELECT rid FROM tagxref"
87
- " WHERE tagid=(SELECT tagid FROM tag WHERE tagname='event-%q')"
92
+ " WHERE tagid=(SELECT tagid FROM tag WHERE tagname GLOB 'event-%q*')"
8893
" ORDER BY mtime DESC",
8994
zEventId
9095
);
9196
while( db_step(&q1)==SQLITE_ROW ){
9297
nextRid = rid;
9398
--- src/event.c
+++ src/event.c
@@ -46,11 +46,16 @@
46 free(zEventId);
47 }
48
49 /*
50 ** WEBPAGE: event
51 ** URL: /event?name=EVENTID&detail=BOOLEAN&aid=ARTIFACTID
 
 
 
 
 
52 **
53 ** Display an existing event identified by EVENTID
54 */
55 void event_page(void){
56 int rid = 0; /* rid of the event artifact */
@@ -82,11 +87,11 @@
82 zUuid = (char*)P("aid");
83 specRid = zUuid ? uuid_to_rid(zUuid, 0) : 0;
84 rid = nextRid = prevRid = 0;
85 db_prepare(&q1,
86 "SELECT rid FROM tagxref"
87 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname='event-%q')"
88 " ORDER BY mtime DESC",
89 zEventId
90 );
91 while( db_step(&q1)==SQLITE_ROW ){
92 nextRid = rid;
93
--- src/event.c
+++ src/event.c
@@ -46,11 +46,16 @@
46 free(zEventId);
47 }
48
49 /*
50 ** WEBPAGE: event
51 ** URL: /event
52 ** PARAMETERS:
53 **
54 ** name=EVENTID // Identify the event to display EVENTID must be complete
55 ** detail=BOOLEAN // Show details if TRUE. Default is FALSE. Optional.
56 ** aid=ARTIFACTID // Which specific version of the event. Optional.
57 **
58 ** Display an existing event identified by EVENTID
59 */
60 void event_page(void){
61 int rid = 0; /* rid of the event artifact */
@@ -82,11 +87,11 @@
87 zUuid = (char*)P("aid");
88 specRid = zUuid ? uuid_to_rid(zUuid, 0) : 0;
89 rid = nextRid = prevRid = 0;
90 db_prepare(&q1,
91 "SELECT rid FROM tagxref"
92 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname GLOB 'event-%q*')"
93 " ORDER BY mtime DESC",
94 zEventId
95 );
96 while( db_step(&q1)==SQLITE_ROW ){
97 nextRid = rid;
98

Keyboard Shortcuts

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