Fossil SCM

Moved a misplaced mprintf() and added a missing free() from the previous commit.

stephan 2021-02-15 16:36 leaves-command-branched-from
Commit ad9e8b99a6d565b75d8f92dac21371ca113bb866a4af2732303617ded1ed0690
1 file changed +9 -4
--- src/descendants.c
+++ src/descendants.c
@@ -506,15 +506,20 @@
506506
n++;
507507
sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
508508
fossil_print("%6s ", zLineNo);
509509
z = mprintf("root:%s", zId);
510510
ridOfRoot = symbolic_name_to_rid(z, "ci");
511
- if(ridOfRoot>0){
512
- zBranchPoint = mprintf(" Branched from [%.*z]", hash_digits(0),
513
- rid_to_uuid(ridOfRoot));
511
+ if(0!=fossil_strcmp(zBr,"trunk")){
512
+ z = mprintf("root:%s", zId);
513
+ ridOfRoot = symbolic_name_to_rid(z, "ci");
514
+ if(ridOfRoot>0){
515
+ zBranchPoint = mprintf(" (branched from: [%.*z])", hash_digits(0),
516
+ rid_to_uuid(ridOfRoot));
517
+ }
518
+ fossil_free(z);
514519
}
515
- z = mprintf("%s [%S] %s%.*s", zDate, zId, zCom,
520
+ z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
516521
zBranchPoint ? zBranchPoint : 0);
517522
comment_print(z, zCom, 7, width, get_comment_format());
518523
fossil_free(z);
519524
fossil_free(zBranchPoint);
520525
}
521526
--- src/descendants.c
+++ src/descendants.c
@@ -506,15 +506,20 @@
506 n++;
507 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
508 fossil_print("%6s ", zLineNo);
509 z = mprintf("root:%s", zId);
510 ridOfRoot = symbolic_name_to_rid(z, "ci");
511 if(ridOfRoot>0){
512 zBranchPoint = mprintf(" Branched from [%.*z]", hash_digits(0),
513 rid_to_uuid(ridOfRoot));
 
 
 
 
 
514 }
515 z = mprintf("%s [%S] %s%.*s", zDate, zId, zCom,
516 zBranchPoint ? zBranchPoint : 0);
517 comment_print(z, zCom, 7, width, get_comment_format());
518 fossil_free(z);
519 fossil_free(zBranchPoint);
520 }
521
--- src/descendants.c
+++ src/descendants.c
@@ -506,15 +506,20 @@
506 n++;
507 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
508 fossil_print("%6s ", zLineNo);
509 z = mprintf("root:%s", zId);
510 ridOfRoot = symbolic_name_to_rid(z, "ci");
511 if(0!=fossil_strcmp(zBr,"trunk")){
512 z = mprintf("root:%s", zId);
513 ridOfRoot = symbolic_name_to_rid(z, "ci");
514 if(ridOfRoot>0){
515 zBranchPoint = mprintf(" (branched from: [%.*z])", hash_digits(0),
516 rid_to_uuid(ridOfRoot));
517 }
518 fossil_free(z);
519 }
520 z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
521 zBranchPoint ? zBranchPoint : 0);
522 comment_print(z, zCom, 7, width, get_comment_format());
523 fossil_free(z);
524 fossil_free(zBranchPoint);
525 }
526

Keyboard Shortcuts

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