Fossil SCM
Update the "fossil bisect chart" display so that no check-in is shown more than once. CURRENT is marked on the right if it overlaps with a GOOD or BAD check-in.
Commit
4da2f012662b72097cf0115e10040a2b193e0f30
Parent
f188505daff63ca…
1 file changed
+11
-7
+11
-7
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -177,16 +177,17 @@ | ||
| 177 | 177 | static void bisect_chart(int sortByCkinTime){ |
| 178 | 178 | char *zLog = db_lget("bisect-log",""); |
| 179 | 179 | Blob log, id; |
| 180 | 180 | Stmt q; |
| 181 | 181 | int cnt = 0; |
| 182 | + int iCurrent = db_lget_int("checkout",0); | |
| 182 | 183 | blob_init(&log, zLog, -1); |
| 183 | 184 | db_multi_exec( |
| 184 | 185 | "CREATE TEMP TABLE bilog(" |
| 185 | 186 | " seq INTEGER PRIMARY KEY," /* Sequence of events */ |
| 186 | 187 | " stat TEXT," /* Type of occurrence */ |
| 187 | - " rid INTEGER" /* Check-in number */ | |
| 188 | + " rid INTEGER UNIQUE" /* Check-in number */ | |
| 188 | 189 | ");" |
| 189 | 190 | ); |
| 190 | 191 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 191 | 192 | " VALUES(:seq,:stat,:rid)"); |
| 192 | 193 | while( blob_token(&log, &id) ){ |
| @@ -197,28 +198,31 @@ | ||
| 197 | 198 | db_step(&q); |
| 198 | 199 | db_reset(&q); |
| 199 | 200 | } |
| 200 | 201 | db_bind_int(&q, ":seq", ++cnt); |
| 201 | 202 | db_bind_text(&q, ":stat", "CURRENT"); |
| 202 | - db_bind_int(&q, ":rid", db_lget_int("checkout", 0)); | |
| 203 | + db_bind_int(&q, ":rid", iCurrent); | |
| 203 | 204 | db_step(&q); |
| 204 | 205 | db_finalize(&q); |
| 205 | 206 | db_prepare(&q, |
| 206 | 207 | "SELECT bilog.seq, bilog.stat," |
| 207 | - " substr(blob.uuid,1,16), datetime(event.mtime)" | |
| 208 | + " substr(blob.uuid,1,16), datetime(event.mtime)," | |
| 209 | + " blob.rid==%d" | |
| 208 | 210 | " FROM bilog, blob, event" |
| 209 | 211 | " WHERE blob.rid=bilog.rid AND event.objid=bilog.rid" |
| 210 | 212 | " AND event.type='ci'" |
| 211 | 213 | " ORDER BY %s bilog.rowid ASC", |
| 212 | - (sortByCkinTime ? "event.mtime DESC, " : "") | |
| 214 | + iCurrent, (sortByCkinTime ? "event.mtime DESC, " : "") | |
| 213 | 215 | ); |
| 214 | 216 | while( db_step(&q)==SQLITE_ROW ){ |
| 215 | - fossil_print("%3d %-7s %s %s\n", | |
| 217 | + const char *zGoodBad = db_column_text(&q, 1); | |
| 218 | + fossil_print("%3d %-7s %s %s%s\n", | |
| 216 | 219 | db_column_int(&q, 0), |
| 217 | - db_column_text(&q, 1), | |
| 220 | + zGoodBad, | |
| 218 | 221 | db_column_text(&q, 3), |
| 219 | - db_column_text(&q, 2)); | |
| 222 | + db_column_text(&q, 2), | |
| 223 | + (db_column_int(&q, 4) && zGoodBad[0]!='C') ? " CURRENT" : ""); | |
| 220 | 224 | } |
| 221 | 225 | db_finalize(&q); |
| 222 | 226 | } |
| 223 | 227 | |
| 224 | 228 | /* |
| 225 | 229 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -177,16 +177,17 @@ | |
| 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 | 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 */ |
| 187 | " rid INTEGER" /* Check-in number */ |
| 188 | ");" |
| 189 | ); |
| 190 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 191 | " VALUES(:seq,:stat,:rid)"); |
| 192 | while( blob_token(&log, &id) ){ |
| @@ -197,28 +198,31 @@ | |
| 197 | db_step(&q); |
| 198 | db_reset(&q); |
| 199 | } |
| 200 | db_bind_int(&q, ":seq", ++cnt); |
| 201 | db_bind_text(&q, ":stat", "CURRENT"); |
| 202 | db_bind_int(&q, ":rid", db_lget_int("checkout", 0)); |
| 203 | db_step(&q); |
| 204 | db_finalize(&q); |
| 205 | db_prepare(&q, |
| 206 | "SELECT bilog.seq, bilog.stat," |
| 207 | " substr(blob.uuid,1,16), datetime(event.mtime)" |
| 208 | " FROM bilog, blob, event" |
| 209 | " WHERE blob.rid=bilog.rid AND event.objid=bilog.rid" |
| 210 | " AND event.type='ci'" |
| 211 | " ORDER BY %s bilog.rowid ASC", |
| 212 | (sortByCkinTime ? "event.mtime DESC, " : "") |
| 213 | ); |
| 214 | while( db_step(&q)==SQLITE_ROW ){ |
| 215 | fossil_print("%3d %-7s %s %s\n", |
| 216 | db_column_int(&q, 0), |
| 217 | db_column_text(&q, 1), |
| 218 | db_column_text(&q, 3), |
| 219 | db_column_text(&q, 2)); |
| 220 | } |
| 221 | db_finalize(&q); |
| 222 | } |
| 223 | |
| 224 | /* |
| 225 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -177,16 +177,17 @@ | |
| 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 */ |
| 188 | " rid INTEGER UNIQUE" /* Check-in number */ |
| 189 | ");" |
| 190 | ); |
| 191 | db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)" |
| 192 | " VALUES(:seq,:stat,:rid)"); |
| 193 | while( blob_token(&log, &id) ){ |
| @@ -197,28 +198,31 @@ | |
| 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" |
| 211 | " WHERE blob.rid=bilog.rid AND event.objid=bilog.rid" |
| 212 | " AND event.type='ci'" |
| 213 | " ORDER BY %s bilog.rowid ASC", |
| 214 | iCurrent, (sortByCkinTime ? "event.mtime DESC, " : "") |
| 215 | ); |
| 216 | while( db_step(&q)==SQLITE_ROW ){ |
| 217 | const char *zGoodBad = db_column_text(&q, 1); |
| 218 | fossil_print("%3d %-7s %s %s%s\n", |
| 219 | db_column_int(&q, 0), |
| 220 | zGoodBad, |
| 221 | db_column_text(&q, 3), |
| 222 | db_column_text(&q, 2), |
| 223 | (db_column_int(&q, 4) && zGoodBad[0]!='C') ? " CURRENT" : ""); |
| 224 | } |
| 225 | db_finalize(&q); |
| 226 | } |
| 227 | |
| 228 | /* |
| 229 |