Fossil SCM

Add web-based branch color changer. Add the "branch list" command. Simplifications to color propagation logic.

drh 2009-01-20 22:21 trunk
Commit b7f32a71ab78f3e9813e685fda37c0fc5937b05a
+10 -1
--- src/branch.c
+++ src/branch.c
@@ -204,11 +204,20 @@
204204
}
205205
n = strlen(g.argv[2]);
206206
if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
207207
branch_new();
208208
}else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
209
- fossil_panic("branch list is not yet completed");
209
+ Stmt q;
210
+ db_prepare(&q,
211
+ "%s"
212
+ " AND blob.rid IN (SELECT rid FROM tagxref"
213
+ " WHERE tagid=%d AND tagtype==1)"
214
+ " ORDER BY event.mtime DESC",
215
+ timeline_query_for_tty(), TAG_NEWBRANCH
216
+ );
217
+ print_timeline(&q, 2000);
218
+ db_finalize(&q);
210219
}else{
211220
fossil_panic("branch subcommand should be one of: "
212221
"new list");
213222
}
214223
}
215224
--- src/branch.c
+++ src/branch.c
@@ -204,11 +204,20 @@
204 }
205 n = strlen(g.argv[2]);
206 if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
207 branch_new();
208 }else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
209 fossil_panic("branch list is not yet completed");
 
 
 
 
 
 
 
 
 
210 }else{
211 fossil_panic("branch subcommand should be one of: "
212 "new list");
213 }
214 }
215
--- src/branch.c
+++ src/branch.c
@@ -204,11 +204,20 @@
204 }
205 n = strlen(g.argv[2]);
206 if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
207 branch_new();
208 }else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
209 Stmt q;
210 db_prepare(&q,
211 "%s"
212 " AND blob.rid IN (SELECT rid FROM tagxref"
213 " WHERE tagid=%d AND tagtype==1)"
214 " ORDER BY event.mtime DESC",
215 timeline_query_for_tty(), TAG_NEWBRANCH
216 );
217 print_timeline(&q, 2000);
218 db_finalize(&q);
219 }else{
220 fossil_panic("branch subcommand should be one of: "
221 "new list");
222 }
223 }
224
+5 -5
--- src/checkin.c
+++ src/checkin.c
@@ -346,16 +346,16 @@
346346
g.aCommitFile[ii-2] = 0;
347347
}
348348
}
349349
350350
/*
351
-** Return true if the check-in with RID=rid has one or more child
351
+** Return true if the check-in with RID=rid has no child
352352
** check-ins which are not tagged with "newbranch". In other words,
353
-** return true if the check-in is not a leaf.
353
+** return true if the check-in is a leaf.
354354
*/
355
-int is_not_a_leaf(int rid){
356
- return db_exists(
355
+int is_a_leaf(int rid){
356
+ return !db_exists(
357357
"SELECT 1 FROM plink"
358358
" WHERE pid=%d"
359359
" AND NOT EXIST("
360360
"SELECT 1 FROM tagxref"
361361
" WHERE tagxref.rid=plink.cid"
@@ -459,11 +459,11 @@
459459
fossil_panic("file %s has not changed", blob_str(&unmodified));
460460
}
461461
}
462462
463463
vid = db_lget_int("checkout", 0);
464
- if( is_not_a_leaf(vid) ){
464
+ if( !is_a_leaf(vid) ){
465465
wouldFork=1;
466466
if( forceFlag==0 ){
467467
fossil_fatal("would fork. \"update\" first or use -f or --force.");
468468
}
469469
}
470470
--- src/checkin.c
+++ src/checkin.c
@@ -346,16 +346,16 @@
346 g.aCommitFile[ii-2] = 0;
347 }
348 }
349
350 /*
351 ** Return true if the check-in with RID=rid has one or more child
352 ** check-ins which are not tagged with "newbranch". In other words,
353 ** return true if the check-in is not a leaf.
354 */
355 int is_not_a_leaf(int rid){
356 return db_exists(
357 "SELECT 1 FROM plink"
358 " WHERE pid=%d"
359 " AND NOT EXIST("
360 "SELECT 1 FROM tagxref"
361 " WHERE tagxref.rid=plink.cid"
@@ -459,11 +459,11 @@
459 fossil_panic("file %s has not changed", blob_str(&unmodified));
460 }
461 }
462
463 vid = db_lget_int("checkout", 0);
464 if( is_not_a_leaf(vid) ){
465 wouldFork=1;
466 if( forceFlag==0 ){
467 fossil_fatal("would fork. \"update\" first or use -f or --force.");
468 }
469 }
470
--- src/checkin.c
+++ src/checkin.c
@@ -346,16 +346,16 @@
346 g.aCommitFile[ii-2] = 0;
347 }
348 }
349
350 /*
351 ** Return true if the check-in with RID=rid has no child
352 ** check-ins which are not tagged with "newbranch". In other words,
353 ** return true if the check-in is a leaf.
354 */
355 int is_a_leaf(int rid){
356 return !db_exists(
357 "SELECT 1 FROM plink"
358 " WHERE pid=%d"
359 " AND NOT EXIST("
360 "SELECT 1 FROM tagxref"
361 " WHERE tagxref.rid=plink.cid"
@@ -459,11 +459,11 @@
459 fossil_panic("file %s has not changed", blob_str(&unmodified));
460 }
461 }
462
463 vid = db_lget_int("checkout", 0);
464 if( !is_a_leaf(vid) ){
465 wouldFork=1;
466 if( forceFlag==0 ){
467 fossil_fatal("would fork. \"update\" first or use -f or --force.");
468 }
469 }
470
--- src/descendants.c
+++ src/descendants.c
@@ -273,10 +273,21 @@
273273
style_submenu_element("Open", "Open", "leaves");
274274
}
275275
style_header("Leaves");
276276
login_anonymous_available();
277277
compute_leaves(0, showAll ? 0 : showClosed ? 2 : 1);
278
+ @ <table width="33%%" align="right" border="1">
279
+ @ <tr><td>
280
+ @ <b>Nomenclature:</b>
281
+ @ <ol>
282
+ @ <li> A <b>leaf</b> is a check-in with no descendants.</li>
283
+ @ <li> An <b>open leaf</b> is a leaf that does not have a "closed" tag
284
+ @ and is thus assumed to still be in use.</li>
285
+ @ <li> A <b>closed leaf</b> has a "closed" tag and is thus assumed to
286
+ @ be historical and no longer in active use.</li>
287
+ @ </ol>
288
+ @ </td></tr></table>
278289
if( showAll ){
279290
@ <h1>All leaves, both open and closed</h1>
280291
}else if( showClosed ){
281292
@ <h1>Closed leaves only</h1>
282293
}else{
@@ -288,13 +299,14 @@
288299
" ORDER BY event.mtime DESC",
289300
timeline_query_for_www()
290301
);
291302
www_print_timeline(&q);
292303
db_finalize(&q);
304
+ @ <br clear="both">
293305
@ <script>
294306
@ function xin(id){
295307
@ }
296308
@ function xout(id){
297309
@ }
298310
@ </script>
299311
style_footer();
300312
}
301313
--- src/descendants.c
+++ src/descendants.c
@@ -273,10 +273,21 @@
273 style_submenu_element("Open", "Open", "leaves");
274 }
275 style_header("Leaves");
276 login_anonymous_available();
277 compute_leaves(0, showAll ? 0 : showClosed ? 2 : 1);
 
 
 
 
 
 
 
 
 
 
 
278 if( showAll ){
279 @ <h1>All leaves, both open and closed</h1>
280 }else if( showClosed ){
281 @ <h1>Closed leaves only</h1>
282 }else{
@@ -288,13 +299,14 @@
288 " ORDER BY event.mtime DESC",
289 timeline_query_for_www()
290 );
291 www_print_timeline(&q);
292 db_finalize(&q);
 
293 @ <script>
294 @ function xin(id){
295 @ }
296 @ function xout(id){
297 @ }
298 @ </script>
299 style_footer();
300 }
301
--- src/descendants.c
+++ src/descendants.c
@@ -273,10 +273,21 @@
273 style_submenu_element("Open", "Open", "leaves");
274 }
275 style_header("Leaves");
276 login_anonymous_available();
277 compute_leaves(0, showAll ? 0 : showClosed ? 2 : 1);
278 @ <table width="33%%" align="right" border="1">
279 @ <tr><td>
280 @ <b>Nomenclature:</b>
281 @ <ol>
282 @ <li> A <b>leaf</b> is a check-in with no descendants.</li>
283 @ <li> An <b>open leaf</b> is a leaf that does not have a "closed" tag
284 @ and is thus assumed to still be in use.</li>
285 @ <li> A <b>closed leaf</b> has a "closed" tag and is thus assumed to
286 @ be historical and no longer in active use.</li>
287 @ </ol>
288 @ </td></tr></table>
289 if( showAll ){
290 @ <h1>All leaves, both open and closed</h1>
291 }else if( showClosed ){
292 @ <h1>Closed leaves only</h1>
293 }else{
@@ -288,13 +299,14 @@
299 " ORDER BY event.mtime DESC",
300 timeline_query_for_www()
301 );
302 www_print_timeline(&q);
303 db_finalize(&q);
304 @ <br clear="both">
305 @ <script>
306 @ function xin(id){
307 @ }
308 @ function xout(id){
309 @ }
310 @ </script>
311 style_footer();
312 }
313
+93 -11
--- src/info.c
+++ src/info.c
@@ -1127,12 +1127,30 @@
11271127
int rid;
11281128
const char *zComment;
11291129
const char *zNewComment;
11301130
const char *zUser;
11311131
const char *zNewUser;
1132
+ const char *zColor;
1133
+ const char *zNewColor;
1134
+ int fPropagateColor;
11321135
char *zUuid;
11331136
Blob comment;
1137
+ static const struct SampleColors {
1138
+ const char *zCName;
1139
+ const char *zColor;
1140
+ } aColor[] = {
1141
+ { "(none)", "" },
1142
+ { "#c0ffc0", "#c0ffc0" },
1143
+ { "#c0fff0", "#c0fff0" },
1144
+ { "#c0f0ff", "#c0f0ff" },
1145
+ { "#d0c0ff", "#d0c0ff" },
1146
+ { "#ffc0ff", "#ffc0ff" },
1147
+ { "#ffc0d0", "#ffc0d0" },
1148
+ { "#fff0c0", "#fff0c0" },
1149
+ { "#f0ffc0", "#f0ffc0" },
1150
+ };
1151
+ int i;
11341152
11351153
login_check_credentials();
11361154
if( !g.okWrite ){ login_needed(); return; }
11371155
rid = atoi(PD("r","0"));
11381156
zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
@@ -1141,10 +1159,14 @@
11411159
zNewComment = PD("c",zComment);
11421160
zUser = db_text(0, "SELECT coalesce(euser,user)"
11431161
" FROM event WHERE objid=%d", rid);
11441162
if( zUser==0 ) fossil_redirect_home();
11451163
zNewUser = PD("u",zUser);
1164
+ zColor = db_text("", "SELECT bgcolor"
1165
+ " FROM event WHERE objid=%d", rid);
1166
+ zNewColor = PD("clr",zColor);
1167
+ fPropagateColor = P("pclr")!=0;
11461168
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
11471169
if( P("cancel") ){
11481170
cgi_redirectf("vinfo?name=%d", rid);
11491171
}
11501172
if( P("apply") ){
@@ -1155,18 +1177,30 @@
11551177
login_verify_csrf_secret();
11561178
blob_zero(&ctrl);
11571179
zDate = db_text(0, "SELECT datetime('now')");
11581180
zDate[10] = 'T';
11591181
blob_appendf(&ctrl, "D %s\n", zDate);
1182
+ if( zNewColor[0] && strcmp(zColor,zNewColor)!=0 ){
1183
+ nChng++;
1184
+ if( fPropagateColor ){
1185
+ blob_appendf(&ctrl, "T *bgcolor %s %F\n", zUuid, zNewColor);
1186
+ }else{
1187
+ blob_appendf(&ctrl, "T +bgcolor %s %F\n", zUuid, zNewColor);
1188
+ }
1189
+ }
11601190
if( strcmp(zComment,zNewComment)!=0 ){
11611191
nChng++;
11621192
blob_appendf(&ctrl, "T +comment %s %F\n", zUuid, zNewComment);
11631193
}
11641194
if( strcmp(zUser,zNewUser)!=0 ){
11651195
nChng++;
11661196
blob_appendf(&ctrl, "T +user %s %F\n", zUuid, zNewUser);
11671197
}
1198
+ if( zNewColor[0]==0 && zColor[0]!=0 ){
1199
+ nChng++;
1200
+ blob_appendf(&ctrl, "T -bgcolor %s\n", zUuid);
1201
+ }
11681202
if( nChng>0 ){
11691203
int nrid;
11701204
Blob cksum;
11711205
blob_appendf(&ctrl, "U %F\n", g.zLogin);
11721206
md5sum_blob(&ctrl, &cksum);
@@ -1180,25 +1214,73 @@
11801214
}
11811215
blob_zero(&comment);
11821216
blob_append(&comment, zNewComment, -1);
11831217
zUuid[10] = 0;
11841218
style_header("Edit Baseline [%s]", zUuid);
1185
- @ <p>Make changes to the User and Comment for baseline
1186
- @ [<a href="vinfo?name=%d(rid)">%s(zUuid)</a>] then press the
1187
- @ "Apply Changes" button.</p>
1219
+ if( P("preview") ){
1220
+ @ <b>Preview:</b>
1221
+ @ <blockquote>
1222
+ @ <table border=0>
1223
+ if( zNewColor && zNewColor[0] ){
1224
+ @ <tr><td bgcolor="%h(zNewColor)">
1225
+ }else{
1226
+ @ <tr><td>
1227
+ }
1228
+ wiki_convert(&comment, 0, WIKI_INLINE);
1229
+ @ (user: %h(zNewUser))
1230
+ @ </td></tr></table>
1231
+ @ </blockquote>
1232
+ @ <hr>
1233
+ }
1234
+ @ <p>Make changes to attributes of check-in
1235
+ @ [<a href="vinfo?name=%d(rid)">%s(zUuid)</a>]:</p>
11881236
@ <form action="%s(g.zBaseURL)/vedit" method="POST">
11891237
login_insert_csrf_secret();
11901238
@ <input type="hidden" name="r" value="%d(rid)">
1191
- @ <p>
1192
- @ <b>User:</b> <input type="text" name="u" size="20" value="%h(zNewUser)">
1193
- @ </p>
1194
- @ <p><b>Comment:</b></b><br />
1195
- wiki_convert(&comment, 0, WIKI_INLINE);
1196
- @ <br /><textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea></p>
1197
- @ <blockquote>
1239
+ @ <table border="0" cellspacing="10">
1240
+
1241
+ @ <tr><td align="right" valign="top"><b>User:</b></td>
1242
+ @ <td valign="top">
1243
+ @ <input type="text" name="u" size="20" value="%h(zNewUser)">
1244
+ @ </td></tr>
1245
+
1246
+ @ <tr><td align="right" valign="top"><b>Comment:</b></td>
1247
+ @ <td valign="top">
1248
+ @ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
1249
+ @ </td></tr>
1250
+
1251
+ @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
1252
+ @ <td valign="top">
1253
+ @ <table border=0 cellpadding=0 cellspacing=1>
1254
+ @ <tr>
1255
+ for(i=0; i<sizeof(aColor)/sizeof(aColor[0]); i++){
1256
+ if( aColor[i].zColor[0] ){
1257
+ @ <td bgcolor="%h(aColor[i].zColor)">
1258
+ }else{
1259
+ @ <td>
1260
+ }
1261
+ if( strcmp(zNewColor, aColor[i].zColor)==0 ){
1262
+ @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" checked>
1263
+ }else{
1264
+ @ <input type="radio" name="clr" value="%h(aColor[i].zColor)">
1265
+ }
1266
+ @ %h(aColor[i].zCName)</input></td>
1267
+ }
1268
+ @ </tr><tr><td colspan="9" align="left">
1269
+ if( fPropagateColor ){
1270
+ @ <input type="checkbox" name="pclr" checked>
1271
+ }else{
1272
+ @ <input type="checkbox" name="pclr">
1273
+ }
1274
+ @ Propagate color to descendants</input></td></tr>
1275
+ @ </table>
1276
+ @ </td></tr>
1277
+
1278
+ @ <tr><td colspan="2">
11981279
@ <input type="submit" name="preview" value="Preview">
11991280
@ <input type="submit" name="apply" value="Apply Changes">
12001281
@ <input type="submit" name="cancel" value="Cancel">
1201
- @ </blockquote>
1282
+ @ </td></tr>
1283
+ @ </table>
12021284
@ </form>
12031285
style_footer();
12041286
}
12051287
--- src/info.c
+++ src/info.c
@@ -1127,12 +1127,30 @@
1127 int rid;
1128 const char *zComment;
1129 const char *zNewComment;
1130 const char *zUser;
1131 const char *zNewUser;
 
 
 
1132 char *zUuid;
1133 Blob comment;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1134
1135 login_check_credentials();
1136 if( !g.okWrite ){ login_needed(); return; }
1137 rid = atoi(PD("r","0"));
1138 zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
@@ -1141,10 +1159,14 @@
1141 zNewComment = PD("c",zComment);
1142 zUser = db_text(0, "SELECT coalesce(euser,user)"
1143 " FROM event WHERE objid=%d", rid);
1144 if( zUser==0 ) fossil_redirect_home();
1145 zNewUser = PD("u",zUser);
 
 
 
 
1146 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1147 if( P("cancel") ){
1148 cgi_redirectf("vinfo?name=%d", rid);
1149 }
1150 if( P("apply") ){
@@ -1155,18 +1177,30 @@
1155 login_verify_csrf_secret();
1156 blob_zero(&ctrl);
1157 zDate = db_text(0, "SELECT datetime('now')");
1158 zDate[10] = 'T';
1159 blob_appendf(&ctrl, "D %s\n", zDate);
 
 
 
 
 
 
 
 
1160 if( strcmp(zComment,zNewComment)!=0 ){
1161 nChng++;
1162 blob_appendf(&ctrl, "T +comment %s %F\n", zUuid, zNewComment);
1163 }
1164 if( strcmp(zUser,zNewUser)!=0 ){
1165 nChng++;
1166 blob_appendf(&ctrl, "T +user %s %F\n", zUuid, zNewUser);
1167 }
 
 
 
 
1168 if( nChng>0 ){
1169 int nrid;
1170 Blob cksum;
1171 blob_appendf(&ctrl, "U %F\n", g.zLogin);
1172 md5sum_blob(&ctrl, &cksum);
@@ -1180,25 +1214,73 @@
1180 }
1181 blob_zero(&comment);
1182 blob_append(&comment, zNewComment, -1);
1183 zUuid[10] = 0;
1184 style_header("Edit Baseline [%s]", zUuid);
1185 @ <p>Make changes to the User and Comment for baseline
1186 @ [<a href="vinfo?name=%d(rid)">%s(zUuid)</a>] then press the
1187 @ "Apply Changes" button.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1188 @ <form action="%s(g.zBaseURL)/vedit" method="POST">
1189 login_insert_csrf_secret();
1190 @ <input type="hidden" name="r" value="%d(rid)">
1191 @ <p>
1192 @ <b>User:</b> <input type="text" name="u" size="20" value="%h(zNewUser)">
1193 @ </p>
1194 @ <p><b>Comment:</b></b><br />
1195 wiki_convert(&comment, 0, WIKI_INLINE);
1196 @ <br /><textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea></p>
1197 @ <blockquote>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198 @ <input type="submit" name="preview" value="Preview">
1199 @ <input type="submit" name="apply" value="Apply Changes">
1200 @ <input type="submit" name="cancel" value="Cancel">
1201 @ </blockquote>
 
1202 @ </form>
1203 style_footer();
1204 }
1205
--- src/info.c
+++ src/info.c
@@ -1127,12 +1127,30 @@
1127 int rid;
1128 const char *zComment;
1129 const char *zNewComment;
1130 const char *zUser;
1131 const char *zNewUser;
1132 const char *zColor;
1133 const char *zNewColor;
1134 int fPropagateColor;
1135 char *zUuid;
1136 Blob comment;
1137 static const struct SampleColors {
1138 const char *zCName;
1139 const char *zColor;
1140 } aColor[] = {
1141 { "(none)", "" },
1142 { "#c0ffc0", "#c0ffc0" },
1143 { "#c0fff0", "#c0fff0" },
1144 { "#c0f0ff", "#c0f0ff" },
1145 { "#d0c0ff", "#d0c0ff" },
1146 { "#ffc0ff", "#ffc0ff" },
1147 { "#ffc0d0", "#ffc0d0" },
1148 { "#fff0c0", "#fff0c0" },
1149 { "#f0ffc0", "#f0ffc0" },
1150 };
1151 int i;
1152
1153 login_check_credentials();
1154 if( !g.okWrite ){ login_needed(); return; }
1155 rid = atoi(PD("r","0"));
1156 zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
@@ -1141,10 +1159,14 @@
1159 zNewComment = PD("c",zComment);
1160 zUser = db_text(0, "SELECT coalesce(euser,user)"
1161 " FROM event WHERE objid=%d", rid);
1162 if( zUser==0 ) fossil_redirect_home();
1163 zNewUser = PD("u",zUser);
1164 zColor = db_text("", "SELECT bgcolor"
1165 " FROM event WHERE objid=%d", rid);
1166 zNewColor = PD("clr",zColor);
1167 fPropagateColor = P("pclr")!=0;
1168 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1169 if( P("cancel") ){
1170 cgi_redirectf("vinfo?name=%d", rid);
1171 }
1172 if( P("apply") ){
@@ -1155,18 +1177,30 @@
1177 login_verify_csrf_secret();
1178 blob_zero(&ctrl);
1179 zDate = db_text(0, "SELECT datetime('now')");
1180 zDate[10] = 'T';
1181 blob_appendf(&ctrl, "D %s\n", zDate);
1182 if( zNewColor[0] && strcmp(zColor,zNewColor)!=0 ){
1183 nChng++;
1184 if( fPropagateColor ){
1185 blob_appendf(&ctrl, "T *bgcolor %s %F\n", zUuid, zNewColor);
1186 }else{
1187 blob_appendf(&ctrl, "T +bgcolor %s %F\n", zUuid, zNewColor);
1188 }
1189 }
1190 if( strcmp(zComment,zNewComment)!=0 ){
1191 nChng++;
1192 blob_appendf(&ctrl, "T +comment %s %F\n", zUuid, zNewComment);
1193 }
1194 if( strcmp(zUser,zNewUser)!=0 ){
1195 nChng++;
1196 blob_appendf(&ctrl, "T +user %s %F\n", zUuid, zNewUser);
1197 }
1198 if( zNewColor[0]==0 && zColor[0]!=0 ){
1199 nChng++;
1200 blob_appendf(&ctrl, "T -bgcolor %s\n", zUuid);
1201 }
1202 if( nChng>0 ){
1203 int nrid;
1204 Blob cksum;
1205 blob_appendf(&ctrl, "U %F\n", g.zLogin);
1206 md5sum_blob(&ctrl, &cksum);
@@ -1180,25 +1214,73 @@
1214 }
1215 blob_zero(&comment);
1216 blob_append(&comment, zNewComment, -1);
1217 zUuid[10] = 0;
1218 style_header("Edit Baseline [%s]", zUuid);
1219 if( P("preview") ){
1220 @ <b>Preview:</b>
1221 @ <blockquote>
1222 @ <table border=0>
1223 if( zNewColor && zNewColor[0] ){
1224 @ <tr><td bgcolor="%h(zNewColor)">
1225 }else{
1226 @ <tr><td>
1227 }
1228 wiki_convert(&comment, 0, WIKI_INLINE);
1229 @ (user: %h(zNewUser))
1230 @ </td></tr></table>
1231 @ </blockquote>
1232 @ <hr>
1233 }
1234 @ <p>Make changes to attributes of check-in
1235 @ [<a href="vinfo?name=%d(rid)">%s(zUuid)</a>]:</p>
1236 @ <form action="%s(g.zBaseURL)/vedit" method="POST">
1237 login_insert_csrf_secret();
1238 @ <input type="hidden" name="r" value="%d(rid)">
1239 @ <table border="0" cellspacing="10">
1240
1241 @ <tr><td align="right" valign="top"><b>User:</b></td>
1242 @ <td valign="top">
1243 @ <input type="text" name="u" size="20" value="%h(zNewUser)">
1244 @ </td></tr>
1245
1246 @ <tr><td align="right" valign="top"><b>Comment:</b></td>
1247 @ <td valign="top">
1248 @ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
1249 @ </td></tr>
1250
1251 @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
1252 @ <td valign="top">
1253 @ <table border=0 cellpadding=0 cellspacing=1>
1254 @ <tr>
1255 for(i=0; i<sizeof(aColor)/sizeof(aColor[0]); i++){
1256 if( aColor[i].zColor[0] ){
1257 @ <td bgcolor="%h(aColor[i].zColor)">
1258 }else{
1259 @ <td>
1260 }
1261 if( strcmp(zNewColor, aColor[i].zColor)==0 ){
1262 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" checked>
1263 }else{
1264 @ <input type="radio" name="clr" value="%h(aColor[i].zColor)">
1265 }
1266 @ %h(aColor[i].zCName)</input></td>
1267 }
1268 @ </tr><tr><td colspan="9" align="left">
1269 if( fPropagateColor ){
1270 @ <input type="checkbox" name="pclr" checked>
1271 }else{
1272 @ <input type="checkbox" name="pclr">
1273 }
1274 @ Propagate color to descendants</input></td></tr>
1275 @ </table>
1276 @ </td></tr>
1277
1278 @ <tr><td colspan="2">
1279 @ <input type="submit" name="preview" value="Preview">
1280 @ <input type="submit" name="apply" value="Apply Changes">
1281 @ <input type="submit" name="cancel" value="Cancel">
1282 @ </td></tr>
1283 @ </table>
1284 @ </form>
1285 style_footer();
1286 }
1287
+5 -7
--- src/manifest.c
+++ src/manifest.c
@@ -915,19 +915,18 @@
915915
add_mlink(rid, &m, cid, 0);
916916
}
917917
db_finalize(&q);
918918
db_multi_exec(
919919
"REPLACE INTO event(type,mtime,objid,user,comment,"
920
- " bgcolor,brbgcolor,euser,ecomment)"
920
+ " bgcolor,euser,ecomment)"
921921
"VALUES('ci',%.17g,%d,%Q,%Q,"
922
- " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1),"
923
- "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1),"
922
+ " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0),"
924923
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
925924
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
926925
m.rDate, rid, m.zUser, m.zComment,
927926
TAG_BGCOLOR, rid,
928
- TAG_BGCOLOR, rid,
927
+ TAG_BRBGCOLOR, rid,
929928
TAG_USER, rid,
930929
TAG_COMMENT, rid
931930
);
932931
}
933932
}
@@ -984,14 +983,13 @@
984983
content_deltify(prior, rid, 0);
985984
}
986985
zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle);
987986
db_multi_exec(
988987
"REPLACE INTO event(type,mtime,objid,user,comment,"
989
- " bgcolor,brbgcolor,euser,ecomment)"
988
+ " bgcolor,euser,ecomment)"
990989
"VALUES('w',%.17g,%d,%Q,%Q,"
991
- " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1),"
992
- " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1),"
990
+ " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1),"
993991
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
994992
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
995993
m.rDate, rid, m.zUser, zComment,
996994
TAG_BGCOLOR, rid,
997995
TAG_BGCOLOR, rid,
998996
--- src/manifest.c
+++ src/manifest.c
@@ -915,19 +915,18 @@
915 add_mlink(rid, &m, cid, 0);
916 }
917 db_finalize(&q);
918 db_multi_exec(
919 "REPLACE INTO event(type,mtime,objid,user,comment,"
920 " bgcolor,brbgcolor,euser,ecomment)"
921 "VALUES('ci',%.17g,%d,%Q,%Q,"
922 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1),"
923 "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1),"
924 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
925 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
926 m.rDate, rid, m.zUser, m.zComment,
927 TAG_BGCOLOR, rid,
928 TAG_BGCOLOR, rid,
929 TAG_USER, rid,
930 TAG_COMMENT, rid
931 );
932 }
933 }
@@ -984,14 +983,13 @@
984 content_deltify(prior, rid, 0);
985 }
986 zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle);
987 db_multi_exec(
988 "REPLACE INTO event(type,mtime,objid,user,comment,"
989 " bgcolor,brbgcolor,euser,ecomment)"
990 "VALUES('w',%.17g,%d,%Q,%Q,"
991 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1),"
992 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1),"
993 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
994 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
995 m.rDate, rid, m.zUser, zComment,
996 TAG_BGCOLOR, rid,
997 TAG_BGCOLOR, rid,
998
--- src/manifest.c
+++ src/manifest.c
@@ -915,19 +915,18 @@
915 add_mlink(rid, &m, cid, 0);
916 }
917 db_finalize(&q);
918 db_multi_exec(
919 "REPLACE INTO event(type,mtime,objid,user,comment,"
920 " bgcolor,euser,ecomment)"
921 "VALUES('ci',%.17g,%d,%Q,%Q,"
922 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0),"
 
923 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
924 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
925 m.rDate, rid, m.zUser, m.zComment,
926 TAG_BGCOLOR, rid,
927 TAG_BRBGCOLOR, rid,
928 TAG_USER, rid,
929 TAG_COMMENT, rid
930 );
931 }
932 }
@@ -984,14 +983,13 @@
983 content_deltify(prior, rid, 0);
984 }
985 zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle);
986 db_multi_exec(
987 "REPLACE INTO event(type,mtime,objid,user,comment,"
988 " bgcolor,euser,ecomment)"
989 "VALUES('w',%.17g,%d,%Q,%Q,"
990 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1),"
 
991 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
992 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));",
993 m.rDate, rid, m.zUser, zComment,
994 TAG_BGCOLOR, rid,
995 TAG_BGCOLOR, rid,
996
+9 -9
--- src/schema.c
+++ src/schema.c
@@ -225,11 +225,10 @@
225225
@ type TEXT, -- Type of event
226226
@ mtime DATETIME, -- Date and time when the event occurs
227227
@ objid INTEGER PRIMARY KEY, -- Associated record ID
228228
@ uid INTEGER REFERENCES user, -- User who caused the event
229229
@ bgcolor TEXT, -- Color set by 'bgcolor' property
230
-@ brbgcolor TEXT, -- Color set by 'br-bgcolor' property
231230
@ euser TEXT, -- User set by 'user' property
232231
@ user TEXT, -- Name of the user
233232
@ ecomment TEXT, -- Comment set by 'comment' property
234233
@ comment TEXT -- Comment describing the event
235234
@ );
@@ -328,20 +327,21 @@
328327
/*
329328
** Predefined tagid values
330329
*/
331330
#if INTERFACE
332331
# define TAG_BGCOLOR 1 /* Set the background color for display */
333
-# define TAG_COMMENT 2 /* The check-in comment */
334
-# define TAG_USER 3 /* User who made a checking */
335
-# define TAG_HIDDEN 4 /* Do not display or sync */
336
-# define TAG_PRIVATE 5 /* Display but do not sync */
337
-# define TAG_CLUSTER 6 /* A cluster */
338
-# define TAG_NEWBRANCH 7 /* First check-in of a new named branch */
339
-# define TAG_CLOSED 8 /* Do not display this check-in as a leaf */
332
+# define TAG_BRBGCOLOR 2 /* Background color for branches */
333
+# define TAG_COMMENT 3 /* The check-in comment */
334
+# define TAG_USER 4 /* User who made a checking */
335
+# define TAG_HIDDEN 5 /* Do not display or sync */
336
+# define TAG_PRIVATE 6 /* Display but do not sync */
337
+# define TAG_CLUSTER 7 /* A cluster */
338
+# define TAG_NEWBRANCH 8 /* First check-in of a new named branch */
339
+# define TAG_CLOSED 9 /* Do not display this check-in as a leaf */
340340
#endif
341341
#if EXPORT_INTERFACE
342
-# define MAX_INT_TAG 8 /* The largest pre-assigned tag id */
342
+# define MAX_INT_TAG 9 /* The largest pre-assigned tag id */
343343
#endif
344344
345345
/*
346346
** The schema for the locate FOSSIL database file found at the root
347347
** of very check-out. This database contains the complete state of
348348
--- src/schema.c
+++ src/schema.c
@@ -225,11 +225,10 @@
225 @ type TEXT, -- Type of event
226 @ mtime DATETIME, -- Date and time when the event occurs
227 @ objid INTEGER PRIMARY KEY, -- Associated record ID
228 @ uid INTEGER REFERENCES user, -- User who caused the event
229 @ bgcolor TEXT, -- Color set by 'bgcolor' property
230 @ brbgcolor TEXT, -- Color set by 'br-bgcolor' property
231 @ euser TEXT, -- User set by 'user' property
232 @ user TEXT, -- Name of the user
233 @ ecomment TEXT, -- Comment set by 'comment' property
234 @ comment TEXT -- Comment describing the event
235 @ );
@@ -328,20 +327,21 @@
328 /*
329 ** Predefined tagid values
330 */
331 #if INTERFACE
332 # define TAG_BGCOLOR 1 /* Set the background color for display */
333 # define TAG_COMMENT 2 /* The check-in comment */
334 # define TAG_USER 3 /* User who made a checking */
335 # define TAG_HIDDEN 4 /* Do not display or sync */
336 # define TAG_PRIVATE 5 /* Display but do not sync */
337 # define TAG_CLUSTER 6 /* A cluster */
338 # define TAG_NEWBRANCH 7 /* First check-in of a new named branch */
339 # define TAG_CLOSED 8 /* Do not display this check-in as a leaf */
 
340 #endif
341 #if EXPORT_INTERFACE
342 # define MAX_INT_TAG 8 /* The largest pre-assigned tag id */
343 #endif
344
345 /*
346 ** The schema for the locate FOSSIL database file found at the root
347 ** of very check-out. This database contains the complete state of
348
--- src/schema.c
+++ src/schema.c
@@ -225,11 +225,10 @@
225 @ type TEXT, -- Type of event
226 @ mtime DATETIME, -- Date and time when the event occurs
227 @ objid INTEGER PRIMARY KEY, -- Associated record ID
228 @ uid INTEGER REFERENCES user, -- User who caused the event
229 @ bgcolor TEXT, -- Color set by 'bgcolor' property
 
230 @ euser TEXT, -- User set by 'user' property
231 @ user TEXT, -- Name of the user
232 @ ecomment TEXT, -- Comment set by 'comment' property
233 @ comment TEXT -- Comment describing the event
234 @ );
@@ -328,20 +327,21 @@
327 /*
328 ** Predefined tagid values
329 */
330 #if INTERFACE
331 # define TAG_BGCOLOR 1 /* Set the background color for display */
332 # define TAG_BRBGCOLOR 2 /* Background color for branches */
333 # define TAG_COMMENT 3 /* The check-in comment */
334 # define TAG_USER 4 /* User who made a checking */
335 # define TAG_HIDDEN 5 /* Do not display or sync */
336 # define TAG_PRIVATE 6 /* Display but do not sync */
337 # define TAG_CLUSTER 7 /* A cluster */
338 # define TAG_NEWBRANCH 8 /* First check-in of a new named branch */
339 # define TAG_CLOSED 9 /* Do not display this check-in as a leaf */
340 #endif
341 #if EXPORT_INTERFACE
342 # define MAX_INT_TAG 9 /* The largest pre-assigned tag id */
343 #endif
344
345 /*
346 ** The schema for the locate FOSSIL database file found at the root
347 ** of very check-out. This database contains the complete state of
348
+2 -6
--- src/tag.c
+++ src/tag.c
@@ -71,11 +71,11 @@
7171
"DELETE FROM tagxref WHERE tagid=%d AND rid=:rid", tagid
7272
);
7373
}
7474
if( tagid==TAG_BGCOLOR ){
7575
db_prepare(&eventupdate,
76
- "UPDATE event SET brbgcolor=%Q WHERE objid=:rid", zValue
76
+ "UPDATE event SET bgcolor=%Q WHERE objid=:rid", zValue
7777
);
7878
}
7979
while( (pid = pqueue_extract(&queue))!=0 ){
8080
db_bind_int(&s, ":pid", pid);
8181
while( db_step(&s)==SQLITE_ROW ){
@@ -184,15 +184,11 @@
184184
zValue = 0;
185185
}
186186
zCol = 0;
187187
switch( tagid ){
188188
case TAG_BGCOLOR: {
189
- if( tagtype==1 ){
190
- zCol = "bgcolor";
191
- }else{
192
- zCol = "brbgcolor";
193
- }
189
+ zCol = "bgcolor";
194190
break;
195191
}
196192
case TAG_COMMENT: {
197193
zCol = "ecomment";
198194
break;
199195
--- src/tag.c
+++ src/tag.c
@@ -71,11 +71,11 @@
71 "DELETE FROM tagxref WHERE tagid=%d AND rid=:rid", tagid
72 );
73 }
74 if( tagid==TAG_BGCOLOR ){
75 db_prepare(&eventupdate,
76 "UPDATE event SET brbgcolor=%Q WHERE objid=:rid", zValue
77 );
78 }
79 while( (pid = pqueue_extract(&queue))!=0 ){
80 db_bind_int(&s, ":pid", pid);
81 while( db_step(&s)==SQLITE_ROW ){
@@ -184,15 +184,11 @@
184 zValue = 0;
185 }
186 zCol = 0;
187 switch( tagid ){
188 case TAG_BGCOLOR: {
189 if( tagtype==1 ){
190 zCol = "bgcolor";
191 }else{
192 zCol = "brbgcolor";
193 }
194 break;
195 }
196 case TAG_COMMENT: {
197 zCol = "ecomment";
198 break;
199
--- src/tag.c
+++ src/tag.c
@@ -71,11 +71,11 @@
71 "DELETE FROM tagxref WHERE tagid=%d AND rid=:rid", tagid
72 );
73 }
74 if( tagid==TAG_BGCOLOR ){
75 db_prepare(&eventupdate,
76 "UPDATE event SET bgcolor=%Q WHERE objid=:rid", zValue
77 );
78 }
79 while( (pid = pqueue_extract(&queue))!=0 ){
80 db_bind_int(&s, ":pid", pid);
81 while( db_step(&s)==SQLITE_ROW ){
@@ -184,15 +184,11 @@
184 zValue = 0;
185 }
186 zCol = 0;
187 switch( tagid ){
188 case TAG_BGCOLOR: {
189 zCol = "bgcolor";
 
 
 
 
190 break;
191 }
192 case TAG_COMMENT: {
193 zCol = "ecomment";
194 break;
195
+6 -4
--- src/tagview.c
+++ src/tagview.c
@@ -168,21 +168,23 @@
168168
#undef TAGVIEW_DEFAULT_FILTER
169169
170170
/*
171171
** Generate a timeline for the chosen tag
172172
*/
173
-void tagview_print_timeline(char const *pName, char const *pPrefix){
173
+void tagview_print_timeline(char const *zName, char const *zPrefix){
174174
char *zSql;
175175
Stmt q;
176
+ int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%q%q'",
177
+ zPrefix, zName);
176178
zSql = mprintf("%s AND EXISTS (SELECT 1"
177179
" FROM tagxref"
178180
" WHERE tagxref.rid = event.objid"
179181
" AND tagxref.tagtype > 0"
180
- " AND tagxref.tagid = (SELECT tagid FROM tag"
181
- " WHERE tagname = %Q||%Q))"
182
+ " AND tagxref.tagid = %d"
182183
" ORDER BY 3 desc",
183
- timeline_query_for_www(), pPrefix, pName);
184
+ timeline_query_for_www(), tagid
185
+ );
184186
db_prepare(&q, zSql);
185187
free(zSql);
186188
www_print_timeline(&q);
187189
db_finalize(&q);
188190
}
189191
--- src/tagview.c
+++ src/tagview.c
@@ -168,21 +168,23 @@
168 #undef TAGVIEW_DEFAULT_FILTER
169
170 /*
171 ** Generate a timeline for the chosen tag
172 */
173 void tagview_print_timeline(char const *pName, char const *pPrefix){
174 char *zSql;
175 Stmt q;
 
 
176 zSql = mprintf("%s AND EXISTS (SELECT 1"
177 " FROM tagxref"
178 " WHERE tagxref.rid = event.objid"
179 " AND tagxref.tagtype > 0"
180 " AND tagxref.tagid = (SELECT tagid FROM tag"
181 " WHERE tagname = %Q||%Q))"
182 " ORDER BY 3 desc",
183 timeline_query_for_www(), pPrefix, pName);
 
184 db_prepare(&q, zSql);
185 free(zSql);
186 www_print_timeline(&q);
187 db_finalize(&q);
188 }
189
--- src/tagview.c
+++ src/tagview.c
@@ -168,21 +168,23 @@
168 #undef TAGVIEW_DEFAULT_FILTER
169
170 /*
171 ** Generate a timeline for the chosen tag
172 */
173 void tagview_print_timeline(char const *zName, char const *zPrefix){
174 char *zSql;
175 Stmt q;
176 int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%q%q'",
177 zPrefix, zName);
178 zSql = mprintf("%s AND EXISTS (SELECT 1"
179 " FROM tagxref"
180 " WHERE tagxref.rid = event.objid"
181 " AND tagxref.tagtype > 0"
182 " AND tagxref.tagid = %d"
 
183 " ORDER BY 3 desc",
184 timeline_query_for_www(), tagid
185 );
186 db_prepare(&q, zSql);
187 free(zSql);
188 www_print_timeline(&q);
189 db_finalize(&q);
190 }
191
+2 -2
--- src/timeline.c
+++ src/timeline.c
@@ -111,11 +111,11 @@
111111
** 8. background color
112112
** 9. type ("ci", "w")
113113
** 10. list of symbolic tags.
114114
*/
115115
void www_print_timeline(
116
- Stmt *pQuery
116
+ Stmt *pQuery /* Query to implement the timeline */
117117
){
118118
int wikiFlags;
119119
int mxWikiLen;
120120
Blob comment;
121121
char zPrevDate[20];
@@ -235,11 +235,11 @@
235235
@ coalesce(ecomment, comment),
236236
@ coalesce(euser, user),
237237
@ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
238238
@ (SELECT count(*) FROM plink WHERE cid=blob.rid),
239239
@ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
240
- @ coalesce(bgcolor, brbgcolor),
240
+ @ bgcolor,
241241
@ event.type,
242242
@ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
243243
@ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
244244
@ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
245245
@ FROM event JOIN blob
246246
--- src/timeline.c
+++ src/timeline.c
@@ -111,11 +111,11 @@
111 ** 8. background color
112 ** 9. type ("ci", "w")
113 ** 10. list of symbolic tags.
114 */
115 void www_print_timeline(
116 Stmt *pQuery
117 ){
118 int wikiFlags;
119 int mxWikiLen;
120 Blob comment;
121 char zPrevDate[20];
@@ -235,11 +235,11 @@
235 @ coalesce(ecomment, comment),
236 @ coalesce(euser, user),
237 @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
238 @ (SELECT count(*) FROM plink WHERE cid=blob.rid),
239 @ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
240 @ coalesce(bgcolor, brbgcolor),
241 @ event.type,
242 @ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
243 @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
244 @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
245 @ FROM event JOIN blob
246
--- src/timeline.c
+++ src/timeline.c
@@ -111,11 +111,11 @@
111 ** 8. background color
112 ** 9. type ("ci", "w")
113 ** 10. list of symbolic tags.
114 */
115 void www_print_timeline(
116 Stmt *pQuery /* Query to implement the timeline */
117 ){
118 int wikiFlags;
119 int mxWikiLen;
120 Blob comment;
121 char zPrevDate[20];
@@ -235,11 +235,11 @@
235 @ coalesce(ecomment, comment),
236 @ coalesce(euser, user),
237 @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
238 @ (SELECT count(*) FROM plink WHERE cid=blob.rid),
239 @ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
240 @ bgcolor,
241 @ event.type,
242 @ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
243 @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
244 @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
245 @ FROM event JOIN blob
246

Keyboard Shortcuts

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