Fossil SCM
Improved response to from=,ft= in /timeline when no such path exists.
Commit
68baa36667eaf84df76d08d493bb6f8f8d8cbef7892ef6891d2d32b13ffe1e88
Parent
7573b3f1e073440…
1 file changed
+20
-19
+20
-19
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -2188,19 +2188,14 @@ | ||
| 2188 | 2188 | if( to_rid ){ |
| 2189 | 2189 | cgi_replace_parameter("to", zTo); |
| 2190 | 2190 | if( selectedRid==0 ) selectedRid = from_rid; |
| 2191 | 2191 | if( secondaryRid==0 ) secondaryRid = to_rid; |
| 2192 | 2192 | }else{ |
| 2193 | + to_rid = from_rid; | |
| 2193 | 2194 | blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ", |
| 2194 | 2195 | 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 | + } | |
| 2202 | 2197 | } |
| 2203 | 2198 | if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){ |
| 2204 | 2199 | /* If from= and to= are present, display all nodes on a path connecting |
| 2205 | 2200 | ** the two */ |
| 2206 | 2201 | PathNode *p = 0; |
| @@ -2282,31 +2277,37 @@ | ||
| 2282 | 2277 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 2283 | 2278 | if( advancedMenu ){ |
| 2284 | 2279 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 2285 | 2280 | } |
| 2286 | 2281 | 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 ){ | |
| 2288 | 2285 | blob_appendf(&desc, "%d check-ins on the shorted path from ",nNodeOnPath); |
| 2289 | 2286 | }else{ |
| 2290 | 2287 | blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath); |
| 2291 | 2288 | } |
| 2292 | 2289 | if( from_rid==selectedRid ){ |
| 2293 | 2290 | blob_appendf(&desc, "<span class='timelineSelected'>"); |
| 2294 | 2291 | } |
| 2295 | 2292 | blob_appendf(&desc, "%z%h</a>", href("%R/info/%h", zFrom), zFrom); |
| 2296 | 2293 | 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 | + } | |
| 2308 | 2309 | } |
| 2309 | 2310 | } |
| 2310 | 2311 | addFileGlobDescription(zChng, &desc); |
| 2311 | 2312 | }else if( (p_rid || d_rid) && g.perm.Read && zTagSql==0 ){ |
| 2312 | 2313 | /* If p= or d= is present, ignore all other parameters other than n= */ |
| 2313 | 2314 |
| --- 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 |