Fossil SCM
Add the 'unversioned' command to TH1, with the 'content' and 'list' sub-commands.
Commit
1b5b69f3cff213750c9d1813ac24ae0607de0ea7
Parent
796c9abacd626d0…
7 files changed
+83
+83
+37
-1
+4
+4
+19
+19
+83
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1317,10 +1317,92 @@ | ||
| 1317 | 1317 | }else{ |
| 1318 | 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | 1319 | return TH_ERROR; |
| 1320 | 1320 | } |
| 1321 | 1321 | } |
| 1322 | + | |
| 1323 | +/* | |
| 1324 | +** TH1 command: unversioned content FILENAME | |
| 1325 | +** | |
| 1326 | +** Attempts to locate the specified unversioned file and return its contents. | |
| 1327 | +** An error is generated if the repository is not open or the unversioned file | |
| 1328 | +** cannot be found. | |
| 1329 | +*/ | |
| 1330 | +static int unversionedContentCmd( | |
| 1331 | + Th_Interp *interp, | |
| 1332 | + void *p, | |
| 1333 | + int argc, | |
| 1334 | + const char **argv, | |
| 1335 | + int *argl | |
| 1336 | +){ | |
| 1337 | + if( argc!=3 ){ | |
| 1338 | + return Th_WrongNumArgs(interp, "unversioned content FILENAME"); | |
| 1339 | + } | |
| 1340 | + if( Th_IsRepositoryOpen() ){ | |
| 1341 | + Blob content; | |
| 1342 | + if( unversioned_content(argv[2], &content)==0 ){ | |
| 1343 | + Th_SetResult(interp, blob_str(&content), blob_size(&content)); | |
| 1344 | + blob_reset(&content); | |
| 1345 | + return TH_OK; | |
| 1346 | + }else{ | |
| 1347 | + return TH_ERROR; | |
| 1348 | + } | |
| 1349 | + }else{ | |
| 1350 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 1351 | + return TH_ERROR; | |
| 1352 | + } | |
| 1353 | +} | |
| 1354 | + | |
| 1355 | +/* | |
| 1356 | +** TH1 command: unversioned list | |
| 1357 | +** | |
| 1358 | +** Returns a list of the names of all unversioned files held in the local | |
| 1359 | +** repository. An error is generated if the repository is not open. | |
| 1360 | +*/ | |
| 1361 | +static int unversionedListCmd( | |
| 1362 | + Th_Interp *interp, | |
| 1363 | + void *p, | |
| 1364 | + int argc, | |
| 1365 | + const char **argv, | |
| 1366 | + int *argl | |
| 1367 | +){ | |
| 1368 | + if( argc!=2 ){ | |
| 1369 | + return Th_WrongNumArgs(interp, "unversioned list"); | |
| 1370 | + } | |
| 1371 | + if( Th_IsRepositoryOpen() ){ | |
| 1372 | + Stmt q; | |
| 1373 | + char *zList = 0; | |
| 1374 | + int nList = 0; | |
| 1375 | + db_prepare(&q, "SELECT name FROM unversioned WHERE hash IS NOT NULL" | |
| 1376 | + " ORDER BY name"); | |
| 1377 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 1378 | + Th_ListAppend(interp, &zList, &nList, db_column_text(&q,0), -1); | |
| 1379 | + } | |
| 1380 | + db_finalize(&q); | |
| 1381 | + Th_SetResult(interp, zList, nList); | |
| 1382 | + Th_Free(interp, zList); | |
| 1383 | + return TH_OK; | |
| 1384 | + }else{ | |
| 1385 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 1386 | + return TH_ERROR; | |
| 1387 | + } | |
| 1388 | +} | |
| 1389 | + | |
| 1390 | +static int unversionedCmd( | |
| 1391 | + Th_Interp *interp, | |
| 1392 | + void *p, | |
| 1393 | + int argc, | |
| 1394 | + const char **argv, | |
| 1395 | + int *argl | |
| 1396 | +){ | |
| 1397 | + static const Th_SubCommand aSub[] = { | |
| 1398 | + { "content", unversionedContentCmd }, | |
| 1399 | + { "list", unversionedListCmd }, | |
| 1400 | + { 0, 0 } | |
| 1401 | + }; | |
| 1402 | + return Th_CallSubCommand(interp, p, argc, argv, argl, aSub); | |
| 1403 | +} | |
| 1322 | 1404 | |
| 1323 | 1405 | #ifdef _WIN32 |
| 1324 | 1406 | # include <windows.h> |
| 1325 | 1407 | #else |
| 1326 | 1408 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | ||
| 1886 | 1968 | {"styleHeader", styleHeaderCmd, 0}, |
| 1887 | 1969 | {"styleFooter", styleFooterCmd, 0}, |
| 1888 | 1970 | {"tclReady", tclReadyCmd, 0}, |
| 1889 | 1971 | {"trace", traceCmd, 0}, |
| 1890 | 1972 | {"stime", stimeCmd, 0}, |
| 1973 | + {"unversioned", unversionedCmd, 0}, | |
| 1891 | 1974 | {"utime", utimeCmd, 0}, |
| 1892 | 1975 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1893 | 1976 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1894 | 1977 | {0, 0, 0} |
| 1895 | 1978 | }; |
| 1896 | 1979 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1317,10 +1317,92 @@ | |
| 1317 | }else{ |
| 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | return TH_ERROR; |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | #ifdef _WIN32 |
| 1324 | # include <windows.h> |
| 1325 | #else |
| 1326 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | |
| 1886 | {"styleHeader", styleHeaderCmd, 0}, |
| 1887 | {"styleFooter", styleFooterCmd, 0}, |
| 1888 | {"tclReady", tclReadyCmd, 0}, |
| 1889 | {"trace", traceCmd, 0}, |
| 1890 | {"stime", stimeCmd, 0}, |
| 1891 | {"utime", utimeCmd, 0}, |
| 1892 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1893 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1894 | {0, 0, 0} |
| 1895 | }; |
| 1896 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1317,10 +1317,92 @@ | |
| 1317 | }else{ |
| 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | return TH_ERROR; |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | /* |
| 1324 | ** TH1 command: unversioned content FILENAME |
| 1325 | ** |
| 1326 | ** Attempts to locate the specified unversioned file and return its contents. |
| 1327 | ** An error is generated if the repository is not open or the unversioned file |
| 1328 | ** cannot be found. |
| 1329 | */ |
| 1330 | static int unversionedContentCmd( |
| 1331 | Th_Interp *interp, |
| 1332 | void *p, |
| 1333 | int argc, |
| 1334 | const char **argv, |
| 1335 | int *argl |
| 1336 | ){ |
| 1337 | if( argc!=3 ){ |
| 1338 | return Th_WrongNumArgs(interp, "unversioned content FILENAME"); |
| 1339 | } |
| 1340 | if( Th_IsRepositoryOpen() ){ |
| 1341 | Blob content; |
| 1342 | if( unversioned_content(argv[2], &content)==0 ){ |
| 1343 | Th_SetResult(interp, blob_str(&content), blob_size(&content)); |
| 1344 | blob_reset(&content); |
| 1345 | return TH_OK; |
| 1346 | }else{ |
| 1347 | return TH_ERROR; |
| 1348 | } |
| 1349 | }else{ |
| 1350 | Th_SetResult(interp, "repository unavailable", -1); |
| 1351 | return TH_ERROR; |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | /* |
| 1356 | ** TH1 command: unversioned list |
| 1357 | ** |
| 1358 | ** Returns a list of the names of all unversioned files held in the local |
| 1359 | ** repository. An error is generated if the repository is not open. |
| 1360 | */ |
| 1361 | static int unversionedListCmd( |
| 1362 | Th_Interp *interp, |
| 1363 | void *p, |
| 1364 | int argc, |
| 1365 | const char **argv, |
| 1366 | int *argl |
| 1367 | ){ |
| 1368 | if( argc!=2 ){ |
| 1369 | return Th_WrongNumArgs(interp, "unversioned list"); |
| 1370 | } |
| 1371 | if( Th_IsRepositoryOpen() ){ |
| 1372 | Stmt q; |
| 1373 | char *zList = 0; |
| 1374 | int nList = 0; |
| 1375 | db_prepare(&q, "SELECT name FROM unversioned WHERE hash IS NOT NULL" |
| 1376 | " ORDER BY name"); |
| 1377 | while( db_step(&q)==SQLITE_ROW ){ |
| 1378 | Th_ListAppend(interp, &zList, &nList, db_column_text(&q,0), -1); |
| 1379 | } |
| 1380 | db_finalize(&q); |
| 1381 | Th_SetResult(interp, zList, nList); |
| 1382 | Th_Free(interp, zList); |
| 1383 | return TH_OK; |
| 1384 | }else{ |
| 1385 | Th_SetResult(interp, "repository unavailable", -1); |
| 1386 | return TH_ERROR; |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | static int unversionedCmd( |
| 1391 | Th_Interp *interp, |
| 1392 | void *p, |
| 1393 | int argc, |
| 1394 | const char **argv, |
| 1395 | int *argl |
| 1396 | ){ |
| 1397 | static const Th_SubCommand aSub[] = { |
| 1398 | { "content", unversionedContentCmd }, |
| 1399 | { "list", unversionedListCmd }, |
| 1400 | { 0, 0 } |
| 1401 | }; |
| 1402 | return Th_CallSubCommand(interp, p, argc, argv, argl, aSub); |
| 1403 | } |
| 1404 | |
| 1405 | #ifdef _WIN32 |
| 1406 | # include <windows.h> |
| 1407 | #else |
| 1408 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | |
| 1968 | {"styleHeader", styleHeaderCmd, 0}, |
| 1969 | {"styleFooter", styleFooterCmd, 0}, |
| 1970 | {"tclReady", tclReadyCmd, 0}, |
| 1971 | {"trace", traceCmd, 0}, |
| 1972 | {"stime", stimeCmd, 0}, |
| 1973 | {"unversioned", unversionedCmd, 0}, |
| 1974 | {"utime", utimeCmd, 0}, |
| 1975 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1976 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1977 | {0, 0, 0} |
| 1978 | }; |
| 1979 |
+83
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1317,10 +1317,92 @@ | ||
| 1317 | 1317 | }else{ |
| 1318 | 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | 1319 | return TH_ERROR; |
| 1320 | 1320 | } |
| 1321 | 1321 | } |
| 1322 | + | |
| 1323 | +/* | |
| 1324 | +** TH1 command: unversioned content FILENAME | |
| 1325 | +** | |
| 1326 | +** Attempts to locate the specified unversioned file and return its contents. | |
| 1327 | +** An error is generated if the repository is not open or the unversioned file | |
| 1328 | +** cannot be found. | |
| 1329 | +*/ | |
| 1330 | +static int unversionedContentCmd( | |
| 1331 | + Th_Interp *interp, | |
| 1332 | + void *p, | |
| 1333 | + int argc, | |
| 1334 | + const char **argv, | |
| 1335 | + int *argl | |
| 1336 | +){ | |
| 1337 | + if( argc!=3 ){ | |
| 1338 | + return Th_WrongNumArgs(interp, "unversioned content FILENAME"); | |
| 1339 | + } | |
| 1340 | + if( Th_IsRepositoryOpen() ){ | |
| 1341 | + Blob content; | |
| 1342 | + if( unversioned_content(argv[2], &content)==0 ){ | |
| 1343 | + Th_SetResult(interp, blob_str(&content), blob_size(&content)); | |
| 1344 | + blob_reset(&content); | |
| 1345 | + return TH_OK; | |
| 1346 | + }else{ | |
| 1347 | + return TH_ERROR; | |
| 1348 | + } | |
| 1349 | + }else{ | |
| 1350 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 1351 | + return TH_ERROR; | |
| 1352 | + } | |
| 1353 | +} | |
| 1354 | + | |
| 1355 | +/* | |
| 1356 | +** TH1 command: unversioned list | |
| 1357 | +** | |
| 1358 | +** Returns a list of the names of all unversioned files held in the local | |
| 1359 | +** repository. An error is generated if the repository is not open. | |
| 1360 | +*/ | |
| 1361 | +static int unversionedListCmd( | |
| 1362 | + Th_Interp *interp, | |
| 1363 | + void *p, | |
| 1364 | + int argc, | |
| 1365 | + const char **argv, | |
| 1366 | + int *argl | |
| 1367 | +){ | |
| 1368 | + if( argc!=2 ){ | |
| 1369 | + return Th_WrongNumArgs(interp, "unversioned list"); | |
| 1370 | + } | |
| 1371 | + if( Th_IsRepositoryOpen() ){ | |
| 1372 | + Stmt q; | |
| 1373 | + char *zList = 0; | |
| 1374 | + int nList = 0; | |
| 1375 | + db_prepare(&q, "SELECT name FROM unversioned WHERE hash IS NOT NULL" | |
| 1376 | + " ORDER BY name"); | |
| 1377 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 1378 | + Th_ListAppend(interp, &zList, &nList, db_column_text(&q,0), -1); | |
| 1379 | + } | |
| 1380 | + db_finalize(&q); | |
| 1381 | + Th_SetResult(interp, zList, nList); | |
| 1382 | + Th_Free(interp, zList); | |
| 1383 | + return TH_OK; | |
| 1384 | + }else{ | |
| 1385 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 1386 | + return TH_ERROR; | |
| 1387 | + } | |
| 1388 | +} | |
| 1389 | + | |
| 1390 | +static int unversionedCmd( | |
| 1391 | + Th_Interp *interp, | |
| 1392 | + void *p, | |
| 1393 | + int argc, | |
| 1394 | + const char **argv, | |
| 1395 | + int *argl | |
| 1396 | +){ | |
| 1397 | + static const Th_SubCommand aSub[] = { | |
| 1398 | + { "content", unversionedContentCmd }, | |
| 1399 | + { "list", unversionedListCmd }, | |
| 1400 | + { 0, 0 } | |
| 1401 | + }; | |
| 1402 | + return Th_CallSubCommand(interp, p, argc, argv, argl, aSub); | |
| 1403 | +} | |
| 1322 | 1404 | |
| 1323 | 1405 | #ifdef _WIN32 |
| 1324 | 1406 | # include <windows.h> |
| 1325 | 1407 | #else |
| 1326 | 1408 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | ||
| 1886 | 1968 | {"styleHeader", styleHeaderCmd, 0}, |
| 1887 | 1969 | {"styleFooter", styleFooterCmd, 0}, |
| 1888 | 1970 | {"tclReady", tclReadyCmd, 0}, |
| 1889 | 1971 | {"trace", traceCmd, 0}, |
| 1890 | 1972 | {"stime", stimeCmd, 0}, |
| 1973 | + {"unversioned", unversionedCmd, 0}, | |
| 1891 | 1974 | {"utime", utimeCmd, 0}, |
| 1892 | 1975 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1893 | 1976 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1894 | 1977 | {0, 0, 0} |
| 1895 | 1978 | }; |
| 1896 | 1979 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1317,10 +1317,92 @@ | |
| 1317 | }else{ |
| 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | return TH_ERROR; |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | #ifdef _WIN32 |
| 1324 | # include <windows.h> |
| 1325 | #else |
| 1326 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | |
| 1886 | {"styleHeader", styleHeaderCmd, 0}, |
| 1887 | {"styleFooter", styleFooterCmd, 0}, |
| 1888 | {"tclReady", tclReadyCmd, 0}, |
| 1889 | {"trace", traceCmd, 0}, |
| 1890 | {"stime", stimeCmd, 0}, |
| 1891 | {"utime", utimeCmd, 0}, |
| 1892 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1893 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1894 | {0, 0, 0} |
| 1895 | }; |
| 1896 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1317,10 +1317,92 @@ | |
| 1317 | }else{ |
| 1318 | Th_SetResult(interp, "repository unavailable", -1); |
| 1319 | return TH_ERROR; |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | /* |
| 1324 | ** TH1 command: unversioned content FILENAME |
| 1325 | ** |
| 1326 | ** Attempts to locate the specified unversioned file and return its contents. |
| 1327 | ** An error is generated if the repository is not open or the unversioned file |
| 1328 | ** cannot be found. |
| 1329 | */ |
| 1330 | static int unversionedContentCmd( |
| 1331 | Th_Interp *interp, |
| 1332 | void *p, |
| 1333 | int argc, |
| 1334 | const char **argv, |
| 1335 | int *argl |
| 1336 | ){ |
| 1337 | if( argc!=3 ){ |
| 1338 | return Th_WrongNumArgs(interp, "unversioned content FILENAME"); |
| 1339 | } |
| 1340 | if( Th_IsRepositoryOpen() ){ |
| 1341 | Blob content; |
| 1342 | if( unversioned_content(argv[2], &content)==0 ){ |
| 1343 | Th_SetResult(interp, blob_str(&content), blob_size(&content)); |
| 1344 | blob_reset(&content); |
| 1345 | return TH_OK; |
| 1346 | }else{ |
| 1347 | return TH_ERROR; |
| 1348 | } |
| 1349 | }else{ |
| 1350 | Th_SetResult(interp, "repository unavailable", -1); |
| 1351 | return TH_ERROR; |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | /* |
| 1356 | ** TH1 command: unversioned list |
| 1357 | ** |
| 1358 | ** Returns a list of the names of all unversioned files held in the local |
| 1359 | ** repository. An error is generated if the repository is not open. |
| 1360 | */ |
| 1361 | static int unversionedListCmd( |
| 1362 | Th_Interp *interp, |
| 1363 | void *p, |
| 1364 | int argc, |
| 1365 | const char **argv, |
| 1366 | int *argl |
| 1367 | ){ |
| 1368 | if( argc!=2 ){ |
| 1369 | return Th_WrongNumArgs(interp, "unversioned list"); |
| 1370 | } |
| 1371 | if( Th_IsRepositoryOpen() ){ |
| 1372 | Stmt q; |
| 1373 | char *zList = 0; |
| 1374 | int nList = 0; |
| 1375 | db_prepare(&q, "SELECT name FROM unversioned WHERE hash IS NOT NULL" |
| 1376 | " ORDER BY name"); |
| 1377 | while( db_step(&q)==SQLITE_ROW ){ |
| 1378 | Th_ListAppend(interp, &zList, &nList, db_column_text(&q,0), -1); |
| 1379 | } |
| 1380 | db_finalize(&q); |
| 1381 | Th_SetResult(interp, zList, nList); |
| 1382 | Th_Free(interp, zList); |
| 1383 | return TH_OK; |
| 1384 | }else{ |
| 1385 | Th_SetResult(interp, "repository unavailable", -1); |
| 1386 | return TH_ERROR; |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | static int unversionedCmd( |
| 1391 | Th_Interp *interp, |
| 1392 | void *p, |
| 1393 | int argc, |
| 1394 | const char **argv, |
| 1395 | int *argl |
| 1396 | ){ |
| 1397 | static const Th_SubCommand aSub[] = { |
| 1398 | { "content", unversionedContentCmd }, |
| 1399 | { "list", unversionedListCmd }, |
| 1400 | { 0, 0 } |
| 1401 | }; |
| 1402 | return Th_CallSubCommand(interp, p, argc, argv, argl, aSub); |
| 1403 | } |
| 1404 | |
| 1405 | #ifdef _WIN32 |
| 1406 | # include <windows.h> |
| 1407 | #else |
| 1408 | # include <sys/time.h> |
| @@ -1886,10 +1968,11 @@ | |
| 1968 | {"styleHeader", styleHeaderCmd, 0}, |
| 1969 | {"styleFooter", styleFooterCmd, 0}, |
| 1970 | {"tclReady", tclReadyCmd, 0}, |
| 1971 | {"trace", traceCmd, 0}, |
| 1972 | {"stime", stimeCmd, 0}, |
| 1973 | {"unversioned", unversionedCmd, 0}, |
| 1974 | {"utime", utimeCmd, 0}, |
| 1975 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 1976 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1977 | {0, 0, 0} |
| 1978 | }; |
| 1979 |
+37
-1
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -1038,11 +1038,11 @@ | ||
| 1038 | 1038 | error expr for getParameter glob_match globalState hascap hasfeature\ |
| 1039 | 1039 | html htmlize http httpize if info insertCsrf lindex linecount list\ |
| 1040 | 1040 | llength lsearch markdown proc puts query randhex redirect regexp\ |
| 1041 | 1041 | reinitialize rename render repository return searchable set\ |
| 1042 | 1042 | setParameter setting stime string styleFooter styleHeader tclReady\ |
| 1043 | - trace unset uplevel upvar utime verifyCsrf wiki} | |
| 1043 | + trace unset unversioned uplevel upvar utime verifyCsrf wiki} | |
| 1044 | 1044 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1045 | 1045 | if {$th1Tcl} { |
| 1046 | 1046 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1047 | 1047 | } else { |
| 1048 | 1048 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| @@ -1562,9 +1562,45 @@ | ||
| 1562 | 1562 | } |
| 1563 | 1563 | |
| 1564 | 1564 | fossil test-th-source $th1FileName |
| 1565 | 1565 | test th1-source-1 {$RESULT eq {TH_RETURN: 0 1 2 3 4 5 6 7 8 9}} |
| 1566 | 1566 | file delete $th1FileName |
| 1567 | + | |
| 1568 | +############################################################################### | |
| 1569 | + | |
| 1570 | +# | |
| 1571 | +# TODO: Modify the result of this test if the list of unversioned files | |
| 1572 | +# changes. | |
| 1573 | +# | |
| 1574 | +run_in_checkout { | |
| 1575 | + fossil test-th-eval --open-config "unversioned list" | |
| 1576 | +} | |
| 1577 | + | |
| 1578 | +test th1-unversioned-1 {[normalize_result] eq \ | |
| 1579 | +{build-icons/linux.gif build-icons/linux64.gif build-icons/mac.gif\ | |
| 1580 | +build-icons/openbsd.gif build-icons/src.gif build-icons/win32.gif\ | |
| 1581 | +download.html download/fossil-linux-x86-1.32.zip\ | |
| 1582 | +download/fossil-linux-x86-1.33.zip download/fossil-linux-x86-1.34.zip\ | |
| 1583 | +download/fossil-linux-x86-1.35.zip download/fossil-macosx-x86-1.32.zip\ | |
| 1584 | +download/fossil-macosx-x86-1.33.zip download/fossil-macosx-x86-1.34.zip\ | |
| 1585 | +download/fossil-macosx-x86-1.35.zip download/fossil-openbsd-x86-1.32.zip\ | |
| 1586 | +download/fossil-openbsd-x86-1.33.zip download/fossil-openbsd-x86-1.34.tar.gz\ | |
| 1587 | +download/fossil-openbsd-x86-1.35.tar.gz download/fossil-src-1.32.tar.gz\ | |
| 1588 | +download/fossil-src-1.33.tar.gz download/fossil-src-1.34.tar.gz\ | |
| 1589 | +download/fossil-src-1.35.tar.gz download/fossil-w32-1.32.zip\ | |
| 1590 | +download/fossil-w32-1.33.zip download/fossil-w32-1.34.zip\ | |
| 1591 | +download/fossil-w32-1.35.zip download/releasenotes-1.32.html\ | |
| 1592 | +download/releasenotes-1.33.html download/releasenotes-1.34.html\ | |
| 1593 | +download/releasenotes-1.35.html index.wiki}} | |
| 1594 | + | |
| 1595 | +############################################################################### | |
| 1596 | + | |
| 1597 | +run_in_checkout { | |
| 1598 | + fossil test-th-eval --open-config \ | |
| 1599 | + {string length [unversioned content build-icons/src.gif]} | |
| 1600 | +} | |
| 1601 | + | |
| 1602 | +test th1-unversioned-2 {$RESULT eq {4592}} | |
| 1567 | 1603 | |
| 1568 | 1604 | ############################################################################### |
| 1569 | 1605 | |
| 1570 | 1606 | test_cleanup |
| 1571 | 1607 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -1038,11 +1038,11 @@ | |
| 1038 | error expr for getParameter glob_match globalState hascap hasfeature\ |
| 1039 | html htmlize http httpize if info insertCsrf lindex linecount list\ |
| 1040 | llength lsearch markdown proc puts query randhex redirect regexp\ |
| 1041 | reinitialize rename render repository return searchable set\ |
| 1042 | setParameter setting stime string styleFooter styleHeader tclReady\ |
| 1043 | trace unset uplevel upvar utime verifyCsrf wiki} |
| 1044 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1045 | if {$th1Tcl} { |
| 1046 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1047 | } else { |
| 1048 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| @@ -1562,9 +1562,45 @@ | |
| 1562 | } |
| 1563 | |
| 1564 | fossil test-th-source $th1FileName |
| 1565 | test th1-source-1 {$RESULT eq {TH_RETURN: 0 1 2 3 4 5 6 7 8 9}} |
| 1566 | file delete $th1FileName |
| 1567 | |
| 1568 | ############################################################################### |
| 1569 | |
| 1570 | test_cleanup |
| 1571 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -1038,11 +1038,11 @@ | |
| 1038 | error expr for getParameter glob_match globalState hascap hasfeature\ |
| 1039 | html htmlize http httpize if info insertCsrf lindex linecount list\ |
| 1040 | llength lsearch markdown proc puts query randhex redirect regexp\ |
| 1041 | reinitialize rename render repository return searchable set\ |
| 1042 | setParameter setting stime string styleFooter styleHeader tclReady\ |
| 1043 | trace unset unversioned uplevel upvar utime verifyCsrf wiki} |
| 1044 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1045 | if {$th1Tcl} { |
| 1046 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1047 | } else { |
| 1048 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| @@ -1562,9 +1562,45 @@ | |
| 1562 | } |
| 1563 | |
| 1564 | fossil test-th-source $th1FileName |
| 1565 | test th1-source-1 {$RESULT eq {TH_RETURN: 0 1 2 3 4 5 6 7 8 9}} |
| 1566 | file delete $th1FileName |
| 1567 | |
| 1568 | ############################################################################### |
| 1569 | |
| 1570 | # |
| 1571 | # TODO: Modify the result of this test if the list of unversioned files |
| 1572 | # changes. |
| 1573 | # |
| 1574 | run_in_checkout { |
| 1575 | fossil test-th-eval --open-config "unversioned list" |
| 1576 | } |
| 1577 | |
| 1578 | test th1-unversioned-1 {[normalize_result] eq \ |
| 1579 | {build-icons/linux.gif build-icons/linux64.gif build-icons/mac.gif\ |
| 1580 | build-icons/openbsd.gif build-icons/src.gif build-icons/win32.gif\ |
| 1581 | download.html download/fossil-linux-x86-1.32.zip\ |
| 1582 | download/fossil-linux-x86-1.33.zip download/fossil-linux-x86-1.34.zip\ |
| 1583 | download/fossil-linux-x86-1.35.zip download/fossil-macosx-x86-1.32.zip\ |
| 1584 | download/fossil-macosx-x86-1.33.zip download/fossil-macosx-x86-1.34.zip\ |
| 1585 | download/fossil-macosx-x86-1.35.zip download/fossil-openbsd-x86-1.32.zip\ |
| 1586 | download/fossil-openbsd-x86-1.33.zip download/fossil-openbsd-x86-1.34.tar.gz\ |
| 1587 | download/fossil-openbsd-x86-1.35.tar.gz download/fossil-src-1.32.tar.gz\ |
| 1588 | download/fossil-src-1.33.tar.gz download/fossil-src-1.34.tar.gz\ |
| 1589 | download/fossil-src-1.35.tar.gz download/fossil-w32-1.32.zip\ |
| 1590 | download/fossil-w32-1.33.zip download/fossil-w32-1.34.zip\ |
| 1591 | download/fossil-w32-1.35.zip download/releasenotes-1.32.html\ |
| 1592 | download/releasenotes-1.33.html download/releasenotes-1.34.html\ |
| 1593 | download/releasenotes-1.35.html index.wiki}} |
| 1594 | |
| 1595 | ############################################################################### |
| 1596 | |
| 1597 | run_in_checkout { |
| 1598 | fossil test-th-eval --open-config \ |
| 1599 | {string length [unversioned content build-icons/src.gif]} |
| 1600 | } |
| 1601 | |
| 1602 | test th1-unversioned-2 {$RESULT eq {4592}} |
| 1603 | |
| 1604 | ############################################################################### |
| 1605 | |
| 1606 | test_cleanup |
| 1607 |
+4
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -7,10 +7,14 @@ | ||
| 7 | 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | 8 | from the "ticketchng" table. |
| 9 | 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | 11 | support enabled. |
| 12 | + * TH1 enhancements: | |
| 13 | + <ul><li>Add <nowiki>[unversioned content]</nowiki> command.</li> | |
| 14 | + <li>Add <nowiki>[unversioned list]</nowiki> command.</li> | |
| 15 | + </ul> | |
| 12 | 16 | |
| 13 | 17 | <a name='v1_36'></a> |
| 14 | 18 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 15 | 19 | |
| 16 | 20 | * Add support for [./unvers.wiki|unversioned content], |
| 17 | 21 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -7,10 +7,14 @@ | |
| 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | from the "ticketchng" table. |
| 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | support enabled. |
| 12 | |
| 13 | <a name='v1_36'></a> |
| 14 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 15 | |
| 16 | * Add support for [./unvers.wiki|unversioned content], |
| 17 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -7,10 +7,14 @@ | |
| 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | from the "ticketchng" table. |
| 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | support enabled. |
| 12 | * TH1 enhancements: |
| 13 | <ul><li>Add <nowiki>[unversioned content]</nowiki> command.</li> |
| 14 | <li>Add <nowiki>[unversioned list]</nowiki> command.</li> |
| 15 | </ul> |
| 16 | |
| 17 | <a name='v1_36'></a> |
| 18 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 19 | |
| 20 | * Add support for [./unvers.wiki|unversioned content], |
| 21 |
+4
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -7,10 +7,14 @@ | ||
| 7 | 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | 8 | from the "ticketchng" table. |
| 9 | 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | 11 | support enabled. |
| 12 | + * TH1 enhancements: | |
| 13 | + <ul><li>Add <nowiki>[unversioned content]</nowiki> command.</li> | |
| 14 | + <li>Add <nowiki>[unversioned list]</nowiki> command.</li> | |
| 15 | + </ul> | |
| 12 | 16 | |
| 13 | 17 | <a name='v1_36'></a> |
| 14 | 18 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 15 | 19 | |
| 16 | 20 | * Add support for [./unvers.wiki|unversioned content], |
| 17 | 21 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -7,10 +7,14 @@ | |
| 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | from the "ticketchng" table. |
| 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | support enabled. |
| 12 | |
| 13 | <a name='v1_36'></a> |
| 14 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 15 | |
| 16 | * Add support for [./unvers.wiki|unversioned content], |
| 17 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -7,10 +7,14 @@ | |
| 7 | * Fix [/help?cmd=ticket|ticket set] when using the "+" prefix with fields |
| 8 | from the "ticketchng" table. |
| 9 | * Enhance the "brlist" page to make use of branch colors. |
| 10 | * Remove the "fusefs" command from builds that do not have the underlying |
| 11 | support enabled. |
| 12 | * TH1 enhancements: |
| 13 | <ul><li>Add <nowiki>[unversioned content]</nowiki> command.</li> |
| 14 | <li>Add <nowiki>[unversioned list]</nowiki> command.</li> |
| 15 | </ul> |
| 16 | |
| 17 | <a name='v1_36'></a> |
| 18 | <h2>Changes for Version 1.36 (2016-10-24)</h2> |
| 19 | |
| 20 | * Add support for [./unvers.wiki|unversioned content], |
| 21 |
+19
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -174,10 +174,12 @@ | ||
| 174 | 174 | * tclInvoke |
| 175 | 175 | * tclIsSafe |
| 176 | 176 | * tclMakeSafe |
| 177 | 177 | * tclReady |
| 178 | 178 | * trace |
| 179 | + * unversioned content | |
| 180 | + * unversioned list | |
| 179 | 181 | * utime |
| 180 | 182 | * verifyCsrf |
| 181 | 183 | * wiki |
| 182 | 184 | |
| 183 | 185 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | ||
| 610 | 612 | ------------------------------------- |
| 611 | 613 | |
| 612 | 614 | * trace STRING |
| 613 | 615 | |
| 614 | 616 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 617 | + | |
| 618 | +<a name="unversioned_content"></a>TH1 unversioned content Command | |
| 619 | +----------------------------------------------------------------- | |
| 620 | + | |
| 621 | + * unversioned content FILENAME | |
| 622 | + | |
| 623 | +Attempts to locate the specified unversioned file and return its contents. | |
| 624 | +An error is generated if the repository is not open or the unversioned file | |
| 625 | +cannot be found. | |
| 626 | + | |
| 627 | +<a name="unversioned_list"></a>TH1 unversioned list Command | |
| 628 | +----------------------------------------------------------- | |
| 629 | + | |
| 630 | + * unversioned list | |
| 631 | + | |
| 632 | +Returns a list of the names of all unversioned files held in the local | |
| 633 | +repository. An error is generated if the repository is not open. | |
| 615 | 634 | |
| 616 | 635 | <a name="utime"></a>TH1 utime Command |
| 617 | 636 | ------------------------------------- |
| 618 | 637 | |
| 619 | 638 | * utime |
| 620 | 639 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -174,10 +174,12 @@ | |
| 174 | * tclInvoke |
| 175 | * tclIsSafe |
| 176 | * tclMakeSafe |
| 177 | * tclReady |
| 178 | * trace |
| 179 | * utime |
| 180 | * verifyCsrf |
| 181 | * wiki |
| 182 | |
| 183 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | |
| 610 | ------------------------------------- |
| 611 | |
| 612 | * trace STRING |
| 613 | |
| 614 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 615 | |
| 616 | <a name="utime"></a>TH1 utime Command |
| 617 | ------------------------------------- |
| 618 | |
| 619 | * utime |
| 620 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -174,10 +174,12 @@ | |
| 174 | * tclInvoke |
| 175 | * tclIsSafe |
| 176 | * tclMakeSafe |
| 177 | * tclReady |
| 178 | * trace |
| 179 | * unversioned content |
| 180 | * unversioned list |
| 181 | * utime |
| 182 | * verifyCsrf |
| 183 | * wiki |
| 184 | |
| 185 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | |
| 612 | ------------------------------------- |
| 613 | |
| 614 | * trace STRING |
| 615 | |
| 616 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 617 | |
| 618 | <a name="unversioned_content"></a>TH1 unversioned content Command |
| 619 | ----------------------------------------------------------------- |
| 620 | |
| 621 | * unversioned content FILENAME |
| 622 | |
| 623 | Attempts to locate the specified unversioned file and return its contents. |
| 624 | An error is generated if the repository is not open or the unversioned file |
| 625 | cannot be found. |
| 626 | |
| 627 | <a name="unversioned_list"></a>TH1 unversioned list Command |
| 628 | ----------------------------------------------------------- |
| 629 | |
| 630 | * unversioned list |
| 631 | |
| 632 | Returns a list of the names of all unversioned files held in the local |
| 633 | repository. An error is generated if the repository is not open. |
| 634 | |
| 635 | <a name="utime"></a>TH1 utime Command |
| 636 | ------------------------------------- |
| 637 | |
| 638 | * utime |
| 639 |
+19
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -174,10 +174,12 @@ | ||
| 174 | 174 | * tclInvoke |
| 175 | 175 | * tclIsSafe |
| 176 | 176 | * tclMakeSafe |
| 177 | 177 | * tclReady |
| 178 | 178 | * trace |
| 179 | + * unversioned content | |
| 180 | + * unversioned list | |
| 179 | 181 | * utime |
| 180 | 182 | * verifyCsrf |
| 181 | 183 | * wiki |
| 182 | 184 | |
| 183 | 185 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | ||
| 610 | 612 | ------------------------------------- |
| 611 | 613 | |
| 612 | 614 | * trace STRING |
| 613 | 615 | |
| 614 | 616 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 617 | + | |
| 618 | +<a name="unversioned_content"></a>TH1 unversioned content Command | |
| 619 | +----------------------------------------------------------------- | |
| 620 | + | |
| 621 | + * unversioned content FILENAME | |
| 622 | + | |
| 623 | +Attempts to locate the specified unversioned file and return its contents. | |
| 624 | +An error is generated if the repository is not open or the unversioned file | |
| 625 | +cannot be found. | |
| 626 | + | |
| 627 | +<a name="unversioned_list"></a>TH1 unversioned list Command | |
| 628 | +----------------------------------------------------------- | |
| 629 | + | |
| 630 | + * unversioned list | |
| 631 | + | |
| 632 | +Returns a list of the names of all unversioned files held in the local | |
| 633 | +repository. An error is generated if the repository is not open. | |
| 615 | 634 | |
| 616 | 635 | <a name="utime"></a>TH1 utime Command |
| 617 | 636 | ------------------------------------- |
| 618 | 637 | |
| 619 | 638 | * utime |
| 620 | 639 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -174,10 +174,12 @@ | |
| 174 | * tclInvoke |
| 175 | * tclIsSafe |
| 176 | * tclMakeSafe |
| 177 | * tclReady |
| 178 | * trace |
| 179 | * utime |
| 180 | * verifyCsrf |
| 181 | * wiki |
| 182 | |
| 183 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | |
| 610 | ------------------------------------- |
| 611 | |
| 612 | * trace STRING |
| 613 | |
| 614 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 615 | |
| 616 | <a name="utime"></a>TH1 utime Command |
| 617 | ------------------------------------- |
| 618 | |
| 619 | * utime |
| 620 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -174,10 +174,12 @@ | |
| 174 | * tclInvoke |
| 175 | * tclIsSafe |
| 176 | * tclMakeSafe |
| 177 | * tclReady |
| 178 | * trace |
| 179 | * unversioned content |
| 180 | * unversioned list |
| 181 | * utime |
| 182 | * verifyCsrf |
| 183 | * wiki |
| 184 | |
| 185 | Each of the commands above is documented by a block comment above their |
| @@ -610,10 +612,27 @@ | |
| 612 | ------------------------------------- |
| 613 | |
| 614 | * trace STRING |
| 615 | |
| 616 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 617 | |
| 618 | <a name="unversioned_content"></a>TH1 unversioned content Command |
| 619 | ----------------------------------------------------------------- |
| 620 | |
| 621 | * unversioned content FILENAME |
| 622 | |
| 623 | Attempts to locate the specified unversioned file and return its contents. |
| 624 | An error is generated if the repository is not open or the unversioned file |
| 625 | cannot be found. |
| 626 | |
| 627 | <a name="unversioned_list"></a>TH1 unversioned list Command |
| 628 | ----------------------------------------------------------- |
| 629 | |
| 630 | * unversioned list |
| 631 | |
| 632 | Returns a list of the names of all unversioned files held in the local |
| 633 | repository. An error is generated if the repository is not open. |
| 634 | |
| 635 | <a name="utime"></a>TH1 utime Command |
| 636 | ------------------------------------- |
| 637 | |
| 638 | * utime |
| 639 |