Fossil SCM
Add the "remote-permalink" setting, which if set causes the "Permalink" hyperlink on the submenu of the "bisect" timeline to reference the remote repository that was most recently synced, rather than the local repository (which is probably a pop-up using "fossil bisect ui").
Commit
afe648437872b03ececa56a3263dc3725dafd6d45f9478bf09b16ccd2043ef20
Parent
36beb09dd571f9d…
1 file changed
+20
-1
+20
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -360,10 +360,18 @@ | ||
| 360 | 360 | ** |
| 361 | 361 | ** The default is currently 1. Prior to 2025-10-19, the default was 2. |
| 362 | 362 | ** This setting has no effect on the "Classic" view, which always behaves |
| 363 | 363 | ** as if the setting were 2. |
| 364 | 364 | */ |
| 365 | +/* | |
| 366 | +** SETTING: remote-permalink boolean default=off | |
| 367 | +** | |
| 368 | +** If the remote-permalink setting is true, then the "Permalink" hyperlink | |
| 369 | +** in the submenu of the "bisect" page of the timeline references the | |
| 370 | +** remote repository used for the last sync (and stored in the | |
| 371 | +** last-sync-url setting). | |
| 372 | +*/ | |
| 365 | 373 | |
| 366 | 374 | /* |
| 367 | 375 | ** Output a timeline in the web format given a query. The query |
| 368 | 376 | ** should return these columns: |
| 369 | 377 | ** |
| @@ -2161,15 +2169,26 @@ | ||
| 2161 | 2169 | disableY = 1; |
| 2162 | 2170 | } |
| 2163 | 2171 | if( bisectLocal && cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 2164 | 2172 | int iCurrent = db_lget_int("checkout",0); |
| 2165 | 2173 | char *zPerm = bisect_permalink(); |
| 2174 | + char *zHost = 0; | |
| 2166 | 2175 | bisect_create_bilog_table(iCurrent, 0, 1); |
| 2167 | 2176 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2168 | 2177 | zType = "ci"; |
| 2169 | 2178 | disableY = 1; |
| 2170 | - style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm); | |
| 2179 | + if( db_get_boolean("remote-permalink",0) ){ | |
| 2180 | + zHost = db_text(0, | |
| 2181 | + "SELECT value FROM config WHERE name='last-sync-url'" | |
| 2182 | + " AND value GLOB 'http*'" | |
| 2183 | + ); | |
| 2184 | + } | |
| 2185 | + if( zHost ){ | |
| 2186 | + style_submenu_element("Permalink", "%h/timeline?bid=%z", zHost, zPerm); | |
| 2187 | + }else{ | |
| 2188 | + style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm); | |
| 2189 | + } | |
| 2171 | 2190 | }else{ |
| 2172 | 2191 | bisectLocal = 0; |
| 2173 | 2192 | } |
| 2174 | 2193 | if( zBisect!=0 && bisect_create_bilog_table(0, zBisect, 1) ){ |
| 2175 | 2194 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2176 | 2195 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -360,10 +360,18 @@ | |
| 360 | ** |
| 361 | ** The default is currently 1. Prior to 2025-10-19, the default was 2. |
| 362 | ** This setting has no effect on the "Classic" view, which always behaves |
| 363 | ** as if the setting were 2. |
| 364 | */ |
| 365 | |
| 366 | /* |
| 367 | ** Output a timeline in the web format given a query. The query |
| 368 | ** should return these columns: |
| 369 | ** |
| @@ -2161,15 +2169,26 @@ | |
| 2161 | disableY = 1; |
| 2162 | } |
| 2163 | if( bisectLocal && cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 2164 | int iCurrent = db_lget_int("checkout",0); |
| 2165 | char *zPerm = bisect_permalink(); |
| 2166 | bisect_create_bilog_table(iCurrent, 0, 1); |
| 2167 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2168 | zType = "ci"; |
| 2169 | disableY = 1; |
| 2170 | style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm); |
| 2171 | }else{ |
| 2172 | bisectLocal = 0; |
| 2173 | } |
| 2174 | if( zBisect!=0 && bisect_create_bilog_table(0, zBisect, 1) ){ |
| 2175 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2176 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -360,10 +360,18 @@ | |
| 360 | ** |
| 361 | ** The default is currently 1. Prior to 2025-10-19, the default was 2. |
| 362 | ** This setting has no effect on the "Classic" view, which always behaves |
| 363 | ** as if the setting were 2. |
| 364 | */ |
| 365 | /* |
| 366 | ** SETTING: remote-permalink boolean default=off |
| 367 | ** |
| 368 | ** If the remote-permalink setting is true, then the "Permalink" hyperlink |
| 369 | ** in the submenu of the "bisect" page of the timeline references the |
| 370 | ** remote repository used for the last sync (and stored in the |
| 371 | ** last-sync-url setting). |
| 372 | */ |
| 373 | |
| 374 | /* |
| 375 | ** Output a timeline in the web format given a query. The query |
| 376 | ** should return these columns: |
| 377 | ** |
| @@ -2161,15 +2169,26 @@ | |
| 2169 | disableY = 1; |
| 2170 | } |
| 2171 | if( bisectLocal && cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 2172 | int iCurrent = db_lget_int("checkout",0); |
| 2173 | char *zPerm = bisect_permalink(); |
| 2174 | char *zHost = 0; |
| 2175 | bisect_create_bilog_table(iCurrent, 0, 1); |
| 2176 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2177 | zType = "ci"; |
| 2178 | disableY = 1; |
| 2179 | if( db_get_boolean("remote-permalink",0) ){ |
| 2180 | zHost = db_text(0, |
| 2181 | "SELECT value FROM config WHERE name='last-sync-url'" |
| 2182 | " AND value GLOB 'http*'" |
| 2183 | ); |
| 2184 | } |
| 2185 | if( zHost ){ |
| 2186 | style_submenu_element("Permalink", "%h/timeline?bid=%z", zHost, zPerm); |
| 2187 | }else{ |
| 2188 | style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm); |
| 2189 | } |
| 2190 | }else{ |
| 2191 | bisectLocal = 0; |
| 2192 | } |
| 2193 | if( zBisect!=0 && bisect_create_bilog_table(0, zBisect, 1) ){ |
| 2194 | tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS; |
| 2195 |