Fossil SCM
add a description to the repolist as suggested by [forum:fc7e81a9db]
Commit
f4ebb610135a982a7c2dc9fcd213fc780e402a9ee6e6f7a0e3864da697fde55a
Parent
271a6bd31d5087f…
1 file changed
+18
+18
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -31,10 +31,11 @@ | ||
| 31 | 31 | int isValid; /* True if zRepoName is a valid Fossil repository */ |
| 32 | 32 | int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin |
| 33 | 33 | ** for the repository list. 2 means do use this |
| 34 | 34 | ** repository but do not display it in the list. */ |
| 35 | 35 | char *zProjName; /* Project Name. Memory from fossil_malloc() */ |
| 36 | + char *zProjDesc; /* Project Description. Memory from fossil_malloc() */ | |
| 36 | 37 | char *zLoginGroup; /* Name of login group, or NULL. Malloced() */ |
| 37 | 38 | double rMTime; /* Last update. Julian day number */ |
| 38 | 39 | }; |
| 39 | 40 | #endif |
| 40 | 41 | |
| @@ -49,10 +50,11 @@ | ||
| 49 | 50 | int rc; |
| 50 | 51 | |
| 51 | 52 | pRepo->isRepolistSkin = 0; |
| 52 | 53 | pRepo->isValid = 0; |
| 53 | 54 | pRepo->zProjName = 0; |
| 55 | + pRepo->zProjDesc = 0; | |
| 54 | 56 | pRepo->zLoginGroup = 0; |
| 55 | 57 | pRepo->rMTime = 0.0; |
| 56 | 58 | |
| 57 | 59 | g.dbIgnoreErrors++; |
| 58 | 60 | rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0); |
| @@ -71,10 +73,19 @@ | ||
| 71 | 73 | -1, &pStmt, 0); |
| 72 | 74 | if( rc ) goto finish_repo_list; |
| 73 | 75 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 74 | 76 | pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0)); |
| 75 | 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 | + } | |
| 76 | 87 | sqlite3_finalize(pStmt); |
| 77 | 88 | rc = sqlite3_prepare_v2(db, "SELECT value FROM config" |
| 78 | 89 | " WHERE name='login-group-name'", |
| 79 | 90 | -1, &pStmt, 0); |
| 80 | 91 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| @@ -165,10 +176,11 @@ | ||
| 165 | 176 | blob_append_sql(&html, |
| 166 | 177 | "<table border='0' class='sortable' data-init-sort='1'" |
| 167 | 178 | " data-column-types='txtxkxt'><thead>\n" |
| 168 | 179 | "<tr><th>Filename<th width='20'>" |
| 169 | 180 | "<th>Project Name<th width='20'>" |
| 181 | + "<th>Project Description<th width='20'>" | |
| 170 | 182 | "<th>Last Modified<th width='20'>" |
| 171 | 183 | "<th>Login Group</tr>\n" |
| 172 | 184 | "</thead><tbody>\n"); |
| 173 | 185 | db_prepare(&q, "SELECT pathname" |
| 174 | 186 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| @@ -278,10 +290,16 @@ | ||
| 278 | 290 | zUrl, zName); |
| 279 | 291 | } |
| 280 | 292 | if( x.zProjName ){ |
| 281 | 293 | blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName); |
| 282 | 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); | |
| 283 | 301 | }else{ |
| 284 | 302 | blob_append_sql(&html, "<td></td><td></td>\n"); |
| 285 | 303 | } |
| 286 | 304 | blob_append_sql(&html, |
| 287 | 305 | "<td></td><td data-sortkey='%08x'>%h</td>\n", |
| 288 | 306 |
| --- 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 |