Fossil SCM

Improved subtitle for /timeline graphs that use "min": Now tells the total number of nodes on the path including those that were skipped.

drh 2025-03-09 10:34 min-from-to
Commit 2229b2f6f1bfe5adaf139a0d18d81dc9f596eadd4a541ddec2fcf52115cfd954
2 files changed +1 -1 +5 -4
+1 -1
--- src/path.c
+++ src/path.c
@@ -181,11 +181,11 @@
181181
int iFrom, /* Path starts here */
182182
int iTo, /* Path ends here */
183183
int directOnly, /* No merge links if true */
184184
int oneWayOnly, /* Parent->child only if true */
185185
Bag *pHidden, /* Hidden nodes */
186
- int branchCost /* Add extra codes to changing branches */
186
+ int branchCost /* Add extra cost to changing branches */
187187
){
188188
Stmt s;
189189
Bag seen;
190190
PathNode *p;
191191
192192
--- src/path.c
+++ src/path.c
@@ -181,11 +181,11 @@
181 int iFrom, /* Path starts here */
182 int iTo, /* Path ends here */
183 int directOnly, /* No merge links if true */
184 int oneWayOnly, /* Parent->child only if true */
185 Bag *pHidden, /* Hidden nodes */
186 int branchCost /* Add extra codes to changing branches */
187 ){
188 Stmt s;
189 Bag seen;
190 PathNode *p;
191
192
--- src/path.c
+++ src/path.c
@@ -181,11 +181,11 @@
181 int iFrom, /* Path starts here */
182 int iTo, /* Path ends here */
183 int directOnly, /* No merge links if true */
184 int oneWayOnly, /* Parent->child only if true */
185 Bag *pHidden, /* Hidden nodes */
186 int branchCost /* Add extra cost to changing branches */
187 ){
188 Stmt s;
189 Bag seen;
190 PathNode *p;
191
192
+5 -4
--- src/timeline.c
+++ src/timeline.c
@@ -2075,10 +2075,11 @@
20752075
Blob ins;
20762076
int nNodeOnPath = 0;
20772077
int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
20782078
int earlierRid = 0, laterRid = 0;
20792079
int cost = bShort ? 0 : 1;
2080
+ int nSkip = 0;
20802081
20812082
if( from_rid && to_rid ){
20822083
if( from_to_mode==0 ){
20832084
p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
20842085
}else if( from_to_mode==1 ){
@@ -2122,13 +2123,12 @@
21222123
if( bMin
21232124
&& p->u.pTo!=0
21242125
&& fossil_strcmp(path_branch(p->pFrom),path_branch(p))==0
21252126
&& fossil_strcmp(path_branch(p),path_branch(p->u.pTo))==0
21262127
){
2127
- continue;
2128
- }
2129
- if( cnt==8 ){
2128
+ nSkip++;
2129
+ }else if( cnt==8 ){
21302130
blob_append_sql(&ins, ",\n (%d)", p->rid);
21312131
cnt = 0;
21322132
}else{
21332133
cnt++;
21342134
blob_append_sql(&ins, ",(%d)", p->rid);
@@ -2195,11 +2195,12 @@
21952195
}
21962196
nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
21972197
if( nNodeOnPath==1 && from_to_mode>0 ){
21982198
blob_appendf(&desc,"Check-in ");
21992199
}else if( bMin ){
2200
- blob_appendf(&desc, "%d check-ins along the path from ", nNodeOnPath);
2200
+ blob_appendf(&desc, "%d of %d check-ins along the path from ",
2201
+ nNodeOnPath, nNodeOnPath+nSkip);
22012202
}else{
22022203
blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
22032204
}
22042205
if( from_rid==selectedRid ){
22052206
blob_appendf(&desc, "<span class='timelineSelected'>");
22062207
--- src/timeline.c
+++ src/timeline.c
@@ -2075,10 +2075,11 @@
2075 Blob ins;
2076 int nNodeOnPath = 0;
2077 int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
2078 int earlierRid = 0, laterRid = 0;
2079 int cost = bShort ? 0 : 1;
 
2080
2081 if( from_rid && to_rid ){
2082 if( from_to_mode==0 ){
2083 p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
2084 }else if( from_to_mode==1 ){
@@ -2122,13 +2123,12 @@
2122 if( bMin
2123 && p->u.pTo!=0
2124 && fossil_strcmp(path_branch(p->pFrom),path_branch(p))==0
2125 && fossil_strcmp(path_branch(p),path_branch(p->u.pTo))==0
2126 ){
2127 continue;
2128 }
2129 if( cnt==8 ){
2130 blob_append_sql(&ins, ",\n (%d)", p->rid);
2131 cnt = 0;
2132 }else{
2133 cnt++;
2134 blob_append_sql(&ins, ",(%d)", p->rid);
@@ -2195,11 +2195,12 @@
2195 }
2196 nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
2197 if( nNodeOnPath==1 && from_to_mode>0 ){
2198 blob_appendf(&desc,"Check-in ");
2199 }else if( bMin ){
2200 blob_appendf(&desc, "%d check-ins along the path from ", nNodeOnPath);
 
2201 }else{
2202 blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
2203 }
2204 if( from_rid==selectedRid ){
2205 blob_appendf(&desc, "<span class='timelineSelected'>");
2206
--- src/timeline.c
+++ src/timeline.c
@@ -2075,10 +2075,11 @@
2075 Blob ins;
2076 int nNodeOnPath = 0;
2077 int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
2078 int earlierRid = 0, laterRid = 0;
2079 int cost = bShort ? 0 : 1;
2080 int nSkip = 0;
2081
2082 if( from_rid && to_rid ){
2083 if( from_to_mode==0 ){
2084 p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
2085 }else if( from_to_mode==1 ){
@@ -2122,13 +2123,12 @@
2123 if( bMin
2124 && p->u.pTo!=0
2125 && fossil_strcmp(path_branch(p->pFrom),path_branch(p))==0
2126 && fossil_strcmp(path_branch(p),path_branch(p->u.pTo))==0
2127 ){
2128 nSkip++;
2129 }else if( cnt==8 ){
 
2130 blob_append_sql(&ins, ",\n (%d)", p->rid);
2131 cnt = 0;
2132 }else{
2133 cnt++;
2134 blob_append_sql(&ins, ",(%d)", p->rid);
@@ -2195,11 +2195,12 @@
2195 }
2196 nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
2197 if( nNodeOnPath==1 && from_to_mode>0 ){
2198 blob_appendf(&desc,"Check-in ");
2199 }else if( bMin ){
2200 blob_appendf(&desc, "%d of %d check-ins along the path from ",
2201 nNodeOnPath, nNodeOnPath+nSkip);
2202 }else{
2203 blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
2204 }
2205 if( from_rid==selectedRid ){
2206 blob_appendf(&desc, "<span class='timelineSelected'>");
2207

Keyboard Shortcuts

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