Fossil

Diff
Login

Differences From Artifact [bd36cac453]:

To Artifact [aac1bd0eb6]:


1256
1257
1258
1259
1260
1261
1262
1263

1264
1265
1266

1267
1268
1269










1270
1271

1272

1273
1274
1275
1276
1277
1278
1279
1256
1257
1258
1259
1260
1261
1262

1263
1264
1265
1266
1267



1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278

1279
1280
1281
1282
1283
1284
1285
1286
1287
1288







-
+



+
-
-
-
+
+
+
+
+
+
+
+
+
+

-
+

+







  @ </head>
  @ <body>
  n = db_int(0, "SELECT count(*) FROM sfile");
  if( n>0 ){
    Stmt q;
    @ <h1>Available Repositories:</h1>
    @ <ol>
    db_prepare(&q, "SELECT pathname, substr(pathname,-7,-100000)||'/home'"
    db_prepare(&q, "SELECT pathname"
                   " FROM sfile ORDER BY pathname COLLATE nocase;");
    while( db_step(&q)==SQLITE_ROW ){
      const char *zName = db_column_text(&q, 0);
      int nName = (int)strlen(zName);
      const char *zUrl = db_column_text(&q, 1);
      if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
        @ <li><a href="%R/%T(zUrl)" target="_blank">/%h(zName)</a></li>
      char *zUrl;
      if( nName<7 ) continue;
      zUrl = sqlite3_mprintf("%.*s", nName-7, zName);
      if( sqlite3_strglob("*.fossil", zName)!=0 ){
        /* The "fossil server DIRECTORY" and "fossil ui DIRECTORY" commands
        ** do not work for repositories whose names do not end in ".fossil".
        ** So do not hyperlink those cases. */
        @ <li>%h(zName)</li>
      } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
        @ <li><a href="%R/%T(zUrl)/home" target="_blank">/%h(zName)</a></li>
      }else{
        @ <li><a href="%R/%T(zUrl)" target="_blank">%h(zName)</a></li>
        @ <li><a href="%R/%T(zUrl)/home" target="_blank">%h(zName)</a></li>
      }
      sqlite3_free(zUrl);
    }
    @ </ol>
  }else{
    @ <h1>No Repositories Found</h1>
  }
  @ </body>
  @ </html>