| ︙ | | | ︙ | |
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
struct RepoInfo {
char *zRepoName; /* Name of the repository file */
int isValid; /* True if zRepoName is a valid Fossil repository */
int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
** for the repository list. 2 means do use this
** repository but do not display it in the list. */
char *zProjName; /* Project Name. Memory from fossil_malloc() */
double rMTime; /* Last update. Julian day number */
};
#endif
/*
** Discover information about the repository given by
** pRepo->zRepoName. The discovered information is stored in other
** fields of the RepoInfo object.
*/
static void remote_repo_info(RepoInfo *pRepo){
sqlite3 *db;
sqlite3_stmt *pStmt;
int rc;
pRepo->isRepolistSkin = 0;
pRepo->isValid = 0;
pRepo->zProjName = 0;
pRepo->rMTime = 0.0;
g.dbIgnoreErrors++;
rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
if( rc ) goto finish_repo_list;
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
" WHERE name='repolist-skin'",
|
>
>
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
struct RepoInfo {
char *zRepoName; /* Name of the repository file */
int isValid; /* True if zRepoName is a valid Fossil repository */
int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
** for the repository list. 2 means do use this
** repository but do not display it in the list. */
char *zProjName; /* Project Name. Memory from fossil_malloc() */
char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
double rMTime; /* Last update. Julian day number */
};
#endif
/*
** Discover information about the repository given by
** pRepo->zRepoName. The discovered information is stored in other
** fields of the RepoInfo object.
*/
static void remote_repo_info(RepoInfo *pRepo){
sqlite3 *db;
sqlite3_stmt *pStmt;
int rc;
pRepo->isRepolistSkin = 0;
pRepo->isValid = 0;
pRepo->zProjName = 0;
pRepo->zLoginGroup = 0;
pRepo->rMTime = 0.0;
g.dbIgnoreErrors++;
rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
if( rc ) goto finish_repo_list;
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
" WHERE name='repolist-skin'",
|
| ︙ | | | ︙ | |
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
" WHERE name='project-name'",
-1, &pStmt, 0);
if( rc ) goto finish_repo_list;
if( sqlite3_step(pStmt)==SQLITE_ROW ){
pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
}
sqlite3_finalize(pStmt);
rc = sqlite3_prepare_v2(db, "SELECT max(mtime) FROM event", -1, &pStmt, 0);
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
pRepo->rMTime = sqlite3_column_double(pStmt,0);
}
pRepo->isValid = 1;
sqlite3_finalize(pStmt);
|
>
>
>
>
>
>
>
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
" WHERE name='project-name'",
-1, &pStmt, 0);
if( rc ) goto finish_repo_list;
if( sqlite3_step(pStmt)==SQLITE_ROW ){
pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
}
sqlite3_finalize(pStmt);
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
" WHERE name='login-group-name'",
-1, &pStmt, 0);
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
pRepo->zLoginGroup = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
}
sqlite3_finalize(pStmt);
rc = sqlite3_prepare_v2(db, "SELECT max(mtime) FROM event", -1, &pStmt, 0);
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
pRepo->rMTime = sqlite3_column_double(pStmt,0);
}
pRepo->isValid = 1;
sqlite3_finalize(pStmt);
|
| ︙ | | | ︙ | |
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
g.localOpen = 0;
return 0;
}else{
Stmt q;
double rNow;
blob_append_sql(&html,
"<table border='0' class='sortable' data-init-sort='1'"
" data-column-types='txtxk'><thead>\n"
"<tr><th>Filename<th width='20'>"
"<th>Project Name<th width='20'>"
"<th>Last Modified</tr>\n"
"</thead><tbody>\n");
db_prepare(&q, "SELECT pathname"
" FROM sfile ORDER BY pathname COLLATE nocase;");
rNow = db_double(0, "SELECT julianday('now')");
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
int nName = (int)strlen(zName);
|
|
|
>
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
g.localOpen = 0;
return 0;
}else{
Stmt q;
double rNow;
blob_append_sql(&html,
"<table border='0' class='sortable' data-init-sort='1'"
" data-column-types='txtxkxt'><thead>\n"
"<tr><th>Filename<th width='20'>"
"<th>Project Name<th width='20'>"
"<th>Last Modified<th width='20'>"
"<th>Login Group</tr>\n"
"</thead><tbody>\n");
db_prepare(&q, "SELECT pathname"
" FROM sfile ORDER BY pathname COLLATE nocase;");
rNow = db_double(0, "SELECT julianday('now')");
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
int nName = (int)strlen(zName);
|
| ︙ | | | ︙ | |
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
if( x.zProjName ){
blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
fossil_free(x.zProjName);
}else{
blob_append_sql(&html, "<td></td><td></td>\n");
}
blob_append_sql(&html,
"<td></td><td data-sortkey='%08x'>%h</tr>\n",
iAge, zAge);
fossil_free(zAge);
sqlite3_free(zUrl);
}
db_finalize(&q);
blob_append_sql(&html,"</tbody></table>\n");
}
if( zSkinRepo ){
char *zNewBase = mprintf("%s/%s", g.zBaseURL, zSkinUrl);
|
|
>
>
>
>
>
>
|
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
if( x.zProjName ){
blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
fossil_free(x.zProjName);
}else{
blob_append_sql(&html, "<td></td><td></td>\n");
}
blob_append_sql(&html,
"<td></td><td data-sortkey='%08x'>%h</td>\n",
iAge, zAge);
fossil_free(zAge);
if( x.zLoginGroup ){
blob_append_sql(&html, "<td></td><td>%h</td></tr>\n", x.zLoginGroup);
fossil_free(x.zLoginGroup);
}else{
blob_append_sql(&html, "<td></td><td></td></tr>\n");
}
sqlite3_free(zUrl);
}
db_finalize(&q);
blob_append_sql(&html,"</tbody></table>\n");
}
if( zSkinRepo ){
char *zNewBase = mprintf("%s/%s", g.zBaseURL, zSkinUrl);
|
| ︙ | | | ︙ | |