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.

drh 2025-04-17 19:52 trunk
Commit aca98b92e2c31aceb71952c1e629e1594d4a6731100b68deef383506f1dd0c0f
1 file changed +11 -6
+11 -6
--- src/repolist.c
+++ src/repolist.c
@@ -141,21 +141,26 @@
141141
int allRepo; /* True if running "fossil ui all".
142142
** False if a directory scan of base for repos */
143143
Blob html; /* Html for the body of the repository list */
144144
char *zSkinRepo = 0; /* Name of the repository database used for skins */
145145
char *zSkinUrl = 0; /* URL for the skin database */
146
+ const char *zShow; /* Value of FOSSIL_REPOLIST_SHOW environment variable */
146147
int bShowDesc = 0; /* True to show the description column */
147148
int bShowLg = 0; /* True to show the login-group column */
148149
149150
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")
152157
){
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'");
157162
}
158163
blob_init(&html, 0, 0);
159164
if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){
160165
/* For the special case of the "repository directory" being "/",
161166
** show all of the repositories named in the ~/.fossil database.
162167
--- 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

Keyboard Shortcuts

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