Fossil SCM
When running a bisect, show the span between the two extremes and the number of steps remaining after each step.
Commit
b45dd1c7b5baa34e14179bb46de144cc04affd0f296b49c0c3e2aa33bcba26fb
Parent
c21c77426c0bae1…
2 files changed
+3
+10
+3
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -385,15 +385,18 @@ | ||
| 385 | 385 | bisect_path(); |
| 386 | 386 | pMid = path_midpoint(); |
| 387 | 387 | if( pMid==0 ){ |
| 388 | 388 | fossil_print("bisect complete\n"); |
| 389 | 389 | }else{ |
| 390 | + int nSpan = path_length(); | |
| 391 | + int nStep = path_search_depth(); | |
| 390 | 392 | g.argv[1] = "update"; |
| 391 | 393 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 392 | 394 | g.argc = 3; |
| 393 | 395 | g.fNoSync = 1; |
| 394 | 396 | update_cmd(); |
| 397 | + fossil_print("span: %d steps-remaining: %d\n", nSpan, nStep); | |
| 395 | 398 | } |
| 396 | 399 | |
| 397 | 400 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 398 | 401 | bisect_chart(1); |
| 399 | 402 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 400 | 403 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -385,15 +385,18 @@ | |
| 385 | bisect_path(); |
| 386 | pMid = path_midpoint(); |
| 387 | if( pMid==0 ){ |
| 388 | fossil_print("bisect complete\n"); |
| 389 | }else{ |
| 390 | g.argv[1] = "update"; |
| 391 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 392 | g.argc = 3; |
| 393 | g.fNoSync = 1; |
| 394 | update_cmd(); |
| 395 | } |
| 396 | |
| 397 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 398 | bisect_chart(1); |
| 399 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 400 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -385,15 +385,18 @@ | |
| 385 | bisect_path(); |
| 386 | pMid = path_midpoint(); |
| 387 | if( pMid==0 ){ |
| 388 | fossil_print("bisect complete\n"); |
| 389 | }else{ |
| 390 | int nSpan = path_length(); |
| 391 | int nStep = path_search_depth(); |
| 392 | g.argv[1] = "update"; |
| 393 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 394 | g.argc = 3; |
| 395 | g.fNoSync = 1; |
| 396 | update_cmd(); |
| 397 | fossil_print("span: %d steps-remaining: %d\n", nSpan, nStep); |
| 398 | } |
| 399 | |
| 400 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 401 | bisect_chart(1); |
| 402 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 403 |
+10
| --- src/path.c | ||
| +++ src/path.c | ||
| @@ -192,10 +192,20 @@ | ||
| 192 | 192 | int i; |
| 193 | 193 | if( path.nStep<2 ) return 0; |
| 194 | 194 | for(p=path.pEnd, i=0; p && i<path.nStep/2; p=p->pFrom, i++){} |
| 195 | 195 | return p; |
| 196 | 196 | } |
| 197 | + | |
| 198 | +/* | |
| 199 | +** Return an estimate of the number of comparisons remaining in order | |
| 200 | +** to bisect path. This is based on the log2() of path.nStep. | |
| 201 | +*/ | |
| 202 | +int path_search_depth(void){ | |
| 203 | + int i, j; | |
| 204 | + for(i=0, j=1; j<path.nStep; i++, j+=j){} | |
| 205 | + return i; | |
| 206 | +} | |
| 197 | 207 | |
| 198 | 208 | /* |
| 199 | 209 | ** Compute the shortest path between two check-ins and then transfer |
| 200 | 210 | ** that path into the "ancestor" table. This is a utility used by |
| 201 | 211 | ** both /annotate and /finfo. See also: compute_direct_ancestors(). |
| 202 | 212 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -192,10 +192,20 @@ | |
| 192 | int i; |
| 193 | if( path.nStep<2 ) return 0; |
| 194 | for(p=path.pEnd, i=0; p && i<path.nStep/2; p=p->pFrom, i++){} |
| 195 | return p; |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | ** Compute the shortest path between two check-ins and then transfer |
| 200 | ** that path into the "ancestor" table. This is a utility used by |
| 201 | ** both /annotate and /finfo. See also: compute_direct_ancestors(). |
| 202 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -192,10 +192,20 @@ | |
| 192 | int i; |
| 193 | if( path.nStep<2 ) return 0; |
| 194 | for(p=path.pEnd, i=0; p && i<path.nStep/2; p=p->pFrom, i++){} |
| 195 | return p; |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | ** Return an estimate of the number of comparisons remaining in order |
| 200 | ** to bisect path. This is based on the log2() of path.nStep. |
| 201 | */ |
| 202 | int path_search_depth(void){ |
| 203 | int i, j; |
| 204 | for(i=0, j=1; j<path.nStep; i++, j+=j){} |
| 205 | return i; |
| 206 | } |
| 207 | |
| 208 | /* |
| 209 | ** Compute the shortest path between two check-ins and then transfer |
| 210 | ** that path into the "ancestor" table. This is a utility used by |
| 211 | ** both /annotate and /finfo. See also: compute_direct_ancestors(). |
| 212 |