Fossil SCM

The "fossil ui" command honors --page even when talking to a remote, and when the remote is using "/" to specify a repolist.

drh 2026-08-06 16:12 UTC trunk merge
Commit 3e0731f42eea2ed79ab69dd1431341ef8afcb14e80fbb40ae1e21c15e7fda589
2 files changed +5 -1 +4 -2
+5 -1
--- src/main.c
+++ src/main.c
@@ -3531,10 +3531,13 @@
35313531
if( isUiCmd && !fNoBrowser ){
35323532
char *zBrowserArg;
35333533
const char *zProtocol = g.httpUseSSL ? "https" : "http";
35343534
db_open_config(0,0);
35353535
zBrowser = fossil_web_browser();
3536
+ if( fossil_strcmp(g.argv[2],"/")==0 ){
3537
+ zInitPage = mprintf("?home=%T", zInitPage);
3538
+ }
35363539
if( zIpAddr==0 ){
35373540
zBrowserArg = mprintf("%s://localhost:%%d/%s", zProtocol, zInitPage);
35383541
}else if( strchr(zIpAddr,':') ){
35393542
zBrowserArg = mprintf("%s://[%s]:%%d/%s", zProtocol, zIpAddr, zInitPage);
35403543
}else{
@@ -3549,10 +3552,11 @@
35493552
** tunnel from the local machine to the remote. */
35503553
FILE *sshIn;
35513554
Blob ssh;
35523555
int bRunning = 0; /* True when fossil starts up on the remote */
35533556
int isRetry; /* True if on the second attempt */
3557
+ const char *zUrl = g.argv[2];
35543558
char zLine[1000];
35553559
35563560
blob_init(&ssh, 0, 0);
35573561
for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
35583562
blob_reset(&ssh);
@@ -3583,11 +3587,11 @@
35833587
blob_appendf(&ssh, " --extroot %$", g.zExtRoot);
35843588
}
35853589
if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use());
35863590
if( zJsMode ) blob_appendf(&ssh, " --jsmode %s", zJsMode);
35873591
if( fCreate ) blob_appendf(&ssh, " --create");
3588
- blob_appendf(&ssh, " %$", g.argv[2]);
3592
+ blob_appendf(&ssh, " %$", zUrl);
35893593
if( isRetry ){
35903594
fossil_print("First attempt to run \"fossil\" on %s failed\n"
35913595
"Retry: ", zRemote);
35923596
}
35933597
fossil_print("%s\n", blob_str(&ssh));
35943598
--- src/main.c
+++ src/main.c
@@ -3531,10 +3531,13 @@
3531 if( isUiCmd && !fNoBrowser ){
3532 char *zBrowserArg;
3533 const char *zProtocol = g.httpUseSSL ? "https" : "http";
3534 db_open_config(0,0);
3535 zBrowser = fossil_web_browser();
 
 
 
3536 if( zIpAddr==0 ){
3537 zBrowserArg = mprintf("%s://localhost:%%d/%s", zProtocol, zInitPage);
3538 }else if( strchr(zIpAddr,':') ){
3539 zBrowserArg = mprintf("%s://[%s]:%%d/%s", zProtocol, zIpAddr, zInitPage);
3540 }else{
@@ -3549,10 +3552,11 @@
3549 ** tunnel from the local machine to the remote. */
3550 FILE *sshIn;
3551 Blob ssh;
3552 int bRunning = 0; /* True when fossil starts up on the remote */
3553 int isRetry; /* True if on the second attempt */
 
3554 char zLine[1000];
3555
3556 blob_init(&ssh, 0, 0);
3557 for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
3558 blob_reset(&ssh);
@@ -3583,11 +3587,11 @@
3583 blob_appendf(&ssh, " --extroot %$", g.zExtRoot);
3584 }
3585 if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use());
3586 if( zJsMode ) blob_appendf(&ssh, " --jsmode %s", zJsMode);
3587 if( fCreate ) blob_appendf(&ssh, " --create");
3588 blob_appendf(&ssh, " %$", g.argv[2]);
3589 if( isRetry ){
3590 fossil_print("First attempt to run \"fossil\" on %s failed\n"
3591 "Retry: ", zRemote);
3592 }
3593 fossil_print("%s\n", blob_str(&ssh));
3594
--- src/main.c
+++ src/main.c
@@ -3531,10 +3531,13 @@
3531 if( isUiCmd && !fNoBrowser ){
3532 char *zBrowserArg;
3533 const char *zProtocol = g.httpUseSSL ? "https" : "http";
3534 db_open_config(0,0);
3535 zBrowser = fossil_web_browser();
3536 if( fossil_strcmp(g.argv[2],"/")==0 ){
3537 zInitPage = mprintf("?home=%T", zInitPage);
3538 }
3539 if( zIpAddr==0 ){
3540 zBrowserArg = mprintf("%s://localhost:%%d/%s", zProtocol, zInitPage);
3541 }else if( strchr(zIpAddr,':') ){
3542 zBrowserArg = mprintf("%s://[%s]:%%d/%s", zProtocol, zIpAddr, zInitPage);
3543 }else{
@@ -3549,10 +3552,11 @@
3552 ** tunnel from the local machine to the remote. */
3553 FILE *sshIn;
3554 Blob ssh;
3555 int bRunning = 0; /* True when fossil starts up on the remote */
3556 int isRetry; /* True if on the second attempt */
3557 const char *zUrl = g.argv[2];
3558 char zLine[1000];
3559
3560 blob_init(&ssh, 0, 0);
3561 for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
3562 blob_reset(&ssh);
@@ -3583,11 +3587,11 @@
3587 blob_appendf(&ssh, " --extroot %$", g.zExtRoot);
3588 }
3589 if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use());
3590 if( zJsMode ) blob_appendf(&ssh, " --jsmode %s", zJsMode);
3591 if( fCreate ) blob_appendf(&ssh, " --create");
3592 blob_appendf(&ssh, " %$", zUrl);
3593 if( isRetry ){
3594 fossil_print("First attempt to run \"fossil\" on %s failed\n"
3595 "Retry: ", zRemote);
3596 }
3597 fossil_print("%s\n", blob_str(&ssh));
3598
+4 -2
--- src/repolist.c
+++ src/repolist.c
@@ -129,18 +129,20 @@
129129
char *zSkinRepo = 0; /* Name of the repository database used for skins */
130130
char *zSkinUrl = 0; /* URL for the skin database */
131131
const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */
132132
int bShowDesc = 0; /* True to show the description column */
133133
int bShowLg = 0; /* True to show the login-group column */
134
+ const char *zHome; /* Home page */
134135
135136
assert( g.db==0 );
136137
zShow = P("FOSSIL_REPOLIST_SHOW");
137138
if( zShow ){
138139
bShowDesc = strstr(zShow,"description")!=0;
139140
bShowLg = strstr(zShow,"login-group")!=0;
140141
}
141142
blob_init(&html, 0, 0);
143
+ zHome = PD("home","home");
142144
if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){
143145
/* For the special case of the "repository directory" being "/",
144146
** show all of the repositories named in the ~/.fossil database.
145147
**
146148
** On unix systems, then entries are of the form "repo:/home/..."
@@ -297,12 +299,12 @@
297299
} else if( sqlite3_strglob("*/.*", zName)==0 ){
298300
/* Do not show hyperlinks for hidden repos */
299301
blob_appendf(&html, "%h (hidden)", zName);
300302
} else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
301303
blob_appendf(&html,
302
- "<a href='%R/%T/home' target='_blank'>/%h</a>\n",
303
- zUrl, zName);
304
+ "<a href='%R/%T/%T' target='_blank'>/%h</a>\n",
305
+ zUrl, zHome, zName);
304306
}else if( file_ends_with_repository_extension(zName,1) ){
305307
/* As described in
306308
** https://fossil-scm.org/forum/info/f50f647c97c72fc1: if
307309
** foo.fossil and foo/bar.fossil both exist and we create a
308310
** link to foo/bar/... then the URI dispatcher will instead
309311
--- src/repolist.c
+++ src/repolist.c
@@ -129,18 +129,20 @@
129 char *zSkinRepo = 0; /* Name of the repository database used for skins */
130 char *zSkinUrl = 0; /* URL for the skin database */
131 const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */
132 int bShowDesc = 0; /* True to show the description column */
133 int bShowLg = 0; /* True to show the login-group column */
 
134
135 assert( g.db==0 );
136 zShow = P("FOSSIL_REPOLIST_SHOW");
137 if( zShow ){
138 bShowDesc = strstr(zShow,"description")!=0;
139 bShowLg = strstr(zShow,"login-group")!=0;
140 }
141 blob_init(&html, 0, 0);
 
142 if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){
143 /* For the special case of the "repository directory" being "/",
144 ** show all of the repositories named in the ~/.fossil database.
145 **
146 ** On unix systems, then entries are of the form "repo:/home/..."
@@ -297,12 +299,12 @@
297 } else if( sqlite3_strglob("*/.*", zName)==0 ){
298 /* Do not show hyperlinks for hidden repos */
299 blob_appendf(&html, "%h (hidden)", zName);
300 } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
301 blob_appendf(&html,
302 "<a href='%R/%T/home' target='_blank'>/%h</a>\n",
303 zUrl, zName);
304 }else if( file_ends_with_repository_extension(zName,1) ){
305 /* As described in
306 ** https://fossil-scm.org/forum/info/f50f647c97c72fc1: if
307 ** foo.fossil and foo/bar.fossil both exist and we create a
308 ** link to foo/bar/... then the URI dispatcher will instead
309
--- src/repolist.c
+++ src/repolist.c
@@ -129,18 +129,20 @@
129 char *zSkinRepo = 0; /* Name of the repository database used for skins */
130 char *zSkinUrl = 0; /* URL for the skin database */
131 const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */
132 int bShowDesc = 0; /* True to show the description column */
133 int bShowLg = 0; /* True to show the login-group column */
134 const char *zHome; /* Home page */
135
136 assert( g.db==0 );
137 zShow = P("FOSSIL_REPOLIST_SHOW");
138 if( zShow ){
139 bShowDesc = strstr(zShow,"description")!=0;
140 bShowLg = strstr(zShow,"login-group")!=0;
141 }
142 blob_init(&html, 0, 0);
143 zHome = PD("home","home");
144 if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){
145 /* For the special case of the "repository directory" being "/",
146 ** show all of the repositories named in the ~/.fossil database.
147 **
148 ** On unix systems, then entries are of the form "repo:/home/..."
@@ -297,12 +299,12 @@
299 } else if( sqlite3_strglob("*/.*", zName)==0 ){
300 /* Do not show hyperlinks for hidden repos */
301 blob_appendf(&html, "%h (hidden)", zName);
302 } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
303 blob_appendf(&html,
304 "<a href='%R/%T/%T' target='_blank'>/%h</a>\n",
305 zUrl, zHome, zName);
306 }else if( file_ends_with_repository_extension(zName,1) ){
307 /* As described in
308 ** https://fossil-scm.org/forum/info/f50f647c97c72fc1: if
309 ** foo.fossil and foo/bar.fossil both exist and we create a
310 ** link to foo/bar/... then the URI dispatcher will instead
311

Keyboard Shortcuts

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