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.

drh 2015-10-30 23:04 trunk
Commit 4da2f012662b72097cf0115e10040a2b193e0f30
1 file changed +11 -7
+11 -7
--- src/bisect.c
+++ src/bisect.c
@@ -177,16 +177,17 @@
177177
static void bisect_chart(int sortByCkinTime){
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);
182183
blob_init(&log, zLog, -1);
183184
db_multi_exec(
184185
"CREATE TEMP TABLE bilog("
185186
" seq INTEGER PRIMARY KEY," /* Sequence of events */
186187
" stat TEXT," /* Type of occurrence */
187
- " rid INTEGER" /* Check-in number */
188
+ " rid INTEGER UNIQUE" /* Check-in number */
188189
");"
189190
);
190191
db_prepare(&q, "INSERT OR IGNORE INTO bilog(seq,stat,rid)"
191192
" VALUES(:seq,:stat,:rid)");
192193
while( blob_token(&log, &id) ){
@@ -197,28 +198,31 @@
197198
db_step(&q);
198199
db_reset(&q);
199200
}
200201
db_bind_int(&q, ":seq", ++cnt);
201202
db_bind_text(&q, ":stat", "CURRENT");
202
- db_bind_int(&q, ":rid", db_lget_int("checkout", 0));
203
+ db_bind_int(&q, ":rid", iCurrent);
203204
db_step(&q);
204205
db_finalize(&q);
205206
db_prepare(&q,
206207
"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"
208210
" FROM bilog, blob, event"
209211
" WHERE blob.rid=bilog.rid AND event.objid=bilog.rid"
210212
" AND event.type='ci'"
211213
" ORDER BY %s bilog.rowid ASC",
212
- (sortByCkinTime ? "event.mtime DESC, " : "")
214
+ iCurrent, (sortByCkinTime ? "event.mtime DESC, " : "")
213215
);
214216
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",
216219
db_column_int(&q, 0),
217
- db_column_text(&q, 1),
220
+ zGoodBad,
218221
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" : "");
220224
}
221225
db_finalize(&q);
222226
}
223227
224228
/*
225229
--- 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

Keyboard Shortcuts

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