Fossil SCM
Updates to the 'th1-docs' tests. Also, enhance output of the --th-trace option.
Commit
fee9ede22ab0273874e408aeec3e875308b62f15819c841b46d5a6f69ea6f430
Parent
17e1217a5e47eec…
2 files changed
+16
-1
+1
-1
+16
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1772,11 +1772,20 @@ | ||
| 1772 | 1772 | int szCol = th_strlen(zCol); |
| 1773 | 1773 | const char *zVal = (const char*)sqlite3_column_text(pStmt, i); |
| 1774 | 1774 | int szVal = sqlite3_column_bytes(pStmt, i); |
| 1775 | 1775 | Th_SetVar(interp, zCol, szCol, zVal, szVal); |
| 1776 | 1776 | } |
| 1777 | + if( g.thTrace ){ | |
| 1778 | + Th_Trace("query_eval {<pre>%#h</pre>}<br />\n", argl[2], argv[2]); | |
| 1779 | + } | |
| 1777 | 1780 | res = Th_Eval(interp, 0, argv[2], argl[2]); |
| 1781 | + if( g.thTrace ){ | |
| 1782 | + int nTrRes; | |
| 1783 | + char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes); | |
| 1784 | + Th_Trace("[query_eval] => %h {%#h}<br />\n", | |
| 1785 | + Th_ReturnCodeName(res, 0), nTrRes, zTrRes); | |
| 1786 | + } | |
| 1778 | 1787 | if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK; |
| 1779 | 1788 | } |
| 1780 | 1789 | rc = sqlite3_finalize(pStmt); |
| 1781 | 1790 | if( rc!=SQLITE_OK ){ |
| 1782 | 1791 | if( noComplain ) return TH_OK; |
| @@ -2624,13 +2633,19 @@ | ||
| 2624 | 2633 | }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){ |
| 2625 | 2634 | sendText(z, i, 0); |
| 2626 | 2635 | z += i+5; |
| 2627 | 2636 | for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){} |
| 2628 | 2637 | if( g.thTrace ){ |
| 2629 | - Th_Trace("eval {<pre>%#h</pre>}<br />", i, z); | |
| 2638 | + Th_Trace("render_eval {<pre>%#h</pre>}<br />\n", i, z); | |
| 2630 | 2639 | } |
| 2631 | 2640 | rc = Th_Eval(g.interp, 0, (const char*)z, i); |
| 2641 | + if( g.thTrace ){ | |
| 2642 | + int nTrRes; | |
| 2643 | + char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes); | |
| 2644 | + Th_Trace("[render_eval] => %h {%#h}<br />\n", | |
| 2645 | + Th_ReturnCodeName(rc, 0), nTrRes, zTrRes); | |
| 2646 | + } | |
| 2632 | 2647 | if( rc!=TH_OK ) break; |
| 2633 | 2648 | z += i; |
| 2634 | 2649 | if( z[0] ){ z += 6; } |
| 2635 | 2650 | i = 0; |
| 2636 | 2651 | }else{ |
| 2637 | 2652 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1772,11 +1772,20 @@ | |
| 1772 | int szCol = th_strlen(zCol); |
| 1773 | const char *zVal = (const char*)sqlite3_column_text(pStmt, i); |
| 1774 | int szVal = sqlite3_column_bytes(pStmt, i); |
| 1775 | Th_SetVar(interp, zCol, szCol, zVal, szVal); |
| 1776 | } |
| 1777 | res = Th_Eval(interp, 0, argv[2], argl[2]); |
| 1778 | if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK; |
| 1779 | } |
| 1780 | rc = sqlite3_finalize(pStmt); |
| 1781 | if( rc!=SQLITE_OK ){ |
| 1782 | if( noComplain ) return TH_OK; |
| @@ -2624,13 +2633,19 @@ | |
| 2624 | }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){ |
| 2625 | sendText(z, i, 0); |
| 2626 | z += i+5; |
| 2627 | for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){} |
| 2628 | if( g.thTrace ){ |
| 2629 | Th_Trace("eval {<pre>%#h</pre>}<br />", i, z); |
| 2630 | } |
| 2631 | rc = Th_Eval(g.interp, 0, (const char*)z, i); |
| 2632 | if( rc!=TH_OK ) break; |
| 2633 | z += i; |
| 2634 | if( z[0] ){ z += 6; } |
| 2635 | i = 0; |
| 2636 | }else{ |
| 2637 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1772,11 +1772,20 @@ | |
| 1772 | int szCol = th_strlen(zCol); |
| 1773 | const char *zVal = (const char*)sqlite3_column_text(pStmt, i); |
| 1774 | int szVal = sqlite3_column_bytes(pStmt, i); |
| 1775 | Th_SetVar(interp, zCol, szCol, zVal, szVal); |
| 1776 | } |
| 1777 | if( g.thTrace ){ |
| 1778 | Th_Trace("query_eval {<pre>%#h</pre>}<br />\n", argl[2], argv[2]); |
| 1779 | } |
| 1780 | res = Th_Eval(interp, 0, argv[2], argl[2]); |
| 1781 | if( g.thTrace ){ |
| 1782 | int nTrRes; |
| 1783 | char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes); |
| 1784 | Th_Trace("[query_eval] => %h {%#h}<br />\n", |
| 1785 | Th_ReturnCodeName(res, 0), nTrRes, zTrRes); |
| 1786 | } |
| 1787 | if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK; |
| 1788 | } |
| 1789 | rc = sqlite3_finalize(pStmt); |
| 1790 | if( rc!=SQLITE_OK ){ |
| 1791 | if( noComplain ) return TH_OK; |
| @@ -2624,13 +2633,19 @@ | |
| 2633 | }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){ |
| 2634 | sendText(z, i, 0); |
| 2635 | z += i+5; |
| 2636 | for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){} |
| 2637 | if( g.thTrace ){ |
| 2638 | Th_Trace("render_eval {<pre>%#h</pre>}<br />\n", i, z); |
| 2639 | } |
| 2640 | rc = Th_Eval(g.interp, 0, (const char*)z, i); |
| 2641 | if( g.thTrace ){ |
| 2642 | int nTrRes; |
| 2643 | char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes); |
| 2644 | Th_Trace("[render_eval] => %h {%#h}<br />\n", |
| 2645 | Th_ReturnCodeName(rc, 0), nTrRes, zTrRes); |
| 2646 | } |
| 2647 | if( rc!=TH_OK ) break; |
| 2648 | z += i; |
| 2649 | if( z[0] ){ z += 6; } |
| 2650 | i = 0; |
| 2651 | }else{ |
| 2652 |
+1
-1
| --- test/fileStat.th1 | ||
| +++ test/fileStat.th1 | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | tclEval { |
| 61 | 61 | # |
| 62 | 62 | # NOTE: Get the unique Id of the latest check-in on trunk. |
| 63 | 63 | # |
| 64 | 64 | return [lindex [regexp -line -inline -nocase -- \ |
| 65 | - {^uuid:\s+([0-9A-F]{40}) } [eval [getFossilCommand \ | |
| 65 | + {^(?:uuid|hash):\s+([0-9A-F]{40}) } [eval [getFossilCommand \ | |
| 66 | 66 | $repository "" info trunk]]] end] |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | proc theSumOfAllFiles { id } { |
| 72 | 72 |
| --- test/fileStat.th1 | |
| +++ test/fileStat.th1 | |
| @@ -60,11 +60,11 @@ | |
| 60 | tclEval { |
| 61 | # |
| 62 | # NOTE: Get the unique Id of the latest check-in on trunk. |
| 63 | # |
| 64 | return [lindex [regexp -line -inline -nocase -- \ |
| 65 | {^uuid:\s+([0-9A-F]{40}) } [eval [getFossilCommand \ |
| 66 | $repository "" info trunk]]] end] |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | |
| 71 | proc theSumOfAllFiles { id } { |
| 72 |
| --- test/fileStat.th1 | |
| +++ test/fileStat.th1 | |
| @@ -60,11 +60,11 @@ | |
| 60 | tclEval { |
| 61 | # |
| 62 | # NOTE: Get the unique Id of the latest check-in on trunk. |
| 63 | # |
| 64 | return [lindex [regexp -line -inline -nocase -- \ |
| 65 | {^(?:uuid|hash):\s+([0-9A-F]{40}) } [eval [getFossilCommand \ |
| 66 | $repository "" info trunk]]] end] |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | |
| 71 | proc theSumOfAllFiles { id } { |
| 72 |