Fossil SCM

Improved response to from=,ft= in /timeline when no such path exists.

drh 2024-02-08 18:41 trunk
Commit 68baa36667eaf84df76d08d493bb6f8f8d8cbef7892ef6891d2d32b13ffe1e88
1 file changed +20 -19
+20 -19
--- src/timeline.c
+++ src/timeline.c
@@ -2188,19 +2188,14 @@
21882188
if( to_rid ){
21892189
cgi_replace_parameter("to", zTo);
21902190
if( selectedRid==0 ) selectedRid = from_rid;
21912191
if( secondaryRid==0 ) secondaryRid = to_rid;
21922192
}else{
2193
+ to_rid = from_rid;
21932194
blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ",
21942195
P("from"), from_to_mode==1 ? "forward" : "back", zTo);
2195
- p_rid = 0;
2196
- d_rid = 0;
2197
- zCirca = P("from");
2198
- zMark = zCirca;
2199
- zType = "ci";
2200
- nEntry = 1;
2201
- }
2196
+ }
22022197
}
22032198
if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){
22042199
/* If from= and to= are present, display all nodes on a path connecting
22052200
** the two */
22062201
PathNode *p = 0;
@@ -2282,31 +2277,37 @@
22822277
db_multi_exec("%s", blob_sql_text(&sql));
22832278
if( advancedMenu ){
22842279
style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
22852280
}
22862281
nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
2287
- if( from_to_mode>0 ){
2282
+ if( nNodeOnPath==1 && from_to_mode>0 ){
2283
+ blob_appendf(&desc,"Check-in ");
2284
+ }else if( from_to_mode>0 ){
22882285
blob_appendf(&desc, "%d check-ins on the shorted path from ",nNodeOnPath);
22892286
}else{
22902287
blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
22912288
}
22922289
if( from_rid==selectedRid ){
22932290
blob_appendf(&desc, "<span class='timelineSelected'>");
22942291
}
22952292
blob_appendf(&desc, "%z%h</a>", href("%R/info/%h", zFrom), zFrom);
22962293
if( from_rid==selectedRid ) blob_appendf(&desc, "</span>");
2297
- blob_append(&desc, " to ", -1);
2298
- if( to_rid==secondaryRid ){
2299
- blob_appendf(&desc, "<span class='timelineSelected timelineSecondary'>");
2300
- }
2301
- blob_appendf(&desc, "%z%h</a>", href("%R/info/%h",zTo), zTo);
2302
- if( to_rid==secondaryRid ) blob_appendf(&desc, "</span>");
2303
- if( related ){
2304
- int nRelated = db_int(0, "SELECT count(*) FROM timeline") - nNodeOnPath;
2305
- if( nRelated>0 ){
2306
- blob_appendf(&desc, " and %d related check-in%s", nRelated,
2307
- nRelated>1 ? "s" : "");
2294
+ if( nNodeOnPath==1 && from_to_mode>0 ){
2295
+ blob_appendf(&desc, " only");
2296
+ }else{
2297
+ blob_append(&desc, " to ", -1);
2298
+ if( to_rid==secondaryRid ){
2299
+ blob_appendf(&desc,"<span class='timelineSelected timelineSecondary'>");
2300
+ }
2301
+ blob_appendf(&desc, "%z%h</a>", href("%R/info/%h",zTo), zTo);
2302
+ if( to_rid==secondaryRid ) blob_appendf(&desc, "</span>");
2303
+ if( related ){
2304
+ int nRelated = db_int(0, "SELECT count(*) FROM timeline") - nNodeOnPath;
2305
+ if( nRelated>0 ){
2306
+ blob_appendf(&desc, " and %d related check-in%s", nRelated,
2307
+ nRelated>1 ? "s" : "");
2308
+ }
23082309
}
23092310
}
23102311
addFileGlobDescription(zChng, &desc);
23112312
}else if( (p_rid || d_rid) && g.perm.Read && zTagSql==0 ){
23122313
/* If p= or d= is present, ignore all other parameters other than n= */
23132314
--- src/timeline.c
+++ src/timeline.c
@@ -2188,19 +2188,14 @@
2188 if( to_rid ){
2189 cgi_replace_parameter("to", zTo);
2190 if( selectedRid==0 ) selectedRid = from_rid;
2191 if( secondaryRid==0 ) secondaryRid = to_rid;
2192 }else{
 
2193 blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ",
2194 P("from"), from_to_mode==1 ? "forward" : "back", zTo);
2195 p_rid = 0;
2196 d_rid = 0;
2197 zCirca = P("from");
2198 zMark = zCirca;
2199 zType = "ci";
2200 nEntry = 1;
2201 }
2202 }
2203 if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){
2204 /* If from= and to= are present, display all nodes on a path connecting
2205 ** the two */
2206 PathNode *p = 0;
@@ -2282,31 +2277,37 @@
2282 db_multi_exec("%s", blob_sql_text(&sql));
2283 if( advancedMenu ){
2284 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
2285 }
2286 nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
2287 if( from_to_mode>0 ){
 
 
2288 blob_appendf(&desc, "%d check-ins on the shorted path from ",nNodeOnPath);
2289 }else{
2290 blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
2291 }
2292 if( from_rid==selectedRid ){
2293 blob_appendf(&desc, "<span class='timelineSelected'>");
2294 }
2295 blob_appendf(&desc, "%z%h</a>", href("%R/info/%h", zFrom), zFrom);
2296 if( from_rid==selectedRid ) blob_appendf(&desc, "</span>");
2297 blob_append(&desc, " to ", -1);
2298 if( to_rid==secondaryRid ){
2299 blob_appendf(&desc, "<span class='timelineSelected timelineSecondary'>");
2300 }
2301 blob_appendf(&desc, "%z%h</a>", href("%R/info/%h",zTo), zTo);
2302 if( to_rid==secondaryRid ) blob_appendf(&desc, "</span>");
2303 if( related ){
2304 int nRelated = db_int(0, "SELECT count(*) FROM timeline") - nNodeOnPath;
2305 if( nRelated>0 ){
2306 blob_appendf(&desc, " and %d related check-in%s", nRelated,
2307 nRelated>1 ? "s" : "");
 
 
 
 
2308 }
2309 }
2310 addFileGlobDescription(zChng, &desc);
2311 }else if( (p_rid || d_rid) && g.perm.Read && zTagSql==0 ){
2312 /* If p= or d= is present, ignore all other parameters other than n= */
2313
--- src/timeline.c
+++ src/timeline.c
@@ -2188,19 +2188,14 @@
2188 if( to_rid ){
2189 cgi_replace_parameter("to", zTo);
2190 if( selectedRid==0 ) selectedRid = from_rid;
2191 if( secondaryRid==0 ) secondaryRid = to_rid;
2192 }else{
2193 to_rid = from_rid;
2194 blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ",
2195 P("from"), from_to_mode==1 ? "forward" : "back", zTo);
2196 }
 
 
 
 
 
 
2197 }
2198 if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){
2199 /* If from= and to= are present, display all nodes on a path connecting
2200 ** the two */
2201 PathNode *p = 0;
@@ -2282,31 +2277,37 @@
2277 db_multi_exec("%s", blob_sql_text(&sql));
2278 if( advancedMenu ){
2279 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
2280 }
2281 nNodeOnPath = db_int(0, "SELECT count(*) FROM temp.pathnode");
2282 if( nNodeOnPath==1 && from_to_mode>0 ){
2283 blob_appendf(&desc,"Check-in ");
2284 }else if( from_to_mode>0 ){
2285 blob_appendf(&desc, "%d check-ins on the shorted path from ",nNodeOnPath);
2286 }else{
2287 blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
2288 }
2289 if( from_rid==selectedRid ){
2290 blob_appendf(&desc, "<span class='timelineSelected'>");
2291 }
2292 blob_appendf(&desc, "%z%h</a>", href("%R/info/%h", zFrom), zFrom);
2293 if( from_rid==selectedRid ) blob_appendf(&desc, "</span>");
2294 if( nNodeOnPath==1 && from_to_mode>0 ){
2295 blob_appendf(&desc, " only");
2296 }else{
2297 blob_append(&desc, " to ", -1);
2298 if( to_rid==secondaryRid ){
2299 blob_appendf(&desc,"<span class='timelineSelected timelineSecondary'>");
2300 }
2301 blob_appendf(&desc, "%z%h</a>", href("%R/info/%h",zTo), zTo);
2302 if( to_rid==secondaryRid ) blob_appendf(&desc, "</span>");
2303 if( related ){
2304 int nRelated = db_int(0, "SELECT count(*) FROM timeline") - nNodeOnPath;
2305 if( nRelated>0 ){
2306 blob_appendf(&desc, " and %d related check-in%s", nRelated,
2307 nRelated>1 ? "s" : "");
2308 }
2309 }
2310 }
2311 addFileGlobDescription(zChng, &desc);
2312 }else if( (p_rid || d_rid) && g.perm.Read && zTagSql==0 ){
2313 /* If p= or d= is present, ignore all other parameters other than n= */
2314

Keyboard Shortcuts

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