Fossil SCM
The "fossil all ui" command still does not work for repos that do not end in ".fossil", but it at least does not hyperlink them any more.
Commit
805122df65c582a04bb880fe6131831c144da34c
Parent
76d9a4555b56405…
1 file changed
+14
-5
+14
-5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1258,20 +1258,29 @@ | ||
| 1258 | 1258 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1259 | 1259 | if( n>0 ){ |
| 1260 | 1260 | Stmt q; |
| 1261 | 1261 | @ <h1>Available Repositories:</h1> |
| 1262 | 1262 | @ <ol> |
| 1263 | - db_prepare(&q, "SELECT pathname, substr(pathname,-7,-100000)||'/home'" | |
| 1263 | + db_prepare(&q, "SELECT pathname" | |
| 1264 | 1264 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 1265 | 1265 | while( db_step(&q)==SQLITE_ROW ){ |
| 1266 | 1266 | const char *zName = db_column_text(&q, 0); |
| 1267 | - const char *zUrl = db_column_text(&q, 1); | |
| 1268 | - if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){ | |
| 1269 | - @ <li><a href="%R/%T(zUrl)" target="_blank">/%h(zName)</a></li> | |
| 1267 | + int nName = (int)strlen(zName); | |
| 1268 | + char *zUrl; | |
| 1269 | + if( nName<7 ) continue; | |
| 1270 | + zUrl = sqlite3_mprintf("%.*s", nName-7, zName); | |
| 1271 | + if( sqlite3_strglob("*.fossil", zName)!=0 ){ | |
| 1272 | + /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands | |
| 1273 | + ** do not work for repositories whose names do not end in ".fossil". | |
| 1274 | + ** So do not hyperlink those cases. */ | |
| 1275 | + @ <li>%h(zName)</li> | |
| 1276 | + } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){ | |
| 1277 | + @ <li><a href="%R/%T(zUrl)/home" target="_blank">/%h(zName)</a></li> | |
| 1270 | 1278 | }else{ |
| 1271 | - @ <li><a href="%R/%T(zUrl)" target="_blank">%h(zName)</a></li> | |
| 1279 | + @ <li><a href="%R/%T(zUrl)/home" target="_blank">%h(zName)</a></li> | |
| 1272 | 1280 | } |
| 1281 | + sqlite3_free(zUrl); | |
| 1273 | 1282 | } |
| 1274 | 1283 | @ </ol> |
| 1275 | 1284 | }else{ |
| 1276 | 1285 | @ <h1>No Repositories Found</h1> |
| 1277 | 1286 | } |
| 1278 | 1287 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1258,20 +1258,29 @@ | |
| 1258 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1259 | if( n>0 ){ |
| 1260 | Stmt q; |
| 1261 | @ <h1>Available Repositories:</h1> |
| 1262 | @ <ol> |
| 1263 | db_prepare(&q, "SELECT pathname, substr(pathname,-7,-100000)||'/home'" |
| 1264 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 1265 | while( db_step(&q)==SQLITE_ROW ){ |
| 1266 | const char *zName = db_column_text(&q, 0); |
| 1267 | const char *zUrl = db_column_text(&q, 1); |
| 1268 | if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){ |
| 1269 | @ <li><a href="%R/%T(zUrl)" target="_blank">/%h(zName)</a></li> |
| 1270 | }else{ |
| 1271 | @ <li><a href="%R/%T(zUrl)" target="_blank">%h(zName)</a></li> |
| 1272 | } |
| 1273 | } |
| 1274 | @ </ol> |
| 1275 | }else{ |
| 1276 | @ <h1>No Repositories Found</h1> |
| 1277 | } |
| 1278 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1258,20 +1258,29 @@ | |
| 1258 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1259 | if( n>0 ){ |
| 1260 | Stmt q; |
| 1261 | @ <h1>Available Repositories:</h1> |
| 1262 | @ <ol> |
| 1263 | db_prepare(&q, "SELECT pathname" |
| 1264 | " FROM sfile ORDER BY pathname COLLATE nocase;"); |
| 1265 | while( db_step(&q)==SQLITE_ROW ){ |
| 1266 | const char *zName = db_column_text(&q, 0); |
| 1267 | int nName = (int)strlen(zName); |
| 1268 | char *zUrl; |
| 1269 | if( nName<7 ) continue; |
| 1270 | zUrl = sqlite3_mprintf("%.*s", nName-7, zName); |
| 1271 | if( sqlite3_strglob("*.fossil", zName)!=0 ){ |
| 1272 | /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands |
| 1273 | ** do not work for repositories whose names do not end in ".fossil". |
| 1274 | ** So do not hyperlink those cases. */ |
| 1275 | @ <li>%h(zName)</li> |
| 1276 | } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){ |
| 1277 | @ <li><a href="%R/%T(zUrl)/home" target="_blank">/%h(zName)</a></li> |
| 1278 | }else{ |
| 1279 | @ <li><a href="%R/%T(zUrl)/home" target="_blank">%h(zName)</a></li> |
| 1280 | } |
| 1281 | sqlite3_free(zUrl); |
| 1282 | } |
| 1283 | @ </ol> |
| 1284 | }else{ |
| 1285 | @ <h1>No Repositories Found</h1> |
| 1286 | } |
| 1287 |