Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 49e6670386005fa34186f357d0739f163cea88c6 |
|---|---|
| Date: | 2010-03-18 12:55:39 |
| User: | drh |
| Edited Comment: | Change the timeline comment when a wiki page is deleted. Remove some "#if 0" sections from the code. |
| Original Comment: | Change the timeline comment when a wiki page is deleted. Remove some "#if 0" sections from the code. |
Tags And Properties
- bgcolor=#c0ffc0 inherited from [c3d7df650b]
- branch=experimental inherited from [c3d7df650b]
- closed added by [e19cc788d4] on 2011-02-04 17:46:45
- comment=Change the timeline comment when a wiki page is deleted. Remove some "#if 0" sections from the code. added by [e19cc788d4] on 2011-02-04 17:46:45
- sym-experimental inherited from [c3d7df650b]
Changes
Changes to src/manifest.c
1078 } 1078 } 1079 } 1079 } 1080 if( m.type==CFTYPE_WIKI ){ 1080 if( m.type==CFTYPE_WIKI ){ 1081 char *zTag = mprintf("wiki-%s", m.zWikiTitle); 1081 char *zTag = mprintf("wiki-%s", m.zWikiTitle); 1082 int tagid = tag_findid(zTag, 1); 1082 int tagid = tag_findid(zTag, 1); 1083 int prior; 1083 int prior; 1084 char *zComment; 1084 char *zComment; > 1085 int nWiki; 1085 char zLength[40]; 1086 char zLength[40]; 1086 while( isspace(m.zWiki[0]) ) m.zWiki++; 1087 while( isspace(m.zWiki[0]) ) m.zWiki++; > 1088 nWiki = strlen(m.zWiki); 1087 sqlite3_snprintf(sizeof(zLength), zLength, "%d", strlen(m.zWiki)); | 1089 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); 1088 tag_insert(zTag, 1, zLength, rid, m.rDate, rid); 1090 tag_insert(zTag, 1, zLength, rid, m.rDate, rid); 1089 free(zTag); 1091 free(zTag); 1090 prior = db_int(0, 1092 prior = db_int(0, 1091 "SELECT rid FROM tagxref" 1093 "SELECT rid FROM tagxref" 1092 " WHERE tagid=%d AND mtime<%.17g" 1094 " WHERE tagid=%d AND mtime<%.17g" 1093 " ORDER BY mtime DESC", 1095 " ORDER BY mtime DESC", 1094 tagid, m.rDate 1096 tagid, m.rDate 1095 ); 1097 ); 1096 if( prior ){ 1098 if( prior ){ 1097 content_deltify(prior, rid, 0); 1099 content_deltify(prior, rid, 0); 1098 } 1100 } > 1101 if( nWiki>0 ){ 1099 zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle); | 1102 zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle); > 1103 }else{ > 1104 zComment = mprintf("Deleted wiki page [%h]", m.zWikiTitle); > 1105 } 1100 db_multi_exec( 1106 db_multi_exec( 1101 "REPLACE INTO event(type,mtime,objid,user,comment," 1107 "REPLACE INTO event(type,mtime,objid,user,comment," 1102 " bgcolor,euser,ecomment)" 1108 " bgcolor,euser,ecomment)" 1103 "VALUES('w',%.17g,%d,%Q,%Q," 1109 "VALUES('w',%.17g,%d,%Q,%Q," 1104 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1)," 1110 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1)," 1105 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," 1111 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," 1106 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", 1112 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", ................................................................................................................................................................................ 1138 m.zAttachTarget, m.zAttachName, 1144 m.zAttachTarget, m.zAttachName, 1139 m.zAttachTarget, m.zAttachName 1145 m.zAttachTarget, m.zAttachName 1140 ); 1146 ); 1141 if( strlen(m.zAttachTarget)!=UUID_SIZE 1147 if( strlen(m.zAttachTarget)!=UUID_SIZE 1142 || !validate16(m.zAttachTarget, UUID_SIZE) 1148 || !validate16(m.zAttachTarget, UUID_SIZE) 1143 ){ 1149 ){ 1144 char *zComment; 1150 char *zComment; 1145 #if 0 < 1146 char *zTag = mprintf("wiki-%s", m.zAttachTarget); < 1147 tag_findid(zTag, 1); < 1148 free(zTag); < 1149 #endif < 1150 if( m.zAttachSrc && m.zAttachSrc[0] ){ 1151 if( m.zAttachSrc && m.zAttachSrc[0] ){ 1151 zComment = mprintf("Add attachment \"%h\" to wiki page [%h]", 1152 zComment = mprintf("Add attachment \"%h\" to wiki page [%h]", 1152 m.zAttachName, m.zAttachTarget); 1153 m.zAttachName, m.zAttachTarget); 1153 }else{ 1154 }else{ 1154 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", 1155 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", 1155 m.zAttachName, m.zAttachTarget); 1156 m.zAttachName, m.zAttachTarget); 1156 } 1157 }
Changes to src/tkt.c
239 manifest_parse(&manifest, &content); 239 manifest_parse(&manifest, &content); 240 ticket_insert(&manifest, createFlag, rid); 240 ticket_insert(&manifest, createFlag, rid); 241 manifest_ticket_event(rid, &manifest, createFlag, tagid); 241 manifest_ticket_event(rid, &manifest, createFlag, tagid); 242 manifest_clear(&manifest); 242 manifest_clear(&manifest); 243 createFlag = 0; 243 createFlag = 0; 244 } 244 } 245 db_finalize(&q); 245 db_finalize(&q); 246 < 247 #if 0 < 248 db_prepare(&q, < 249 "SELECT attachid, mtime, src IS NULL, filename, user" < 250 " FROM attachment" < 251 " WHERE target=%Q", < 252 zTktUuid < 253 ); < 254 while( db_step(&q)==SQLITE_ROW ){ < 255 int attachid = db_column_int(&q, 0); < 256 double mtime = db_column_double(&q, 1); < 257 int isDelete = db_column_int(&q, 2); < 258 const char *zFile = db_column_text(&q, 3); < 259 const char *zUser = db_column_text(&q, 4); < 260 char *zCom; < 261 < 262 if( isDelete ){ < 263 zCom = mprintf("Delete attachment \"%h\" from ticket [%.10s] by user %h", < 264 zFile, zTktUuid, zUser); < 265 }else{ < 266 zCom = mprintf("Add attachment \"%h\" to ticket [%.10s] by user %h", < 267 zFile, zTktUuid, zUser); < 268 } < 269 db_multi_exec( < 270 "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)" < 271 "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)", < 272 tagid, mtime, attachid, zUser, zCom, zCom < 273 ); < 274 free(zCom); < 275 } < 276 db_finalize(&q); < 277 #endif < 278 } 246 } 279 247 280 /* 248 /* 281 ** Create the subscript interpreter and load the "common" code. 249 ** Create the subscript interpreter and load the "common" code. 282 */ 250 */ 283 void ticket_init(void){ 251 void ticket_init(void){ 284 const char *zConfig; 252 const char *zConfig;