Fossil SCM
The --page option to "fossil ui" is carried through to remotes, include when the remote directory/repo is "/".
Commit
24d6bba2d80fdc082f91c401368b58179c4fb435001a51913e729eb21258371e
Parent
cca43b2d7c8a08e…
2 files changed
+9
-1
+4
-2
+9
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3549,10 +3549,11 @@ | ||
| 3549 | 3549 | ** tunnel from the local machine to the remote. */ |
| 3550 | 3550 | FILE *sshIn; |
| 3551 | 3551 | Blob ssh; |
| 3552 | 3552 | int bRunning = 0; /* True when fossil starts up on the remote */ |
| 3553 | 3553 | int isRetry; /* True if on the second attempt */ |
| 3554 | + const char *zUrl = g.argv[2]; | |
| 3554 | 3555 | char zLine[1000]; |
| 3555 | 3556 | |
| 3556 | 3557 | blob_init(&ssh, 0, 0); |
| 3557 | 3558 | for(isRetry=0; isRetry<2 && !bRunning; isRetry++){ |
| 3558 | 3559 | blob_reset(&ssh); |
| @@ -3583,11 +3584,18 @@ | ||
| 3583 | 3584 | blob_appendf(&ssh, " --extroot %$", g.zExtRoot); |
| 3584 | 3585 | } |
| 3585 | 3586 | if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use()); |
| 3586 | 3587 | if( zJsMode ) blob_appendf(&ssh, " --jsmode %s", zJsMode); |
| 3587 | 3588 | if( fCreate ) blob_appendf(&ssh, " --create"); |
| 3588 | - blob_appendf(&ssh, " %$", g.argv[2]); | |
| 3589 | + if( zInitPage && zInitPage[0] ){ | |
| 3590 | + if( fossil_strcmp(zUrl,"/")==0 ){ | |
| 3591 | + zInitPage = mprintf("/?home=%T", zInitPage); | |
| 3592 | + }else{ | |
| 3593 | + blob_appendf(&ssh, " --page %!$", zInitPage); | |
| 3594 | + } | |
| 3595 | + } | |
| 3596 | + blob_appendf(&ssh, " %$", zUrl); | |
| 3589 | 3597 | if( isRetry ){ |
| 3590 | 3598 | fossil_print("First attempt to run \"fossil\" on %s failed\n" |
| 3591 | 3599 | "Retry: ", zRemote); |
| 3592 | 3600 | } |
| 3593 | 3601 | fossil_print("%s\n", blob_str(&ssh)); |
| 3594 | 3602 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3549,10 +3549,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 +3584,18 @@ | |
| 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 | |
| @@ -3549,10 +3549,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 | const char *zUrl = g.argv[2]; |
| 3555 | char zLine[1000]; |
| 3556 | |
| 3557 | blob_init(&ssh, 0, 0); |
| 3558 | for(isRetry=0; isRetry<2 && !bRunning; isRetry++){ |
| 3559 | blob_reset(&ssh); |
| @@ -3583,11 +3584,18 @@ | |
| 3584 | blob_appendf(&ssh, " --extroot %$", g.zExtRoot); |
| 3585 | } |
| 3586 | if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use()); |
| 3587 | if( zJsMode ) blob_appendf(&ssh, " --jsmode %s", zJsMode); |
| 3588 | if( fCreate ) blob_appendf(&ssh, " --create"); |
| 3589 | if( zInitPage && zInitPage[0] ){ |
| 3590 | if( fossil_strcmp(zUrl,"/")==0 ){ |
| 3591 | zInitPage = mprintf("/?home=%T", zInitPage); |
| 3592 | }else{ |
| 3593 | blob_appendf(&ssh, " --page %!$", zInitPage); |
| 3594 | } |
| 3595 | } |
| 3596 | blob_appendf(&ssh, " %$", zUrl); |
| 3597 | if( isRetry ){ |
| 3598 | fossil_print("First attempt to run \"fossil\" on %s failed\n" |
| 3599 | "Retry: ", zRemote); |
| 3600 | } |
| 3601 | fossil_print("%s\n", blob_str(&ssh)); |
| 3602 |
+4
-2
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -129,18 +129,20 @@ | ||
| 129 | 129 | char *zSkinRepo = 0; /* Name of the repository database used for skins */ |
| 130 | 130 | char *zSkinUrl = 0; /* URL for the skin database */ |
| 131 | 131 | const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */ |
| 132 | 132 | int bShowDesc = 0; /* True to show the description column */ |
| 133 | 133 | int bShowLg = 0; /* True to show the login-group column */ |
| 134 | + const char *zHome; /* Home page */ | |
| 134 | 135 | |
| 135 | 136 | assert( g.db==0 ); |
| 136 | 137 | zShow = P("FOSSIL_REPOLIST_SHOW"); |
| 137 | 138 | if( zShow ){ |
| 138 | 139 | bShowDesc = strstr(zShow,"description")!=0; |
| 139 | 140 | bShowLg = strstr(zShow,"login-group")!=0; |
| 140 | 141 | } |
| 141 | 142 | blob_init(&html, 0, 0); |
| 143 | + zHome = PD("home","home"); | |
| 142 | 144 | if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){ |
| 143 | 145 | /* For the special case of the "repository directory" being "/", |
| 144 | 146 | ** show all of the repositories named in the ~/.fossil database. |
| 145 | 147 | ** |
| 146 | 148 | ** On unix systems, then entries are of the form "repo:/home/..." |
| @@ -297,12 +299,12 @@ | ||
| 297 | 299 | } else if( sqlite3_strglob("*/.*", zName)==0 ){ |
| 298 | 300 | /* Do not show hyperlinks for hidden repos */ |
| 299 | 301 | blob_appendf(&html, "%h (hidden)", zName); |
| 300 | 302 | } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){ |
| 301 | 303 | 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); | |
| 304 | 306 | }else if( file_ends_with_repository_extension(zName,1) ){ |
| 305 | 307 | /* As described in |
| 306 | 308 | ** https://fossil-scm.org/forum/info/f50f647c97c72fc1: if |
| 307 | 309 | ** foo.fossil and foo/bar.fossil both exist and we create a |
| 308 | 310 | ** link to foo/bar/... then the URI dispatcher will instead |
| 309 | 311 |
| --- 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 |