Fossil SCM

[/help/leaves|leaves command] now shows the branch point of each leaf.

stephan 2021-03-03 17:24 trunk merge
Commit d21e3c5a3ad30525f495bb44c0dac49c6204221ce72d64dd8ad52b5866914ea8
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -1739,11 +1739,11 @@
17391739
char *zMergeUuid;
17401740
int mid = db_column_int(&q, 0);
17411741
if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ){
17421742
continue;
17431743
}
1744
- zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
1744
+ zMergeUuid = rid_to_uuid(mid);
17451745
if( zMergeUuid ){
17461746
blob_appendf(pOut, " %s", zMergeUuid);
17471747
if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
17481748
free(zMergeUuid);
17491749
}
17501750
--- src/checkin.c
+++ src/checkin.c
@@ -1739,11 +1739,11 @@
1739 char *zMergeUuid;
1740 int mid = db_column_int(&q, 0);
1741 if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ){
1742 continue;
1743 }
1744 zMergeUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", mid);
1745 if( zMergeUuid ){
1746 blob_appendf(pOut, " %s", zMergeUuid);
1747 if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
1748 free(zMergeUuid);
1749 }
1750
--- src/checkin.c
+++ src/checkin.c
@@ -1739,11 +1739,11 @@
1739 char *zMergeUuid;
1740 int mid = db_column_int(&q, 0);
1741 if( (!g.markPrivate && content_is_private(mid)) || (mid == vid) ){
1742 continue;
1743 }
1744 zMergeUuid = rid_to_uuid(mid);
1745 if( zMergeUuid ){
1746 blob_appendf(pOut, " %s", zMergeUuid);
1747 if( p->verifyDate ) checkin_verify_younger(mid, zMergeUuid, zDate);
1748 free(zMergeUuid);
1749 }
1750
--- src/descendants.c
+++ src/descendants.c
@@ -422,10 +422,11 @@
422422
int multipleFlag = find_option("multiple","m",0)!=0;
423423
const char *zWidth = find_option("width","W",1);
424424
char *zLastBr = 0;
425425
int n, width;
426426
char zLineNo[10];
427
+ char * const zMainBranch = db_get("main-branch","trunk");
427428
428429
if( multipleFlag ) byBranch = 1;
429430
if( zWidth ){
430431
width = atoi(zWidth);
431432
if( (width!=0) && (width<=39) ){
@@ -491,11 +492,12 @@
491492
while( db_step(&q)==SQLITE_ROW ){
492493
const char *zId = db_column_text(&q, 1);
493494
const char *zDate = db_column_text(&q, 2);
494495
const char *zCom = db_column_text(&q, 3);
495496
const char *zBr = db_column_text(&q, 7);
496
- char *z;
497
+ char *z = 0;
498
+ char * zBranchPoint = 0;
497499
498500
if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
499501
fossil_print("*** %s ***\n", zBr);
500502
fossil_free(zLastBr);
501503
zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
502504
if( multipleFlag ) n = 0;
503505
}
504506
n++;
505507
sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
506508
fossil_print("%6s ", zLineNo);
507
- z = mprintf("%s [%S] %s", zDate, zId, zCom);
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));
516
+ }
517
+ fossil_free(z);
518
+ }
519
+ z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
520
+ zBranchPoint ? zBranchPoint : "");
508521
comment_print(z, zCom, 7, width, get_comment_format());
509522
fossil_free(z);
523
+ fossil_free(zBranchPoint);
510524
}
525
+ fossil_free(zMainBranch);
511526
fossil_free(zLastBr);
512527
db_finalize(&q);
513528
}
514529
515530
/*
516531
--- 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) ){
@@ -491,11 +492,12 @@
491 while( db_step(&q)==SQLITE_ROW ){
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;
 
497
498 if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
499 fossil_print("*** %s ***\n", zBr);
500 fossil_free(zLastBr);
501 zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
502 if( multipleFlag ) n = 0;
503 }
504 n++;
505 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
506 fossil_print("%6s ", zLineNo);
507 z = mprintf("%s [%S] %s", zDate, zId, zCom);
 
 
 
 
 
 
 
 
 
 
 
508 comment_print(z, zCom, 7, width, get_comment_format());
509 fossil_free(z);
 
510 }
 
511 fossil_free(zLastBr);
512 db_finalize(&q);
513 }
514
515 /*
516
--- 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) ){
@@ -491,11 +492,12 @@
492 while( db_step(&q)==SQLITE_ROW ){
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);
503 zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
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));
516 }
517 fossil_free(z);
518 }
519 z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
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
--- src/descendants.c
+++ src/descendants.c
@@ -422,10 +422,11 @@
422422
int multipleFlag = find_option("multiple","m",0)!=0;
423423
const char *zWidth = find_option("width","W",1);
424424
char *zLastBr = 0;
425425
int n, width;
426426
char zLineNo[10];
427
+ char * const zMainBranch = db_get("main-branch","trunk");
427428
428429
if( multipleFlag ) byBranch = 1;
429430
if( zWidth ){
430431
width = atoi(zWidth);
431432
if( (width!=0) && (width<=39) ){
@@ -491,11 +492,12 @@
491492
while( db_step(&q)==SQLITE_ROW ){
492493
const char *zId = db_column_text(&q, 1);
493494
const char *zDate = db_column_text(&q, 2);
494495
const char *zCom = db_column_text(&q, 3);
495496
const char *zBr = db_column_text(&q, 7);
496
- char *z;
497
+ char *z = 0;
498
+ char * zBranchPoint = 0;
497499
498500
if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
499501
fossil_print("*** %s ***\n", zBr);
500502
fossil_free(zLastBr);
501503
zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
502504
if( multipleFlag ) n = 0;
503505
}
504506
n++;
505507
sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
506508
fossil_print("%6s ", zLineNo);
507
- z = mprintf("%s [%S] %s", zDate, zId, zCom);
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));
516
+ }
517
+ fossil_free(z);
518
+ }
519
+ z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
520
+ zBranchPoint ? zBranchPoint : "");
508521
comment_print(z, zCom, 7, width, get_comment_format());
509522
fossil_free(z);
523
+ fossil_free(zBranchPoint);
510524
}
525
+ fossil_free(zMainBranch);
511526
fossil_free(zLastBr);
512527
db_finalize(&q);
513528
}
514529
515530
/*
516531
--- 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) ){
@@ -491,11 +492,12 @@
491 while( db_step(&q)==SQLITE_ROW ){
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;
 
497
498 if( byBranch && fossil_strcmp(zBr, zLastBr)!=0 ){
499 fossil_print("*** %s ***\n", zBr);
500 fossil_free(zLastBr);
501 zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
502 if( multipleFlag ) n = 0;
503 }
504 n++;
505 sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n);
506 fossil_print("%6s ", zLineNo);
507 z = mprintf("%s [%S] %s", zDate, zId, zCom);
 
 
 
 
 
 
 
 
 
 
 
508 comment_print(z, zCom, 7, width, get_comment_format());
509 fossil_free(z);
 
510 }
 
511 fossil_free(zLastBr);
512 db_finalize(&q);
513 }
514
515 /*
516
--- 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) ){
@@ -491,11 +492,12 @@
492 while( db_step(&q)==SQLITE_ROW ){
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);
503 zLastBr = fossil_strdup(zBr);
@@ -502,14 +504,27 @@
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));
516 }
517 fossil_free(z);
518 }
519 z = mprintf("%s [%S] %s%s", zDate, zId, zCom,
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
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
5151
javascript file.
5252
* New TH1 commands:
5353
"[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
5454
"[/doc/trunk/www/th1.md#capexpr|capexpr]",
5555
"foreach", "lappend", and "string match"
56
+ * The [/help/leaves|leaves command] now shows the branch point
57
+ of each leaf.
5658
5759
<a name='v2_14'></a>
5860
<h2>Changes for Version 2.14 (2021-01-20)</h2>
5961
6062
* <b>Schema Update Notice #1:</b>
6163
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
51 javascript file.
52 * New TH1 commands:
53 "[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
54 "[/doc/trunk/www/th1.md#capexpr|capexpr]",
55 "foreach", "lappend", and "string match"
 
 
56
57 <a name='v2_14'></a>
58 <h2>Changes for Version 2.14 (2021-01-20)</h2>
59
60 * <b>Schema Update Notice #1:</b>
61
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
51 javascript file.
52 * New TH1 commands:
53 "[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
54 "[/doc/trunk/www/th1.md#capexpr|capexpr]",
55 "foreach", "lappend", and "string match"
56 * The [/help/leaves|leaves command] now shows the branch point
57 of each leaf.
58
59 <a name='v2_14'></a>
60 <h2>Changes for Version 2.14 (2021-01-20)</h2>
61
62 * <b>Schema Update Notice #1:</b>
63
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
5151
javascript file.
5252
* New TH1 commands:
5353
"[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
5454
"[/doc/trunk/www/th1.md#capexpr|capexpr]",
5555
"foreach", "lappend", and "string match"
56
+ * The [/help/leaves|leaves command] now shows the branch point
57
+ of each leaf.
5658
5759
<a name='v2_14'></a>
5860
<h2>Changes for Version 2.14 (2021-01-20)</h2>
5961
6062
* <b>Schema Update Notice #1:</b>
6163
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
51 javascript file.
52 * New TH1 commands:
53 "[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
54 "[/doc/trunk/www/th1.md#capexpr|capexpr]",
55 "foreach", "lappend", and "string match"
 
 
56
57 <a name='v2_14'></a>
58 <h2>Changes for Version 2.14 (2021-01-20)</h2>
59
60 * <b>Schema Update Notice #1:</b>
61
--- www/changes.wiki
+++ www/changes.wiki
@@ -51,10 +51,12 @@
51 javascript file.
52 * New TH1 commands:
53 "[/doc/trunk/www/th1.md#bireqjs|builtin_request_js]",
54 "[/doc/trunk/www/th1.md#capexpr|capexpr]",
55 "foreach", "lappend", and "string match"
56 * The [/help/leaves|leaves command] now shows the branch point
57 of each leaf.
58
59 <a name='v2_14'></a>
60 <h2>Changes for Version 2.14 (2021-01-20)</h2>
61
62 * <b>Schema Update Notice #1:</b>
63

Keyboard Shortcuts

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