Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch th1ReInit Excluding Merge-Ins
This is equivalent to a diff from 3fc62dde2c to f3a7da44df
2014-09-09
| ||
19:45 | Add 'reinitialize' command to TH1. Add 'flags' to the globalState TH1 command. ... (check-in: 3355835fdc user: mistachkin tags: trunk) | |
19:43 | More proposed fixes to the issues pointed out by Edward Berner. ... (check-in: 7807ec4e13 user: mistachkin tags: trunk) | |
12:43 | Fix incremental builds using mingw on Windows ... (Closed-Leaf check-in: e1fa9e8889 user: baruch tags: better-mingw) | |
07:44 | Make server on Windows aware of current checkout if run interavtivly from open checkout. Allows using special names prev/next/current in ui ... (Closed-Leaf check-in: aead49f36a user: baruch tags: baruch-winserver) | |
07:00 | Merge in the TH1 reinitialize command, from its branch, for testing purposes. ... (check-in: 76ea9ee63d user: mistachkin tags: dynamicTh1Docs) | |
06:54 | Allow shunning/unshunning multiple files at a time ... (check-in: 9f6b1964fb user: baruch tags: baruch-multishun) | |
2014-09-08
| ||
16:46 | Add 'reinitialize' command to TH1. Add 'flags' to the globalState TH1 command. ... (Closed-Leaf check-in: f3a7da44df user: mistachkin tags: th1ReInit) | |
08:08 | Highly experimental changes to enable TH1 usage in embedded docs. Do not merge. ... (check-in: 5ce57f21bd user: mistachkin tags: dynamicTh1Docs) | |
2014-09-07
| ||
19:50 | More proposed fixes to the issues pointed out by Edward Berner. ... (check-in: 4429a4c3cc user: mistachkin tags: warningFixes) | |
09:49 | removed a duplicated if() block, moved a free()-after-return, both reported by Edward Berner. ... (check-in: 3fc62dde2c user: stephan tags: trunk) | |
08:52 | When using $EDITOR to enter a commit message, tags provided via the --tag flag are now listed, per ML request. ... (check-in: ae00c63109 user: stephan tags: trunk) | |
Changes to src/th_main.c.
︙ | ︙ | |||
29 30 31 32 33 34 35 | */ #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ | > > > > | > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | */ #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ /* ** Useful and/or "well-known" combinations of flag values. */ #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) #define TH_INIT_FORBID_MASK (TH_INIT_FORCE_TCL) /* Illegal from a script. */ #endif /* ** Flags set by functions in this file to keep track of integration state ** information. These flags should not be used outside of this file. */ #define TH_STATE_CONFIG ((u32)0x00000010) /* We opened the config. */ |
︙ | ︙ | |||
680 681 682 683 684 685 686 687 688 689 690 691 692 693 | ** variable -OR- the specified default value. Currently, the supported ** items are: ** ** "checkout" = The active local checkout directory, if any. ** "configuration" = The active configuration database file name, ** if any. ** "executable" = The fully qualified executable file name. ** "log" = The error log file name, if any. ** "repository" = The active local repository file name, if ** any. ** "top" = The base path for the active server instance, ** if applicable. ** "user" = The active user name, if any. ** "vfs" = The SQLite VFS in use, if overridden. | > | 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | ** variable -OR- the specified default value. Currently, the supported ** items are: ** ** "checkout" = The active local checkout directory, if any. ** "configuration" = The active configuration database file name, ** if any. ** "executable" = The fully qualified executable file name. ** "flags" = The TH1 initialization flags. ** "log" = The error log file name, if any. ** "repository" = The active local repository file name, if ** any. ** "top" = The base path for the active server instance, ** if applicable. ** "user" = The active user name, if any. ** "vfs" = The SQLite VFS in use, if overridden. |
︙ | ︙ | |||
716 717 718 719 720 721 722 723 724 725 726 727 728 729 | Th_SetResult(interp, g.zLocalRoot ? g.zLocalRoot : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "configuration\0", 14)==0 ){ Th_SetResult(interp, g.zConfigDbName ? g.zConfigDbName : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "executable\0", 11)==0 ){ Th_SetResult(interp, g.nameOfExe ? g.nameOfExe : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "log\0", 4)==0 ){ Th_SetResult(interp, g.zErrlog ? g.zErrlog : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "repository\0", 11)==0 ){ Th_SetResult(interp, g.zRepositoryName ? g.zRepositoryName : zDefault, -1); return TH_OK; | > > > | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | Th_SetResult(interp, g.zLocalRoot ? g.zLocalRoot : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "configuration\0", 14)==0 ){ Th_SetResult(interp, g.zConfigDbName ? g.zConfigDbName : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "executable\0", 11)==0 ){ Th_SetResult(interp, g.nameOfExe ? g.nameOfExe : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "flags\0", 6)==0 ){ Th_SetResultInt(interp, g.th1Flags); return TH_OK; }else if( fossil_strnicmp(argv[1], "log\0", 4)==0 ){ Th_SetResult(interp, g.zErrlog ? g.zErrlog : zDefault, -1); return TH_OK; }else if( fossil_strnicmp(argv[1], "repository\0", 11)==0 ){ Th_SetResult(interp, g.zRepositoryName ? g.zRepositoryName : zDefault, -1); return TH_OK; |
︙ | ︙ | |||
780 781 782 783 784 785 786 787 788 789 790 791 792 793 | ){ if( argc!=3 ){ return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); } cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); return TH_OK; } /* ** TH1 command: render STRING ** ** Renders the template and writes the results. */ static int renderCmd( | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 | ){ if( argc!=3 ){ return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); } cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); return TH_OK; } /* ** TH1 command: reinitialize ?FLAGS? ** ** Reinitializes the TH1 interpreter using the specified flags. */ static int reinitializeCmd( Th_Interp *interp, void *p, int argc, const char **argv, int *argl ){ u32 flags = TH_INIT_DEFAULT; if( argc!=1 && argc!=2 ){ return Th_WrongNumArgs(interp, "reinitialize ?FLAGS?"); } if( argc==2 ){ int iFlags; if( Th_ToInt(interp, argv[1], argl[1], &iFlags) ){ return TH_ERROR; }else{ flags = (u32)iFlags; } } Th_FossilInit(flags & ~TH_INIT_FORBID_MASK); Th_SetResult(interp, 0, 0); return TH_OK; } /* ** TH1 command: render STRING ** ** Renders the template and writes the results. */ static int renderCmd( |
︙ | ︙ | |||
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 | {"htmlize", htmlizeCmd, 0}, {"http", httpCmd, 0}, {"linecount", linecntCmd, 0}, {"puts", putsCmd, (void*)&aFlags[1]}, {"query", queryCmd, 0}, {"randhex", randhexCmd, 0}, {"regexp", regexpCmd, 0}, {"render", renderCmd, 0}, {"repository", repositoryCmd, 0}, {"setParameter", setParameterCmd, 0}, {"setting", settingCmd, 0}, {"styleHeader", styleHeaderCmd, 0}, {"styleFooter", styleFooterCmd, 0}, {"tclReady", tclReadyCmd, 0}, {"trace", traceCmd, 0}, {"stime", stimeCmd, 0}, {"utime", utimeCmd, 0}, {"wiki", wikiCmd, (void*)&aFlags[0]}, {0, 0, 0} }; if( needConfig ){ /* ** This function uses several settings which may be defined in the ** repository and/or the global configuration. Since the caller ** passed a non-zero value for the needConfig parameter, make sure ** the necessary database connections are open prior to continuing. */ | > > > > | 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 | {"htmlize", htmlizeCmd, 0}, {"http", httpCmd, 0}, {"linecount", linecntCmd, 0}, {"puts", putsCmd, (void*)&aFlags[1]}, {"query", queryCmd, 0}, {"randhex", randhexCmd, 0}, {"regexp", regexpCmd, 0}, {"reinitialize", reinitializeCmd, 0}, {"render", renderCmd, 0}, {"repository", repositoryCmd, 0}, {"setParameter", setParameterCmd, 0}, {"setting", settingCmd, 0}, {"styleHeader", styleHeaderCmd, 0}, {"styleFooter", styleFooterCmd, 0}, {"tclReady", tclReadyCmd, 0}, {"trace", traceCmd, 0}, {"stime", stimeCmd, 0}, {"utime", utimeCmd, 0}, {"wiki", wikiCmd, (void*)&aFlags[0]}, {0, 0, 0} }; if( g.thTrace ){ Th_Trace("th1-init 0x%x => 0x%x<br />\n", g.th1Flags, flags); } if( needConfig ){ /* ** This function uses several settings which may be defined in the ** repository and/or the global configuration. Since the caller ** passed a non-zero value for the needConfig parameter, make sure ** the necessary database connections are open prior to continuing. */ |
︙ | ︙ |
Changes to test/th1.test.
︙ | ︙ | |||
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | ############################################################################### fossil test-th-eval --th-trace "trace {}" if {$th1Hooks} { test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ ------------------- END TRACE LOG -------------------}} } else { test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-setup {} => TH_OK<br /> ------------------- END TRACE LOG -------------------}} } ############################################################################### fossil test-th-eval "trace {this is a trace message.}" test th1-trace-3 {$RESULT eq {}} ############################################################################### fossil test-th-eval --th-trace "trace {this is a trace message.}" if {$th1Hooks} { test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ this is a trace message. ------------------- END TRACE LOG -------------------}} } else { test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-setup {} => TH_OK<br /> this is a trace message. ------------------- END TRACE LOG -------------------}} } ############################################################################### | > > > > | 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | ############################################################################### fossil test-th-eval --th-trace "trace {}" if {$th1Hooks} { test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-init 0x0 => 0x0<br /> ------------------- END TRACE LOG -------------------}} } else { test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-init 0x0 => 0x0<br /> th1-setup {} => TH_OK<br /> ------------------- END TRACE LOG -------------------}} } ############################################################################### fossil test-th-eval "trace {this is a trace message.}" test th1-trace-3 {$RESULT eq {}} ############################################################################### fossil test-th-eval --th-trace "trace {this is a trace message.}" if {$th1Hooks} { test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-init 0x0 => 0x0<br /> this is a trace message. ------------------- END TRACE LOG -------------------}} } else { test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ {------------------ BEGIN TRACE LOG ------------------ th1-init 0x0 => 0x0<br /> th1-setup {} => TH_OK<br /> this is a trace message. ------------------- END TRACE LOG -------------------}} } ############################################################################### |
︙ | ︙ | |||
787 788 789 790 791 792 793 | set altVfs unix-dotfile } ############################################################################### fossil test-th-eval --vfs $altVfs "globalState vfs" test th1-globalState-15 {$RESULT eq $altVfs} | > > > > > > > > > > > > > > > | 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | set altVfs unix-dotfile } ############################################################################### fossil test-th-eval --vfs $altVfs "globalState vfs" test th1-globalState-15 {$RESULT eq $altVfs} ############################################################################### fossil test-th-eval "globalState flags" test th1-globalState-16 {$RESULT eq "0"} ############################################################################### fossil test-th-eval "reinitialize; globalState configuration" test th1-reinitialize-1 {$RESULT eq ""} ############################################################################### fossil test-th-eval "reinitialize 1; globalState configuration" test th1-reinitialize-2 {$RESULT ne ""} |