Fossil SCM
Include the login-group in the repository list of "fossil all ui".
Commit
fe178faa44f3f97ef609ca6f9bb6ba57d9db9b4f73217bc97eb5a13192b0b4b3
Parent
2d79135b764968b…
1 file changed
+19
-3
+19
-3
| --- 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 *zLoginGroup; /* Name of login group, or NULL. Malloced() */ | |
| 36 | 37 | double rMTime; /* Last update. Julian day number */ |
| 37 | 38 | }; |
| 38 | 39 | #endif |
| 39 | 40 | |
| 40 | 41 | /* |
| @@ -48,10 +49,11 @@ | ||
| 48 | 49 | int rc; |
| 49 | 50 | |
| 50 | 51 | pRepo->isRepolistSkin = 0; |
| 51 | 52 | pRepo->isValid = 0; |
| 52 | 53 | pRepo->zProjName = 0; |
| 54 | + pRepo->zLoginGroup = 0; | |
| 53 | 55 | pRepo->rMTime = 0.0; |
| 54 | 56 | |
| 55 | 57 | g.dbIgnoreErrors++; |
| 56 | 58 | rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0); |
| 57 | 59 | if( rc ) goto finish_repo_list; |
| @@ -69,10 +71,17 @@ | ||
| 69 | 71 | -1, &pStmt, 0); |
| 70 | 72 | if( rc ) goto finish_repo_list; |
| 71 | 73 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 72 | 74 | pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0)); |
| 73 | 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 ){ | |
| 81 | + pRepo->zLoginGroup = fossil_strdup((char*)sqlite3_column_text(pStmt,0)); | |
| 82 | + } | |
| 74 | 83 | sqlite3_finalize(pStmt); |
| 75 | 84 | rc = sqlite3_prepare_v2(db, "SELECT max(mtime) FROM event", -1, &pStmt, 0); |
| 76 | 85 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 77 | 86 | pRepo->rMTime = sqlite3_column_double(pStmt,0); |
| 78 | 87 | } |
| @@ -149,14 +158,15 @@ | ||
| 149 | 158 | }else{ |
| 150 | 159 | Stmt q; |
| 151 | 160 | double rNow; |
| 152 | 161 | blob_append_sql(&html, |
| 153 | 162 | "<table border='0' class='sortable' data-init-sort='1'" |
| 154 | - " data-column-types='txtxk'><thead>\n" | |
| 163 | + " data-column-types='txtxkxt'><thead>\n" | |
| 155 | 164 | "<tr><th>Filename<th width='20'>" |
| 156 | 165 | "<th>Project Name<th width='20'>" |
| 157 | - "<th>Last Modified</tr>\n" | |
| 166 | + "<th>Last Modified<th width='20'>" | |
| 167 | + "<th>Login Group</tr>\n" | |
| 158 | 168 | "</thead><tbody>\n"); |
| 159 | 169 | db_prepare(&q, "SELECT pathname" |
| 160 | 170 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 161 | 171 | rNow = db_double(0, "SELECT julianday('now')"); |
| 162 | 172 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -223,13 +233,19 @@ | ||
| 223 | 233 | fossil_free(x.zProjName); |
| 224 | 234 | }else{ |
| 225 | 235 | blob_append_sql(&html, "<td></td><td></td>\n"); |
| 226 | 236 | } |
| 227 | 237 | blob_append_sql(&html, |
| 228 | - "<td></td><td data-sortkey='%08x'>%h</tr>\n", | |
| 238 | + "<td></td><td data-sortkey='%08x'>%h</td>\n", | |
| 229 | 239 | iAge, zAge); |
| 230 | 240 | fossil_free(zAge); |
| 241 | + if( x.zLoginGroup ){ | |
| 242 | + blob_append_sql(&html, "<td></td><td>%h</td></tr>\n", x.zLoginGroup); | |
| 243 | + fossil_free(x.zLoginGroup); | |
| 244 | + }else{ | |
| 245 | + blob_append_sql(&html, "<td></td><td></td></tr>\n"); | |
| 246 | + } | |
| 231 | 247 | sqlite3_free(zUrl); |
| 232 | 248 | } |
| 233 | 249 | db_finalize(&q); |
| 234 | 250 | blob_append_sql(&html,"</tbody></table>\n"); |
| 235 | 251 | } |
| 236 | 252 |
| --- 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 | double rMTime; /* Last update. Julian day number */ |
| 37 | }; |
| 38 | #endif |
| 39 | |
| 40 | /* |
| @@ -48,10 +49,11 @@ | |
| 48 | int rc; |
| 49 | |
| 50 | pRepo->isRepolistSkin = 0; |
| 51 | pRepo->isValid = 0; |
| 52 | pRepo->zProjName = 0; |
| 53 | pRepo->rMTime = 0.0; |
| 54 | |
| 55 | g.dbIgnoreErrors++; |
| 56 | rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0); |
| 57 | if( rc ) goto finish_repo_list; |
| @@ -69,10 +71,17 @@ | |
| 69 | -1, &pStmt, 0); |
| 70 | if( rc ) goto finish_repo_list; |
| 71 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 72 | pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0)); |
| 73 | } |
| 74 | sqlite3_finalize(pStmt); |
| 75 | rc = sqlite3_prepare_v2(db, "SELECT max(mtime) FROM event", -1, &pStmt, 0); |
| 76 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 77 | pRepo->rMTime = sqlite3_column_double(pStmt,0); |
| 78 | } |
| @@ -149,14 +158,15 @@ | |
| 149 | }else{ |
| 150 | Stmt q; |
| 151 | double rNow; |
| 152 | blob_append_sql(&html, |
| 153 | "<table border='0' class='sortable' data-init-sort='1'" |
| 154 | " data-column-types='txtxk'><thead>\n" |
| 155 | "<tr><th>Filename<th width='20'>" |
| 156 | "<th>Project Name<th width='20'>" |
| 157 | "<th>Last Modified</tr>\n" |
| 158 | "</thead><tbody>\n"); |
| 159 | db_prepare(&q, "SELECT pathname" |
| 160 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 161 | rNow = db_double(0, "SELECT julianday('now')"); |
| 162 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -223,13 +233,19 @@ | |
| 223 | fossil_free(x.zProjName); |
| 224 | }else{ |
| 225 | blob_append_sql(&html, "<td></td><td></td>\n"); |
| 226 | } |
| 227 | blob_append_sql(&html, |
| 228 | "<td></td><td data-sortkey='%08x'>%h</tr>\n", |
| 229 | iAge, zAge); |
| 230 | fossil_free(zAge); |
| 231 | sqlite3_free(zUrl); |
| 232 | } |
| 233 | db_finalize(&q); |
| 234 | blob_append_sql(&html,"</tbody></table>\n"); |
| 235 | } |
| 236 |
| --- 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 | |
| 41 | /* |
| @@ -48,10 +49,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); |
| 59 | if( rc ) goto finish_repo_list; |
| @@ -69,10 +71,17 @@ | |
| 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 ){ |
| 81 | pRepo->zLoginGroup = fossil_strdup((char*)sqlite3_column_text(pStmt,0)); |
| 82 | } |
| 83 | sqlite3_finalize(pStmt); |
| 84 | rc = sqlite3_prepare_v2(db, "SELECT max(mtime) FROM event", -1, &pStmt, 0); |
| 85 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 86 | pRepo->rMTime = sqlite3_column_double(pStmt,0); |
| 87 | } |
| @@ -149,14 +158,15 @@ | |
| 158 | }else{ |
| 159 | Stmt q; |
| 160 | double rNow; |
| 161 | blob_append_sql(&html, |
| 162 | "<table border='0' class='sortable' data-init-sort='1'" |
| 163 | " data-column-types='txtxkxt'><thead>\n" |
| 164 | "<tr><th>Filename<th width='20'>" |
| 165 | "<th>Project Name<th width='20'>" |
| 166 | "<th>Last Modified<th width='20'>" |
| 167 | "<th>Login Group</tr>\n" |
| 168 | "</thead><tbody>\n"); |
| 169 | db_prepare(&q, "SELECT pathname" |
| 170 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 171 | rNow = db_double(0, "SELECT julianday('now')"); |
| 172 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -223,13 +233,19 @@ | |
| 233 | fossil_free(x.zProjName); |
| 234 | }else{ |
| 235 | blob_append_sql(&html, "<td></td><td></td>\n"); |
| 236 | } |
| 237 | blob_append_sql(&html, |
| 238 | "<td></td><td data-sortkey='%08x'>%h</td>\n", |
| 239 | iAge, zAge); |
| 240 | fossil_free(zAge); |
| 241 | if( x.zLoginGroup ){ |
| 242 | blob_append_sql(&html, "<td></td><td>%h</td></tr>\n", x.zLoginGroup); |
| 243 | fossil_free(x.zLoginGroup); |
| 244 | }else{ |
| 245 | blob_append_sql(&html, "<td></td><td></td></tr>\n"); |
| 246 | } |
| 247 | sqlite3_free(zUrl); |
| 248 | } |
| 249 | db_finalize(&q); |
| 250 | blob_append_sql(&html,"</tbody></table>\n"); |
| 251 | } |
| 252 |