Fossil SCM

add a description to the repolist as suggested by [forum:fc7e81a9db]

jkosche 2025-04-03 11:49 trunk
Commit f4ebb610135a982a7c2dc9fcd213fc780e402a9ee6e6f7a0e3864da697fde55a
1 file changed +18
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
3131
int isValid; /* True if zRepoName is a valid Fossil repository */
3232
int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
3333
** for the repository list. 2 means do use this
3434
** repository but do not display it in the list. */
3535
char *zProjName; /* Project Name. Memory from fossil_malloc() */
36
+ char *zProjDesc; /* Project Description. Memory from fossil_malloc() */
3637
char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
3738
double rMTime; /* Last update. Julian day number */
3839
};
3940
#endif
4041
@@ -49,10 +50,11 @@
4950
int rc;
5051
5152
pRepo->isRepolistSkin = 0;
5253
pRepo->isValid = 0;
5354
pRepo->zProjName = 0;
55
+ pRepo->zProjDesc = 0;
5456
pRepo->zLoginGroup = 0;
5557
pRepo->rMTime = 0.0;
5658
5759
g.dbIgnoreErrors++;
5860
rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
7173
-1, &pStmt, 0);
7274
if( rc ) goto finish_repo_list;
7375
if( sqlite3_step(pStmt)==SQLITE_ROW ){
7476
pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
7577
}
78
+ sqlite3_finalize(pStmt);
79
+ if( rc ) goto finish_repo_list;
80
+ rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
81
+ " WHERE name='project-description'",
82
+ -1, &pStmt, 0);
83
+ if( rc ) goto finish_repo_list;
84
+ if( sqlite3_step(pStmt)==SQLITE_ROW ){
85
+ pRepo->zProjDesc = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
86
+ }
7687
sqlite3_finalize(pStmt);
7788
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
7889
" WHERE name='login-group-name'",
7990
-1, &pStmt, 0);
8091
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -165,10 +176,11 @@
165176
blob_append_sql(&html,
166177
"<table border='0' class='sortable' data-init-sort='1'"
167178
" data-column-types='txtxkxt'><thead>\n"
168179
"<tr><th>Filename<th width='20'>"
169180
"<th>Project Name<th width='20'>"
181
+ "<th>Project Description<th width='20'>"
170182
"<th>Last Modified<th width='20'>"
171183
"<th>Login Group</tr>\n"
172184
"</thead><tbody>\n");
173185
db_prepare(&q, "SELECT pathname"
174186
" FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
278290
zUrl, zName);
279291
}
280292
if( x.zProjName ){
281293
blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
282294
fossil_free(x.zProjName);
295
+ }else{
296
+ blob_append_sql(&html, "<td></td><td></td>\n");
297
+ }
298
+ if( x.zProjDesc ){
299
+ blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjDesc);
300
+ fossil_free(x.zProjDesc);
283301
}else{
284302
blob_append_sql(&html, "<td></td><td></td>\n");
285303
}
286304
blob_append_sql(&html,
287305
"<td></td><td data-sortkey='%08x'>%h</td>\n",
288306
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
31 int isValid; /* True if zRepoName is a valid Fossil repository */
32 int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
33 ** for the repository list. 2 means do use this
34 ** repository but do not display it in the list. */
35 char *zProjName; /* Project Name. Memory from fossil_malloc() */
 
36 char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
37 double rMTime; /* Last update. Julian day number */
38 };
39 #endif
40
@@ -49,10 +50,11 @@
49 int rc;
50
51 pRepo->isRepolistSkin = 0;
52 pRepo->isValid = 0;
53 pRepo->zProjName = 0;
 
54 pRepo->zLoginGroup = 0;
55 pRepo->rMTime = 0.0;
56
57 g.dbIgnoreErrors++;
58 rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
71 -1, &pStmt, 0);
72 if( rc ) goto finish_repo_list;
73 if( sqlite3_step(pStmt)==SQLITE_ROW ){
74 pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
75 }
 
 
 
 
 
 
 
 
 
76 sqlite3_finalize(pStmt);
77 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
78 " WHERE name='login-group-name'",
79 -1, &pStmt, 0);
80 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -165,10 +176,11 @@
165 blob_append_sql(&html,
166 "<table border='0' class='sortable' data-init-sort='1'"
167 " data-column-types='txtxkxt'><thead>\n"
168 "<tr><th>Filename<th width='20'>"
169 "<th>Project Name<th width='20'>"
 
170 "<th>Last Modified<th width='20'>"
171 "<th>Login Group</tr>\n"
172 "</thead><tbody>\n");
173 db_prepare(&q, "SELECT pathname"
174 " FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
278 zUrl, zName);
279 }
280 if( x.zProjName ){
281 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
282 fossil_free(x.zProjName);
 
 
 
 
 
 
283 }else{
284 blob_append_sql(&html, "<td></td><td></td>\n");
285 }
286 blob_append_sql(&html,
287 "<td></td><td data-sortkey='%08x'>%h</td>\n",
288
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
31 int isValid; /* True if zRepoName is a valid Fossil repository */
32 int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
33 ** for the repository list. 2 means do use this
34 ** repository but do not display it in the list. */
35 char *zProjName; /* Project Name. Memory from fossil_malloc() */
36 char *zProjDesc; /* Project Description. Memory from fossil_malloc() */
37 char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
38 double rMTime; /* Last update. Julian day number */
39 };
40 #endif
41
@@ -49,10 +50,11 @@
50 int rc;
51
52 pRepo->isRepolistSkin = 0;
53 pRepo->isValid = 0;
54 pRepo->zProjName = 0;
55 pRepo->zProjDesc = 0;
56 pRepo->zLoginGroup = 0;
57 pRepo->rMTime = 0.0;
58
59 g.dbIgnoreErrors++;
60 rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
73 -1, &pStmt, 0);
74 if( rc ) goto finish_repo_list;
75 if( sqlite3_step(pStmt)==SQLITE_ROW ){
76 pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
77 }
78 sqlite3_finalize(pStmt);
79 if( rc ) goto finish_repo_list;
80 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
81 " WHERE name='project-description'",
82 -1, &pStmt, 0);
83 if( rc ) goto finish_repo_list;
84 if( sqlite3_step(pStmt)==SQLITE_ROW ){
85 pRepo->zProjDesc = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
86 }
87 sqlite3_finalize(pStmt);
88 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
89 " WHERE name='login-group-name'",
90 -1, &pStmt, 0);
91 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -165,10 +176,11 @@
176 blob_append_sql(&html,
177 "<table border='0' class='sortable' data-init-sort='1'"
178 " data-column-types='txtxkxt'><thead>\n"
179 "<tr><th>Filename<th width='20'>"
180 "<th>Project Name<th width='20'>"
181 "<th>Project Description<th width='20'>"
182 "<th>Last Modified<th width='20'>"
183 "<th>Login Group</tr>\n"
184 "</thead><tbody>\n");
185 db_prepare(&q, "SELECT pathname"
186 " FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
290 zUrl, zName);
291 }
292 if( x.zProjName ){
293 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
294 fossil_free(x.zProjName);
295 }else{
296 blob_append_sql(&html, "<td></td><td></td>\n");
297 }
298 if( x.zProjDesc ){
299 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjDesc);
300 fossil_free(x.zProjDesc);
301 }else{
302 blob_append_sql(&html, "<td></td><td></td>\n");
303 }
304 blob_append_sql(&html,
305 "<td></td><td data-sortkey='%08x'>%h</td>\n",
306

Keyboard Shortcuts

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