Andy Bradford wrote:
>
> If   I    configure   the   FOSSIL_ENABLE_TH1_HOOKS    (e.g.   configure
> --with-th1-hooks) what does that get me?  I assume from the code that it
> will call Th_CommandHook  passing in the name and flags,  but to what in
> the TH1  environment? My guess  is that I need  a function by  a certain
> name, but what? Is there any documentation on using TH1 hooks? 
> 

First, you would need to enable the "th1-hooks" setting.

Then, you would normally need a "th1-setup" script, set via the "settings"
command or a ".fossil-settings" file.  There would need to be a procedure
defined named "command_hook" (and/or "command_notify"), e.g.:

        proc command_hook {} {
          if {$::cmd_name eq "timeline"} {
            puts $::cmd_args\n
            puts "preparing the timeline... [tclEval {info patchlevel}]\n\n"
          }
        }

        proc command_notify {} {
          if {$::cmd_name eq "timeline"} {
            puts $::cmd_args\n
            puts "timeline completed. [tclEval {info patchlevel}]\n\n"
          }
        }

The hook procedure is evaluated prior to the actual command and the notify
procedure is evaluated after the command.  In the above example, which was
used for testing, I also made use of the native Tcl integration feature.

--
Joe Mistachkin

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to