Fossil SCM
Enhance the /timeline "bisect" and "bid" views so that they shows all unresolved checkins in between the innermost good and bad checkins.
Commit
8a0fd6fb5c19a3def7965422ac38b0787211496207b2e4d5882e020ea94e8341
Parent
4acb9cd27659870…
2 files changed
+27
-4
+1
-1
+27
-4
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -177,10 +177,12 @@ | ||
| 177 | 177 | int bisect_create_bilog_table(int iCurrent, const char *zDesc){ |
| 178 | 178 | char *zLog; |
| 179 | 179 | Blob log, id; |
| 180 | 180 | Stmt q; |
| 181 | 181 | int cnt = 0; |
| 182 | + int lastGood = -1; | |
| 183 | + int lastBad = -1; | |
| 182 | 184 | |
| 183 | 185 | if( zDesc!=0 ){ |
| 184 | 186 | blob_init(&log, 0, 0); |
| 185 | 187 | while( zDesc[0]=='y' || zDesc[0]=='n' ){ |
| 186 | 188 | int i; |
| @@ -204,30 +206,51 @@ | ||
| 204 | 206 | zLog = db_lget("bisect-log",""); |
| 205 | 207 | blob_init(&log, zLog, -1); |
| 206 | 208 | } |
| 207 | 209 | db_multi_exec( |
| 208 | 210 | "CREATE TEMP TABLE bilog(" |
| 209 | - " seq INTEGER PRIMARY KEY," /* Sequence of events */ | |
| 211 | + " rid INTEGER PRIMARY KEY," /* Sequence of events */ | |
| 210 | 212 | " stat TEXT," /* Type of occurrence */ |
| 211 | - " rid INTEGER UNIQUE" /* Check-in number */ | |
| 213 | + " seq INTEGER UNIQUE" /* Check-in number */ | |
| 212 | 214 | ");" |
| 213 | 215 | ); |
| 214 | 216 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 215 | 217 | " VALUES(:seq,:stat,:rid)"); |
| 216 | 218 | while( blob_token(&log, &id) ){ |
| 217 | 219 | int rid = atoi(blob_str(&id)); |
| 218 | 220 | db_bind_int(&q, ":seq", ++cnt); |
| 219 | - db_bind_text(&q, ":stat", rid>0 ? "GOOD" : "BAD"); | |
| 220 | - db_bind_int(&q, ":rid", rid>=0 ? rid : -rid); | |
| 221 | + if( rid>0 ){ | |
| 222 | + db_bind_text(&q, ":stat","GOOD"); | |
| 223 | + db_bind_int(&q, ":rid", rid); | |
| 224 | + lastGood = rid; | |
| 225 | + }else{ | |
| 226 | + db_bind_text(&q, ":stat", "BAD"); | |
| 227 | + db_bind_int(&q, ":rid", -rid); | |
| 228 | + lastBad = -rid; | |
| 229 | + } | |
| 221 | 230 | db_step(&q); |
| 222 | 231 | db_reset(&q); |
| 223 | 232 | } |
| 224 | 233 | if( iCurrent>0 ){ |
| 225 | 234 | db_bind_int(&q, ":seq", ++cnt); |
| 226 | 235 | db_bind_text(&q, ":stat", "CURRENT"); |
| 227 | 236 | db_bind_int(&q, ":rid", iCurrent); |
| 228 | 237 | db_step(&q); |
| 238 | + db_reset(&q); | |
| 239 | + } | |
| 240 | + if( lastGood>0 && lastBad>0 ){ | |
| 241 | + PathNode *p; | |
| 242 | + p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0); | |
| 243 | + while( p ){ | |
| 244 | + db_bind_null(&q, ":seq"); | |
| 245 | + db_bind_null(&q, ":stat"); | |
| 246 | + db_bind_int(&q, ":rid", p->rid); | |
| 247 | + db_step(&q); | |
| 248 | + db_reset(&q); | |
| 249 | + p = p->u.pTo; | |
| 250 | + } | |
| 251 | + path_reset(); | |
| 229 | 252 | } |
| 230 | 253 | db_finalize(&q); |
| 231 | 254 | return 1; |
| 232 | 255 | } |
| 233 | 256 | |
| 234 | 257 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -177,10 +177,12 @@ | |
| 177 | int bisect_create_bilog_table(int iCurrent, const char *zDesc){ |
| 178 | char *zLog; |
| 179 | Blob log, id; |
| 180 | Stmt q; |
| 181 | int cnt = 0; |
| 182 | |
| 183 | if( zDesc!=0 ){ |
| 184 | blob_init(&log, 0, 0); |
| 185 | while( zDesc[0]=='y' || zDesc[0]=='n' ){ |
| 186 | int i; |
| @@ -204,30 +206,51 @@ | |
| 204 | zLog = db_lget("bisect-log",""); |
| 205 | blob_init(&log, zLog, -1); |
| 206 | } |
| 207 | db_multi_exec( |
| 208 | "CREATE TEMP TABLE bilog(" |
| 209 | " seq INTEGER PRIMARY KEY," /* Sequence of events */ |
| 210 | " stat TEXT," /* Type of occurrence */ |
| 211 | " rid INTEGER UNIQUE" /* Check-in number */ |
| 212 | ");" |
| 213 | ); |
| 214 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 215 | " VALUES(:seq,:stat,:rid)"); |
| 216 | while( blob_token(&log, &id) ){ |
| 217 | int rid = atoi(blob_str(&id)); |
| 218 | db_bind_int(&q, ":seq", ++cnt); |
| 219 | db_bind_text(&q, ":stat", rid>0 ? "GOOD" : "BAD"); |
| 220 | db_bind_int(&q, ":rid", rid>=0 ? rid : -rid); |
| 221 | db_step(&q); |
| 222 | db_reset(&q); |
| 223 | } |
| 224 | if( iCurrent>0 ){ |
| 225 | db_bind_int(&q, ":seq", ++cnt); |
| 226 | db_bind_text(&q, ":stat", "CURRENT"); |
| 227 | db_bind_int(&q, ":rid", iCurrent); |
| 228 | db_step(&q); |
| 229 | } |
| 230 | db_finalize(&q); |
| 231 | return 1; |
| 232 | } |
| 233 | |
| 234 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -177,10 +177,12 @@ | |
| 177 | int bisect_create_bilog_table(int iCurrent, const char *zDesc){ |
| 178 | char *zLog; |
| 179 | Blob log, id; |
| 180 | Stmt q; |
| 181 | int cnt = 0; |
| 182 | int lastGood = -1; |
| 183 | int lastBad = -1; |
| 184 | |
| 185 | if( zDesc!=0 ){ |
| 186 | blob_init(&log, 0, 0); |
| 187 | while( zDesc[0]=='y' || zDesc[0]=='n' ){ |
| 188 | int i; |
| @@ -204,30 +206,51 @@ | |
| 206 | zLog = db_lget("bisect-log",""); |
| 207 | blob_init(&log, zLog, -1); |
| 208 | } |
| 209 | db_multi_exec( |
| 210 | "CREATE TEMP TABLE bilog(" |
| 211 | " rid INTEGER PRIMARY KEY," /* Sequence of events */ |
| 212 | " stat TEXT," /* Type of occurrence */ |
| 213 | " seq INTEGER UNIQUE" /* Check-in number */ |
| 214 | ");" |
| 215 | ); |
| 216 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 217 | " VALUES(:seq,:stat,:rid)"); |
| 218 | while( blob_token(&log, &id) ){ |
| 219 | int rid = atoi(blob_str(&id)); |
| 220 | db_bind_int(&q, ":seq", ++cnt); |
| 221 | if( rid>0 ){ |
| 222 | db_bind_text(&q, ":stat","GOOD"); |
| 223 | db_bind_int(&q, ":rid", rid); |
| 224 | lastGood = rid; |
| 225 | }else{ |
| 226 | db_bind_text(&q, ":stat", "BAD"); |
| 227 | db_bind_int(&q, ":rid", -rid); |
| 228 | lastBad = -rid; |
| 229 | } |
| 230 | db_step(&q); |
| 231 | db_reset(&q); |
| 232 | } |
| 233 | if( iCurrent>0 ){ |
| 234 | db_bind_int(&q, ":seq", ++cnt); |
| 235 | db_bind_text(&q, ":stat", "CURRENT"); |
| 236 | db_bind_int(&q, ":rid", iCurrent); |
| 237 | db_step(&q); |
| 238 | db_reset(&q); |
| 239 | } |
| 240 | if( lastGood>0 && lastBad>0 ){ |
| 241 | PathNode *p; |
| 242 | p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0); |
| 243 | while( p ){ |
| 244 | db_bind_null(&q, ":seq"); |
| 245 | db_bind_null(&q, ":stat"); |
| 246 | db_bind_int(&q, ":rid", p->rid); |
| 247 | db_step(&q); |
| 248 | db_reset(&q); |
| 249 | p = p->u.pTo; |
| 250 | } |
| 251 | path_reset(); |
| 252 | } |
| 253 | db_finalize(&q); |
| 254 | return 1; |
| 255 | } |
| 256 | |
| 257 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -516,11 +516,11 @@ | ||
| 516 | 516 | @ <span class="modpending">(Awaiting Moderator Approval)</span> |
| 517 | 517 | } |
| 518 | 518 | if( (tmFlags & TIMELINE_BISECT)!=0 && zType[0]=='c' ){ |
| 519 | 519 | static Stmt bisectQuery; |
| 520 | 520 | db_static_prepare(&bisectQuery, |
| 521 | - "SELECT seq, stat FROM bilog WHERE rid=:rid"); | |
| 521 | + "SELECT seq, stat FROM bilog WHERE rid=:rid AND seq"); | |
| 522 | 522 | db_bind_int(&bisectQuery, ":rid", rid); |
| 523 | 523 | if( db_step(&bisectQuery)==SQLITE_ROW ){ |
| 524 | 524 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 525 | 525 | @ (%d(db_column_int(&bisectQuery,0))) |
| 526 | 526 | } |
| 527 | 527 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -516,11 +516,11 @@ | |
| 516 | @ <span class="modpending">(Awaiting Moderator Approval)</span> |
| 517 | } |
| 518 | if( (tmFlags & TIMELINE_BISECT)!=0 && zType[0]=='c' ){ |
| 519 | static Stmt bisectQuery; |
| 520 | db_static_prepare(&bisectQuery, |
| 521 | "SELECT seq, stat FROM bilog WHERE rid=:rid"); |
| 522 | db_bind_int(&bisectQuery, ":rid", rid); |
| 523 | if( db_step(&bisectQuery)==SQLITE_ROW ){ |
| 524 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 525 | @ (%d(db_column_int(&bisectQuery,0))) |
| 526 | } |
| 527 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -516,11 +516,11 @@ | |
| 516 | @ <span class="modpending">(Awaiting Moderator Approval)</span> |
| 517 | } |
| 518 | if( (tmFlags & TIMELINE_BISECT)!=0 && zType[0]=='c' ){ |
| 519 | static Stmt bisectQuery; |
| 520 | db_static_prepare(&bisectQuery, |
| 521 | "SELECT seq, stat FROM bilog WHERE rid=:rid AND seq"); |
| 522 | db_bind_int(&bisectQuery, ":rid", rid); |
| 523 | if( db_step(&bisectQuery)==SQLITE_ROW ){ |
| 524 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 525 | @ (%d(db_column_int(&bisectQuery,0))) |
| 526 | } |
| 527 |