Fossil SCM

Add the "bisect" query parameter the /timeline. Add the "fossil bisect ui" command that runs "fossil ui -page 'timeline?bisect'".

drh 2015-12-15 16:12 trunk
Commit cbde2cf7e4a40f7a7511baea8fdc77b950a00c10
3 files changed +36 -9 +6 -6 +35 -1
+36 -9
--- src/bisect.c
+++ src/bisect.c
@@ -169,19 +169,18 @@
169169
"COALESCE((SELECT value||' ' FROM vvar WHERE name='bisect-log'),'')"
170170
" || '%d')", rid);
171171
}
172172
173173
/*
174
-** Show a chart of bisect "good" and "bad" versions. The chart can be
175
-** sorted either chronologically by bisect time, or by check-in time.
174
+** Create a TEMP table named "bilog" that contains the complete history
175
+** of the current bisect.
176176
*/
177
-static void bisect_chart(int sortByCkinTime){
177
+void bisect_create_bilog_table(int iCurrent){
178178
char *zLog = db_lget("bisect-log","");
179179
Blob log, id;
180180
Stmt q;
181181
int cnt = 0;
182
- int iCurrent = db_lget_int("checkout",0);
183182
blob_init(&log, zLog, -1);
184183
db_multi_exec(
185184
"CREATE TEMP TABLE bilog("
186185
" seq INTEGER PRIMARY KEY," /* Sequence of events */
187186
" stat TEXT," /* Type of occurrence */
@@ -196,15 +195,27 @@
196195
db_bind_text(&q, ":stat", rid>0 ? "GOOD" : "BAD");
197196
db_bind_int(&q, ":rid", rid>=0 ? rid : -rid);
198197
db_step(&q);
199198
db_reset(&q);
200199
}
201
- db_bind_int(&q, ":seq", ++cnt);
202
- db_bind_text(&q, ":stat", "CURRENT");
203
- db_bind_int(&q, ":rid", iCurrent);
204
- db_step(&q);
200
+ if( iCurrent>0 ){
201
+ db_bind_int(&q, ":seq", ++cnt);
202
+ db_bind_text(&q, ":stat", "CURRENT");
203
+ db_bind_int(&q, ":rid", iCurrent);
204
+ db_step(&q);
205
+ }
205206
db_finalize(&q);
207
+}
208
+
209
+/*
210
+** Show a chart of bisect "good" and "bad" versions. The chart can be
211
+** sorted either chronologically by bisect time, or by check-in time.
212
+*/
213
+static void bisect_chart(int sortByCkinTime){
214
+ Stmt q;
215
+ int iCurrent = db_lget_int("checkout",0);
216
+ bisect_create_bilog_table(iCurrent);
206217
db_prepare(&q,
207218
"SELECT bilog.seq, bilog.stat,"
208219
" substr(blob.uuid,1,16), datetime(event.mtime),"
209220
" blob.rid==%d"
210221
" FROM bilog, blob, event"
@@ -266,10 +277,15 @@
266277
**
267278
** fossil bisect vlist|ls|status ?-a|--all?
268279
**
269280
** List the versions in between "bad" and "good".
270281
**
282
+** fossil bisect ui
283
+**
284
+** Like "fossil ui" except start on a timeline that shows only the
285
+** check-ins that are part of the current bisect.
286
+**
271287
** fossil bisect undo
272288
**
273289
** Undo the most recent "good" or "bad" command.
274290
**
275291
** Summary:
@@ -280,10 +296,11 @@
280296
** fossil bisect chart
281297
** fossil bisect next
282298
** fossil bisect options
283299
** fossil bisect reset
284300
** fossil bisect status
301
+** fossil bisect ui
285302
** fossil bisect undo
286303
*/
287304
void bisect_cmd(void){
288305
int n;
289306
const char *zCmd;
@@ -421,15 +438,25 @@
421438
}else if( strncmp(zCmd, "reset", n)==0 ){
422439
db_multi_exec(
423440
"DELETE FROM vvar WHERE name IN "
424441
" ('bisect-good', 'bisect-bad', 'bisect-log')"
425442
);
443
+ }else if( strcmp(zCmd, "ui")==0 ){
444
+ char *newArgv[8];
445
+ newArgv[0] = g.argv[0];
446
+ newArgv[1] = "ui";
447
+ newArgv[2] = "--page";
448
+ newArgv[3] = "timeline?bisect";
449
+ newArgv[4] = 0;
450
+ g.argv = newArgv;
451
+ g.argc = 4;
452
+ cmd_webserver();
426453
}else if( strncmp(zCmd, "vlist", n)==0
427454
|| strncmp(zCmd, "ls", n)==0
428455
|| strncmp(zCmd, "status", n)==0
429456
){
430457
int fAll = find_option("all", "a", 0)!=0;
431458
bisect_list(!fAll);
432459
}else if( !foundCmd ){
433
- usage("bad|good|log|next|options|reset|status|undo");
460
+ usage("bad|good|log|next|options|reset|status|ui|undo");
434461
}
435462
}
436463
--- src/bisect.c
+++ src/bisect.c
@@ -169,19 +169,18 @@
169 "COALESCE((SELECT value||' ' FROM vvar WHERE name='bisect-log'),'')"
170 " || '%d')", rid);
171 }
172
173 /*
174 ** Show a chart of bisect "good" and "bad" versions. The chart can be
175 ** sorted either chronologically by bisect time, or by check-in time.
176 */
177 static void bisect_chart(int sortByCkinTime){
178 char *zLog = db_lget("bisect-log","");
179 Blob log, id;
180 Stmt q;
181 int cnt = 0;
182 int iCurrent = db_lget_int("checkout",0);
183 blob_init(&log, zLog, -1);
184 db_multi_exec(
185 "CREATE TEMP TABLE bilog("
186 " seq INTEGER PRIMARY KEY," /* Sequence of events */
187 " stat TEXT," /* Type of occurrence */
@@ -196,15 +195,27 @@
196 db_bind_text(&q, ":stat", rid>0 ? "GOOD" : "BAD");
197 db_bind_int(&q, ":rid", rid>=0 ? rid : -rid);
198 db_step(&q);
199 db_reset(&q);
200 }
201 db_bind_int(&q, ":seq", ++cnt);
202 db_bind_text(&q, ":stat", "CURRENT");
203 db_bind_int(&q, ":rid", iCurrent);
204 db_step(&q);
 
 
205 db_finalize(&q);
 
 
 
 
 
 
 
 
 
 
206 db_prepare(&q,
207 "SELECT bilog.seq, bilog.stat,"
208 " substr(blob.uuid,1,16), datetime(event.mtime),"
209 " blob.rid==%d"
210 " FROM bilog, blob, event"
@@ -266,10 +277,15 @@
266 **
267 ** fossil bisect vlist|ls|status ?-a|--all?
268 **
269 ** List the versions in between "bad" and "good".
270 **
 
 
 
 
 
271 ** fossil bisect undo
272 **
273 ** Undo the most recent "good" or "bad" command.
274 **
275 ** Summary:
@@ -280,10 +296,11 @@
280 ** fossil bisect chart
281 ** fossil bisect next
282 ** fossil bisect options
283 ** fossil bisect reset
284 ** fossil bisect status
 
285 ** fossil bisect undo
286 */
287 void bisect_cmd(void){
288 int n;
289 const char *zCmd;
@@ -421,15 +438,25 @@
421 }else if( strncmp(zCmd, "reset", n)==0 ){
422 db_multi_exec(
423 "DELETE FROM vvar WHERE name IN "
424 " ('bisect-good', 'bisect-bad', 'bisect-log')"
425 );
 
 
 
 
 
 
 
 
 
 
426 }else if( strncmp(zCmd, "vlist", n)==0
427 || strncmp(zCmd, "ls", n)==0
428 || strncmp(zCmd, "status", n)==0
429 ){
430 int fAll = find_option("all", "a", 0)!=0;
431 bisect_list(!fAll);
432 }else if( !foundCmd ){
433 usage("bad|good|log|next|options|reset|status|undo");
434 }
435 }
436
--- src/bisect.c
+++ src/bisect.c
@@ -169,19 +169,18 @@
169 "COALESCE((SELECT value||' ' FROM vvar WHERE name='bisect-log'),'')"
170 " || '%d')", rid);
171 }
172
173 /*
174 ** Create a TEMP table named "bilog" that contains the complete history
175 ** of the current bisect.
176 */
177 void bisect_create_bilog_table(int iCurrent){
178 char *zLog = db_lget("bisect-log","");
179 Blob log, id;
180 Stmt q;
181 int cnt = 0;
 
182 blob_init(&log, zLog, -1);
183 db_multi_exec(
184 "CREATE TEMP TABLE bilog("
185 " seq INTEGER PRIMARY KEY," /* Sequence of events */
186 " stat TEXT," /* Type of occurrence */
@@ -196,15 +195,27 @@
195 db_bind_text(&q, ":stat", rid>0 ? "GOOD" : "BAD");
196 db_bind_int(&q, ":rid", rid>=0 ? rid : -rid);
197 db_step(&q);
198 db_reset(&q);
199 }
200 if( iCurrent>0 ){
201 db_bind_int(&q, ":seq", ++cnt);
202 db_bind_text(&q, ":stat", "CURRENT");
203 db_bind_int(&q, ":rid", iCurrent);
204 db_step(&q);
205 }
206 db_finalize(&q);
207 }
208
209 /*
210 ** Show a chart of bisect "good" and "bad" versions. The chart can be
211 ** sorted either chronologically by bisect time, or by check-in time.
212 */
213 static void bisect_chart(int sortByCkinTime){
214 Stmt q;
215 int iCurrent = db_lget_int("checkout",0);
216 bisect_create_bilog_table(iCurrent);
217 db_prepare(&q,
218 "SELECT bilog.seq, bilog.stat,"
219 " substr(blob.uuid,1,16), datetime(event.mtime),"
220 " blob.rid==%d"
221 " FROM bilog, blob, event"
@@ -266,10 +277,15 @@
277 **
278 ** fossil bisect vlist|ls|status ?-a|--all?
279 **
280 ** List the versions in between "bad" and "good".
281 **
282 ** fossil bisect ui
283 **
284 ** Like "fossil ui" except start on a timeline that shows only the
285 ** check-ins that are part of the current bisect.
286 **
287 ** fossil bisect undo
288 **
289 ** Undo the most recent "good" or "bad" command.
290 **
291 ** Summary:
@@ -280,10 +296,11 @@
296 ** fossil bisect chart
297 ** fossil bisect next
298 ** fossil bisect options
299 ** fossil bisect reset
300 ** fossil bisect status
301 ** fossil bisect ui
302 ** fossil bisect undo
303 */
304 void bisect_cmd(void){
305 int n;
306 const char *zCmd;
@@ -421,15 +438,25 @@
438 }else if( strncmp(zCmd, "reset", n)==0 ){
439 db_multi_exec(
440 "DELETE FROM vvar WHERE name IN "
441 " ('bisect-good', 'bisect-bad', 'bisect-log')"
442 );
443 }else if( strcmp(zCmd, "ui")==0 ){
444 char *newArgv[8];
445 newArgv[0] = g.argv[0];
446 newArgv[1] = "ui";
447 newArgv[2] = "--page";
448 newArgv[3] = "timeline?bisect";
449 newArgv[4] = 0;
450 g.argv = newArgv;
451 g.argc = 4;
452 cmd_webserver();
453 }else if( strncmp(zCmd, "vlist", n)==0
454 || strncmp(zCmd, "ls", n)==0
455 || strncmp(zCmd, "status", n)==0
456 ){
457 int fAll = find_option("all", "a", 0)!=0;
458 bisect_list(!fAll);
459 }else if( !foundCmd ){
460 usage("bad|good|log|next|options|reset|status|ui|undo");
461 }
462 }
463
+6 -6
--- src/main.c
+++ src/main.c
@@ -2407,16 +2407,16 @@
24072407
const char *zNotFound; /* The --notfound option or NULL */
24082408
int flags = 0; /* Server flags */
24092409
#if !defined(_WIN32)
24102410
int noJail; /* Do not enter the chroot jail */
24112411
#endif
2412
- int allowRepoList; /* List repositories on URL "/" */
2413
- const char *zAltBase; /* Argument to the --baseurl option */
2414
- const char *zFileGlob; /* Static content must match this */
2415
- char *zIpAddr = 0; /* Bind to this IP address */
2416
- int fCreate = 0; /* The --create flag */
2417
- char *zInitPage = 0; /* Start on this page. --page option */
2412
+ int allowRepoList; /* List repositories on URL "/" */
2413
+ const char *zAltBase; /* Argument to the --baseurl option */
2414
+ const char *zFileGlob; /* Static content must match this */
2415
+ char *zIpAddr = 0; /* Bind to this IP address */
2416
+ int fCreate = 0; /* The --create flag */
2417
+ const char *zInitPage = 0; /* Start on this page. --page option */
24182418
24192419
#if defined(_WIN32)
24202420
const char *zStopperFile; /* Name of file used to terminate server */
24212421
zStopperFile = find_option("stopper", 0, 1);
24222422
#endif
24232423
--- src/main.c
+++ src/main.c
@@ -2407,16 +2407,16 @@
2407 const char *zNotFound; /* The --notfound option or NULL */
2408 int flags = 0; /* Server flags */
2409 #if !defined(_WIN32)
2410 int noJail; /* Do not enter the chroot jail */
2411 #endif
2412 int allowRepoList; /* List repositories on URL "/" */
2413 const char *zAltBase; /* Argument to the --baseurl option */
2414 const char *zFileGlob; /* Static content must match this */
2415 char *zIpAddr = 0; /* Bind to this IP address */
2416 int fCreate = 0; /* The --create flag */
2417 char *zInitPage = 0; /* Start on this page. --page option */
2418
2419 #if defined(_WIN32)
2420 const char *zStopperFile; /* Name of file used to terminate server */
2421 zStopperFile = find_option("stopper", 0, 1);
2422 #endif
2423
--- src/main.c
+++ src/main.c
@@ -2407,16 +2407,16 @@
2407 const char *zNotFound; /* The --notfound option or NULL */
2408 int flags = 0; /* Server flags */
2409 #if !defined(_WIN32)
2410 int noJail; /* Do not enter the chroot jail */
2411 #endif
2412 int allowRepoList; /* List repositories on URL "/" */
2413 const char *zAltBase; /* Argument to the --baseurl option */
2414 const char *zFileGlob; /* Static content must match this */
2415 char *zIpAddr = 0; /* Bind to this IP address */
2416 int fCreate = 0; /* The --create flag */
2417 const char *zInitPage = 0; /* Start on this page. --page option */
2418
2419 #if defined(_WIN32)
2420 const char *zStopperFile; /* Name of file used to terminate server */
2421 zStopperFile = find_option("stopper", 0, 1);
2422 #endif
2423
+35 -1
--- src/timeline.c
+++ src/timeline.c
@@ -93,10 +93,11 @@
9393
#define TIMELINE_BRCOLOR 0x0040 /* Background color by branch name */
9494
#define TIMELINE_UCOLOR 0x0080 /* Background color by user */
9595
#define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */
9696
#define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */
9797
#define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
98
+#define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */
9899
#endif
99100
100101
/*
101102
** Hash a string and use the hash to determine a background color.
102103
*/
@@ -400,10 +401,20 @@
400401
}
401402
if( modPending ){
402403
@ <span class="modpending">(Awaiting Moderator Approval)</span>
403404
}
404405
if( zType[0]=='c' ){
406
+ if( tmFlags & TIMELINE_BISECT ){
407
+ static Stmt bisectQuery;
408
+ db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
409
+ db_bind_int(&bisectQuery, ":rid", rid);
410
+ if( db_step(&bisectQuery)==SQLITE_ROW ){
411
+ @ <b>%s(db_column_text(&bisectQuery,1))</b>
412
+ @ (%d(db_column_int(&bisectQuery,0)))
413
+ }
414
+ db_reset(&bisectQuery);
415
+ }
405416
hyperlink_to_uuid(zUuid);
406417
if( isLeaf ){
407418
if( db_exists("SELECT 1 FROM tagxref"
408419
" WHERE rid=%d AND tagid=%d AND tagtype>0",
409420
rid, TAG_CLOSED) ){
@@ -1195,10 +1206,11 @@
11951206
** namechng Show only check-ins that filename changes
11961207
** forks Show only forks and their children
11971208
** ym=YYYY-MM Show only events for the given year/month.
11981209
** ymd=YYYY-MM-DD Show only events on the given day
11991210
** datefmt=N Override the date format
1211
+** bisect Show the check-ins that are in the current bisect
12001212
**
12011213
** p= and d= can appear individually or together. If either p= or d=
12021214
** appear, then u=, y=, a=, and b= are ignored.
12031215
**
12041216
** If both a= and b= appear then both upper and lower bounds are honored.
@@ -1228,10 +1240,11 @@
12281240
const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
12291241
const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */
12301242
int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
12311243
int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
12321244
int forkOnly = PB("forks"); /* Show only forks and their children */
1245
+ int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */
12331246
int tagid; /* Tag ID */
12341247
int tmFlags = 0; /* Timeline flags */
12351248
const char *zThisTag = 0; /* Suppress links to this tag */
12361249
const char *zThisUser = 0; /* Suppress links to this user */
12371250
HQuery url; /* URL for various branch links */
@@ -1272,11 +1285,13 @@
12721285
pd_rid = name_to_typed_rid(P("dp"),"ci");
12731286
if( pd_rid ){
12741287
p_rid = d_rid = pd_rid;
12751288
}
12761289
login_check_credentials();
1277
- if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
1290
+ if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki)
1291
+ || (bisectOnly && !g.perm.Setup)
1292
+ ){
12781293
login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
12791294
return;
12801295
}
12811296
url_initialize(&url, "timeline");
12821297
cgi_query_parameters_to_url(&url);
@@ -1355,10 +1370,22 @@
13551370
);
13561371
tmFlags |= TIMELINE_UNHIDE;
13571372
zType = "ci";
13581373
disableY = 1;
13591374
}
1375
+ if( bisectOnly
1376
+ && fossil_strcmp(g.zIpAddr,"127.0.0.1")==0
1377
+ && db_open_local(0)
1378
+ ){
1379
+ int iCurrent = db_lget_int("checkout",0);
1380
+ bisect_create_bilog_table(iCurrent);
1381
+ tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1382
+ zType = "ci";
1383
+ disableY = 1;
1384
+ }else{
1385
+ bisectOnly = 0;
1386
+ }
13601387
13611388
style_header("Timeline");
13621389
login_anonymous_available();
13631390
timeline_temp_table();
13641391
blob_zero(&sql);
@@ -1487,10 +1514,13 @@
14871514
blob_append_sql(&sql, " AND event.objid IN rnfile ");
14881515
}
14891516
if( forkOnly ){
14901517
blob_append_sql(&sql, " AND event.objid IN rnfork ");
14911518
}
1519
+ if( bisectOnly ){
1520
+ blob_append_sql(&sql, " AND event.objid IN (SELECT rid FROM bilog) ");
1521
+ }
14921522
if( zYearMonth ){
14931523
blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ",
14941524
zYearMonth);
14951525
}
14961526
else if( zYearWeek ){
@@ -1669,10 +1699,14 @@
16691699
}
16701700
if( forkOnly ){
16711701
blob_appendf(&desc, " associated with forks");
16721702
tmFlags |= TIMELINE_DISJOINT;
16731703
}
1704
+ if( bisectOnly ){
1705
+ blob_appendf(&desc, " in the most recent bisect");
1706
+ tmFlags |= TIMELINE_DISJOINT;
1707
+ }
16741708
if( zUser ){
16751709
blob_appendf(&desc, " by user %h", zUser);
16761710
tmFlags |= TIMELINE_DISJOINT;
16771711
}
16781712
if( zTagName ){
16791713
--- src/timeline.c
+++ src/timeline.c
@@ -93,10 +93,11 @@
93 #define TIMELINE_BRCOLOR 0x0040 /* Background color by branch name */
94 #define TIMELINE_UCOLOR 0x0080 /* Background color by user */
95 #define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */
96 #define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */
97 #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
 
98 #endif
99
100 /*
101 ** Hash a string and use the hash to determine a background color.
102 */
@@ -400,10 +401,20 @@
400 }
401 if( modPending ){
402 @ <span class="modpending">(Awaiting Moderator Approval)</span>
403 }
404 if( zType[0]=='c' ){
 
 
 
 
 
 
 
 
 
 
405 hyperlink_to_uuid(zUuid);
406 if( isLeaf ){
407 if( db_exists("SELECT 1 FROM tagxref"
408 " WHERE rid=%d AND tagid=%d AND tagtype>0",
409 rid, TAG_CLOSED) ){
@@ -1195,10 +1206,11 @@
1195 ** namechng Show only check-ins that filename changes
1196 ** forks Show only forks and their children
1197 ** ym=YYYY-MM Show only events for the given year/month.
1198 ** ymd=YYYY-MM-DD Show only events on the given day
1199 ** datefmt=N Override the date format
 
1200 **
1201 ** p= and d= can appear individually or together. If either p= or d=
1202 ** appear, then u=, y=, a=, and b= are ignored.
1203 **
1204 ** If both a= and b= appear then both upper and lower bounds are honored.
@@ -1228,10 +1240,11 @@
1228 const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
1229 const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */
1230 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1231 int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
1232 int forkOnly = PB("forks"); /* Show only forks and their children */
 
1233 int tagid; /* Tag ID */
1234 int tmFlags = 0; /* Timeline flags */
1235 const char *zThisTag = 0; /* Suppress links to this tag */
1236 const char *zThisUser = 0; /* Suppress links to this user */
1237 HQuery url; /* URL for various branch links */
@@ -1272,11 +1285,13 @@
1272 pd_rid = name_to_typed_rid(P("dp"),"ci");
1273 if( pd_rid ){
1274 p_rid = d_rid = pd_rid;
1275 }
1276 login_check_credentials();
1277 if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
 
 
1278 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
1279 return;
1280 }
1281 url_initialize(&url, "timeline");
1282 cgi_query_parameters_to_url(&url);
@@ -1355,10 +1370,22 @@
1355 );
1356 tmFlags |= TIMELINE_UNHIDE;
1357 zType = "ci";
1358 disableY = 1;
1359 }
 
 
 
 
 
 
 
 
 
 
 
 
1360
1361 style_header("Timeline");
1362 login_anonymous_available();
1363 timeline_temp_table();
1364 blob_zero(&sql);
@@ -1487,10 +1514,13 @@
1487 blob_append_sql(&sql, " AND event.objid IN rnfile ");
1488 }
1489 if( forkOnly ){
1490 blob_append_sql(&sql, " AND event.objid IN rnfork ");
1491 }
 
 
 
1492 if( zYearMonth ){
1493 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ",
1494 zYearMonth);
1495 }
1496 else if( zYearWeek ){
@@ -1669,10 +1699,14 @@
1669 }
1670 if( forkOnly ){
1671 blob_appendf(&desc, " associated with forks");
1672 tmFlags |= TIMELINE_DISJOINT;
1673 }
 
 
 
 
1674 if( zUser ){
1675 blob_appendf(&desc, " by user %h", zUser);
1676 tmFlags |= TIMELINE_DISJOINT;
1677 }
1678 if( zTagName ){
1679
--- src/timeline.c
+++ src/timeline.c
@@ -93,10 +93,11 @@
93 #define TIMELINE_BRCOLOR 0x0040 /* Background color by branch name */
94 #define TIMELINE_UCOLOR 0x0080 /* Background color by user */
95 #define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */
96 #define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */
97 #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
98 #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */
99 #endif
100
101 /*
102 ** Hash a string and use the hash to determine a background color.
103 */
@@ -400,10 +401,20 @@
401 }
402 if( modPending ){
403 @ <span class="modpending">(Awaiting Moderator Approval)</span>
404 }
405 if( zType[0]=='c' ){
406 if( tmFlags & TIMELINE_BISECT ){
407 static Stmt bisectQuery;
408 db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
409 db_bind_int(&bisectQuery, ":rid", rid);
410 if( db_step(&bisectQuery)==SQLITE_ROW ){
411 @ <b>%s(db_column_text(&bisectQuery,1))</b>
412 @ (%d(db_column_int(&bisectQuery,0)))
413 }
414 db_reset(&bisectQuery);
415 }
416 hyperlink_to_uuid(zUuid);
417 if( isLeaf ){
418 if( db_exists("SELECT 1 FROM tagxref"
419 " WHERE rid=%d AND tagid=%d AND tagtype>0",
420 rid, TAG_CLOSED) ){
@@ -1195,10 +1206,11 @@
1206 ** namechng Show only check-ins that filename changes
1207 ** forks Show only forks and their children
1208 ** ym=YYYY-MM Show only events for the given year/month.
1209 ** ymd=YYYY-MM-DD Show only events on the given day
1210 ** datefmt=N Override the date format
1211 ** bisect Show the check-ins that are in the current bisect
1212 **
1213 ** p= and d= can appear individually or together. If either p= or d=
1214 ** appear, then u=, y=, a=, and b= are ignored.
1215 **
1216 ** If both a= and b= appear then both upper and lower bounds are honored.
@@ -1228,10 +1240,11 @@
1240 const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
1241 const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */
1242 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1243 int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
1244 int forkOnly = PB("forks"); /* Show only forks and their children */
1245 int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */
1246 int tagid; /* Tag ID */
1247 int tmFlags = 0; /* Timeline flags */
1248 const char *zThisTag = 0; /* Suppress links to this tag */
1249 const char *zThisUser = 0; /* Suppress links to this user */
1250 HQuery url; /* URL for various branch links */
@@ -1272,11 +1285,13 @@
1285 pd_rid = name_to_typed_rid(P("dp"),"ci");
1286 if( pd_rid ){
1287 p_rid = d_rid = pd_rid;
1288 }
1289 login_check_credentials();
1290 if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki)
1291 || (bisectOnly && !g.perm.Setup)
1292 ){
1293 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
1294 return;
1295 }
1296 url_initialize(&url, "timeline");
1297 cgi_query_parameters_to_url(&url);
@@ -1355,10 +1370,22 @@
1370 );
1371 tmFlags |= TIMELINE_UNHIDE;
1372 zType = "ci";
1373 disableY = 1;
1374 }
1375 if( bisectOnly
1376 && fossil_strcmp(g.zIpAddr,"127.0.0.1")==0
1377 && db_open_local(0)
1378 ){
1379 int iCurrent = db_lget_int("checkout",0);
1380 bisect_create_bilog_table(iCurrent);
1381 tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1382 zType = "ci";
1383 disableY = 1;
1384 }else{
1385 bisectOnly = 0;
1386 }
1387
1388 style_header("Timeline");
1389 login_anonymous_available();
1390 timeline_temp_table();
1391 blob_zero(&sql);
@@ -1487,10 +1514,13 @@
1514 blob_append_sql(&sql, " AND event.objid IN rnfile ");
1515 }
1516 if( forkOnly ){
1517 blob_append_sql(&sql, " AND event.objid IN rnfork ");
1518 }
1519 if( bisectOnly ){
1520 blob_append_sql(&sql, " AND event.objid IN (SELECT rid FROM bilog) ");
1521 }
1522 if( zYearMonth ){
1523 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ",
1524 zYearMonth);
1525 }
1526 else if( zYearWeek ){
@@ -1669,10 +1699,14 @@
1699 }
1700 if( forkOnly ){
1701 blob_appendf(&desc, " associated with forks");
1702 tmFlags |= TIMELINE_DISJOINT;
1703 }
1704 if( bisectOnly ){
1705 blob_appendf(&desc, " in the most recent bisect");
1706 tmFlags |= TIMELINE_DISJOINT;
1707 }
1708 if( zUser ){
1709 blob_appendf(&desc, " by user %h", zUser);
1710 tmFlags |= TIMELINE_DISJOINT;
1711 }
1712 if( zTagName ){
1713

Keyboard Shortcuts

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