Fossil SCM
For the repolist page, if the environment variable FOSSIL_REPOLIST_SHOW contains the substring "description" then show the description column. If it contains the substring "login-group" then show the login-groups column. If the FOSSIL_REPOLIST_SHOW variable exists, it overwrites the show-repolist-desc and show-repolist-lg settings.
Commit
aca98b92e2c31aceb71952c1e629e1594d4a6731100b68deef383506f1dd0c0f
Parent
e761c1d6f75d2ee…
1 file changed
+11
-6
+11
-6
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -141,21 +141,26 @@ | ||
| 141 | 141 | int allRepo; /* True if running "fossil ui all". |
| 142 | 142 | ** False if a directory scan of base for repos */ |
| 143 | 143 | Blob html; /* Html for the body of the repository list */ |
| 144 | 144 | char *zSkinRepo = 0; /* Name of the repository database used for skins */ |
| 145 | 145 | char *zSkinUrl = 0; /* URL for the skin database */ |
| 146 | + const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */ | |
| 146 | 147 | int bShowDesc = 0; /* True to show the description column */ |
| 147 | 148 | int bShowLg = 0; /* True to show the login-group column */ |
| 148 | 149 | |
| 149 | 150 | assert( g.db==0 ); |
| 150 | - if( db_open_config(1, 1) | |
| 151 | - && db_table_exists("configdb", "global_config") | |
| 151 | + zShow = P("FOSSIL_REPOLIST_SHOW"); | |
| 152 | + if( zShow ){ | |
| 153 | + bShowDesc = strstr(zShow,"description")!=0; | |
| 154 | + bShowLg = strstr(zShow,"login-group")!=0; | |
| 155 | + }else if( db_open_config(1, 1) | |
| 156 | + && db_table_exists("configdb", "global_config") | |
| 152 | 157 | ){ |
| 153 | - bShowDesc = (0!=db_int(0, "SELECT value FROM global_config" | |
| 154 | - " WHERE name='show-repolist-desc'")); | |
| 155 | - bShowLg = (0!=db_int(0, "SELECT value FROM global_config" | |
| 156 | - " WHERE name='show-repolist-lg'")); | |
| 158 | + bShowDesc = db_int(bShowDesc, "SELECT value FROM global_config" | |
| 159 | + " WHERE name='show-repolist-desc'"); | |
| 160 | + bShowLg = db_int(bShowLg, "SELECT value FROM global_config" | |
| 161 | + " WHERE name='show-repolist-lg'"); | |
| 157 | 162 | } |
| 158 | 163 | blob_init(&html, 0, 0); |
| 159 | 164 | if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){ |
| 160 | 165 | /* For the special case of the "repository directory" being "/", |
| 161 | 166 | ** show all of the repositories named in the ~/.fossil database. |
| 162 | 167 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -141,21 +141,26 @@ | |
| 141 | int allRepo; /* True if running "fossil ui all". |
| 142 | ** False if a directory scan of base for repos */ |
| 143 | Blob html; /* Html for the body of the repository list */ |
| 144 | char *zSkinRepo = 0; /* Name of the repository database used for skins */ |
| 145 | char *zSkinUrl = 0; /* URL for the skin database */ |
| 146 | int bShowDesc = 0; /* True to show the description column */ |
| 147 | int bShowLg = 0; /* True to show the login-group column */ |
| 148 | |
| 149 | assert( g.db==0 ); |
| 150 | if( db_open_config(1, 1) |
| 151 | && db_table_exists("configdb", "global_config") |
| 152 | ){ |
| 153 | bShowDesc = (0!=db_int(0, "SELECT value FROM global_config" |
| 154 | " WHERE name='show-repolist-desc'")); |
| 155 | bShowLg = (0!=db_int(0, "SELECT value FROM global_config" |
| 156 | " WHERE name='show-repolist-lg'")); |
| 157 | } |
| 158 | blob_init(&html, 0, 0); |
| 159 | if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){ |
| 160 | /* For the special case of the "repository directory" being "/", |
| 161 | ** show all of the repositories named in the ~/.fossil database. |
| 162 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -141,21 +141,26 @@ | |
| 141 | int allRepo; /* True if running "fossil ui all". |
| 142 | ** False if a directory scan of base for repos */ |
| 143 | Blob html; /* Html for the body of the repository list */ |
| 144 | char *zSkinRepo = 0; /* Name of the repository database used for skins */ |
| 145 | char *zSkinUrl = 0; /* URL for the skin database */ |
| 146 | const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */ |
| 147 | int bShowDesc = 0; /* True to show the description column */ |
| 148 | int bShowLg = 0; /* True to show the login-group column */ |
| 149 | |
| 150 | assert( g.db==0 ); |
| 151 | zShow = P("FOSSIL_REPOLIST_SHOW"); |
| 152 | if( zShow ){ |
| 153 | bShowDesc = strstr(zShow,"description")!=0; |
| 154 | bShowLg = strstr(zShow,"login-group")!=0; |
| 155 | }else if( db_open_config(1, 1) |
| 156 | && db_table_exists("configdb", "global_config") |
| 157 | ){ |
| 158 | bShowDesc = db_int(bShowDesc, "SELECT value FROM global_config" |
| 159 | " WHERE name='show-repolist-desc'"); |
| 160 | bShowLg = db_int(bShowLg, "SELECT value FROM global_config" |
| 161 | " WHERE name='show-repolist-lg'"); |
| 162 | } |
| 163 | blob_init(&html, 0, 0); |
| 164 | if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){ |
| 165 | /* For the special case of the "repository directory" being "/", |
| 166 | ** show all of the repositories named in the ~/.fossil database. |
| 167 |