Fossil SCM
Use main-branch setting, instead of hard-coded trunk, for determining whether a given leaf should show its branch point, per forum feedback.
Commit
0d5349cd1c41a9ef927af14557b25ffeb87f18731f2886a102f26cd9ac07a41c
Parent
39067976f30ee19…
1 file changed
+4
-2
+4
-2
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -422,10 +422,11 @@ | ||
| 422 | 422 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 423 | 423 | const char *zWidth = find_option("width","W",1); |
| 424 | 424 | char *zLastBr = 0; |
| 425 | 425 | int n, width; |
| 426 | 426 | char zLineNo[10]; |
| 427 | + char * const zMainBranch = db_get("main-branch","trunk"); | |
| 427 | 428 | |
| 428 | 429 | if( multipleFlag ) byBranch = 1; |
| 429 | 430 | if( zWidth ){ |
| 430 | 431 | width = atoi(zWidth); |
| 431 | 432 | if( (width!=0) && (width<=39) ){ |
| @@ -492,11 +493,10 @@ | ||
| 492 | 493 | const char *zId = db_column_text(&q, 1); |
| 493 | 494 | const char *zDate = db_column_text(&q, 2); |
| 494 | 495 | const char *zCom = db_column_text(&q, 3); |
| 495 | 496 | const char *zBr = db_column_text(&q, 7); |
| 496 | 497 | char *z = 0; |
| 497 | - int ridOfRoot = 0; | |
| 498 | 498 | char * zBranchPoint = 0; |
| 499 | 499 | |
| 500 | 500 | if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){ |
| 501 | 501 | fossil_print("*** %s ***\n", zBr); |
| 502 | 502 | fossil_free(zLastBr); |
| @@ -504,11 +504,12 @@ | ||
| 504 | 504 | if( multipleFlag ) n = 0; |
| 505 | 505 | } |
| 506 | 506 | n++; |
| 507 | 507 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 508 | 508 | fossil_print("%6s ", zLineNo); |
| 509 | - if(0!=fossil_strcmp(zBr,"trunk")){ | |
| 509 | + if(0!=fossil_strcmp(zBr,zMainBranch)){ | |
| 510 | + int ridOfRoot; | |
| 510 | 511 | z = mprintf("root:%s", zId); |
| 511 | 512 | ridOfRoot = symbolic_name_to_rid(z, "ci"); |
| 512 | 513 | if(ridOfRoot>0){ |
| 513 | 514 | zBranchPoint = mprintf(" (branched from: [%.*z])", hash_digits(0), |
| 514 | 515 | rid_to_uuid(ridOfRoot)); |
| @@ -519,10 +520,11 @@ | ||
| 519 | 520 | zBranchPoint ? zBranchPoint : ""); |
| 520 | 521 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 521 | 522 | fossil_free(z); |
| 522 | 523 | fossil_free(zBranchPoint); |
| 523 | 524 | } |
| 525 | + fossil_free(zMainBranch); | |
| 524 | 526 | fossil_free(zLastBr); |
| 525 | 527 | db_finalize(&q); |
| 526 | 528 | } |
| 527 | 529 | |
| 528 | 530 | /* |
| 529 | 531 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -422,10 +422,11 @@ | |
| 422 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 423 | const char *zWidth = find_option("width","W",1); |
| 424 | char *zLastBr = 0; |
| 425 | int n, width; |
| 426 | char zLineNo[10]; |
| 427 | |
| 428 | if( multipleFlag ) byBranch = 1; |
| 429 | if( zWidth ){ |
| 430 | width = atoi(zWidth); |
| 431 | if( (width!=0) && (width<=39) ){ |
| @@ -492,11 +493,10 @@ | |
| 492 | const char *zId = db_column_text(&q, 1); |
| 493 | const char *zDate = db_column_text(&q, 2); |
| 494 | const char *zCom = db_column_text(&q, 3); |
| 495 | const char *zBr = db_column_text(&q, 7); |
| 496 | char *z = 0; |
| 497 | int ridOfRoot = 0; |
| 498 | char * zBranchPoint = 0; |
| 499 | |
| 500 | if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){ |
| 501 | fossil_print("*** %s ***\n", zBr); |
| 502 | fossil_free(zLastBr); |
| @@ -504,11 +504,12 @@ | |
| 504 | if( multipleFlag ) n = 0; |
| 505 | } |
| 506 | n++; |
| 507 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 508 | fossil_print("%6s ", zLineNo); |
| 509 | if(0!=fossil_strcmp(zBr,"trunk")){ |
| 510 | z = mprintf("root:%s", zId); |
| 511 | ridOfRoot = symbolic_name_to_rid(z, "ci"); |
| 512 | if(ridOfRoot>0){ |
| 513 | zBranchPoint = mprintf(" (branched from: [%.*z])", hash_digits(0), |
| 514 | rid_to_uuid(ridOfRoot)); |
| @@ -519,10 +520,11 @@ | |
| 519 | zBranchPoint ? zBranchPoint : ""); |
| 520 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 521 | fossil_free(z); |
| 522 | fossil_free(zBranchPoint); |
| 523 | } |
| 524 | fossil_free(zLastBr); |
| 525 | db_finalize(&q); |
| 526 | } |
| 527 | |
| 528 | /* |
| 529 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -422,10 +422,11 @@ | |
| 422 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 423 | const char *zWidth = find_option("width","W",1); |
| 424 | char *zLastBr = 0; |
| 425 | int n, width; |
| 426 | char zLineNo[10]; |
| 427 | char * const zMainBranch = db_get("main-branch","trunk"); |
| 428 | |
| 429 | if( multipleFlag ) byBranch = 1; |
| 430 | if( zWidth ){ |
| 431 | width = atoi(zWidth); |
| 432 | if( (width!=0) && (width<=39) ){ |
| @@ -492,11 +493,10 @@ | |
| 493 | const char *zId = db_column_text(&q, 1); |
| 494 | const char *zDate = db_column_text(&q, 2); |
| 495 | const char *zCom = db_column_text(&q, 3); |
| 496 | const char *zBr = db_column_text(&q, 7); |
| 497 | char *z = 0; |
| 498 | char * zBranchPoint = 0; |
| 499 | |
| 500 | if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){ |
| 501 | fossil_print("*** %s ***\n", zBr); |
| 502 | fossil_free(zLastBr); |
| @@ -504,11 +504,12 @@ | |
| 504 | if( multipleFlag ) n = 0; |
| 505 | } |
| 506 | n++; |
| 507 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 508 | fossil_print("%6s ", zLineNo); |
| 509 | if(0!=fossil_strcmp(zBr,zMainBranch)){ |
| 510 | int ridOfRoot; |
| 511 | z = mprintf("root:%s", zId); |
| 512 | ridOfRoot = symbolic_name_to_rid(z, "ci"); |
| 513 | if(ridOfRoot>0){ |
| 514 | zBranchPoint = mprintf(" (branched from: [%.*z])", hash_digits(0), |
| 515 | rid_to_uuid(ridOfRoot)); |
| @@ -519,10 +520,11 @@ | |
| 520 | zBranchPoint ? zBranchPoint : ""); |
| 521 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 522 | fossil_free(z); |
| 523 | fossil_free(zBranchPoint); |
| 524 | } |
| 525 | fossil_free(zMainBranch); |
| 526 | fossil_free(zLastBr); |
| 527 | db_finalize(&q); |
| 528 | } |
| 529 | |
| 530 | /* |
| 531 |