comparison en/ch09-hook.xml @ 828:477d6a3e5023

Many final changes.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 04 May 2009 23:52:38 -0700
parents 88828b784971
children
comparison
equal deleted inserted replaced
827:d2aacc06e562 828:477d6a3e5023
18 <title>An overview of hooks in Mercurial</title> 18 <title>An overview of hooks in Mercurial</title>
19 19
20 <para id="x_1e8">Here is a brief list of the hooks that Mercurial 20 <para id="x_1e8">Here is a brief list of the hooks that Mercurial
21 supports. We will revisit each of these hooks in more detail 21 supports. We will revisit each of these hooks in more detail
22 later, in <xref linkend="sec:hook:ref"/>.</para> 22 later, in <xref linkend="sec:hook:ref"/>.</para>
23
24 <para id="x_1f6">Each of the hooks whose description begins with the word
25 <quote>Controlling</quote> has the ability to determine whether
26 an activity can proceed. If the hook succeeds, the activity may
27 proceed; if it fails, the activity is either not permitted or
28 undone, depending on the hook.</para>
23 29
24 <itemizedlist> 30 <itemizedlist>
25 <listitem><para id="x_1e9"><literal role="hook">changegroup</literal>: This 31 <listitem><para id="x_1e9"><literal role="hook">changegroup</literal>: This
26 is run after a group of changesets has been brought into the 32 is run after a group of changesets has been brought into the
27 repository from elsewhere.</para> 33 repository from elsewhere.</para>
85 <listitem><para id="x_1f5"><literal role="hook">update</literal>: This is 91 <listitem><para id="x_1f5"><literal role="hook">update</literal>: This is
86 run after an update or merge of the working directory has 92 run after an update or merge of the working directory has
87 finished. 93 finished.
88 </para> 94 </para>
89 </listitem></itemizedlist> 95 </listitem></itemizedlist>
90 <para id="x_1f6">Each of the hooks whose description begins with the word
91 <quote>Controlling</quote> has the ability to determine whether
92 an activity can proceed. If the hook succeeds, the activity may
93 proceed; if it fails, the activity is either not permitted or
94 undone, depending on the hook.
95 </para>
96 96
97 </sect1> 97 </sect1>
98 <sect1> 98 <sect1>
99 <title>Hooks and security</title> 99 <title>Hooks and security</title>
100 100
137 hook will run under whatever account is executing the server 137 hook will run under whatever account is executing the server
138 process, on the server. 138 process, on the server.
139 </para> 139 </para>
140 </note> 140 </note>
141 141
142 <para id="x_1fb">XXX To see what hooks are defined in a repository, use the 142 <para id="x_1fb">To see what hooks are defined in a repository,
143 <command role="hg-cmd">hg config hooks</command> command. If 143 use the <command role="hg-cmd">hg showconfig hooks</command>
144 you are working in one repository, but talking to another that 144 command. If you are working in one repository, but talking to
145 you do not own (e.g. using <command role="hg-cmd">hg 145 another that you do not own (e.g. using <command
146 pull</command> or <command role="hg-cmd">hg 146 role="hg-cmd">hg pull</command> or <command role="hg-cmd">hg
147 incoming</command>), remember that it is the other 147 incoming</command>), remember that it is the other
148 repository's hooks you should be checking, not your own. 148 repository's hooks you should be checking, not your own.
149 </para> 149 </para>
150 </sect2> 150 </sect2>
151 151
583 the saved commit message once you've corrected the problem. 583 the saved commit message once you've corrected the problem.
584 </para> 584 </para>
585 585
586 &interaction.ch09-hook.ws.better; 586 &interaction.ch09-hook.ws.better;
587 587
588 <para id="x_237">As a final aside, note in the example above the use of 588 <para id="x_237">As a final aside, note in the example above the
589 <command>perl</command>'s in-place editing feature to get rid 589 use of <command>sed</command>'s in-place editing feature to
590 of trailing whitespace from a file. This is concise and 590 get rid of trailing whitespace from a file. This is concise
591 useful enough that I will reproduce it here. 591 and useful enough that I will reproduce it here (using
592 </para> 592 <command>perl</command> for good measure).</para>
593 <programlisting>perl -pi -e 's,\s+$,,' filename</programlisting> 593 <programlisting>perl -pi -e 's,\s+$,,' filename</programlisting>
594 594
595 </sect2> 595 </sect2>
596 </sect1> 596 </sect1>
597 <sect1> 597 <sect1>
815 <itemizedlist> 815 <itemizedlist>
816 <listitem><para id="x_252"><envar 816 <listitem><para id="x_252"><envar
817 role="rc-item-bugzilla">version</envar>: The version 817 role="rc-item-bugzilla">version</envar>: The version
818 of Bugzilla installed on the server. The database 818 of Bugzilla installed on the server. The database
819 schema that Bugzilla uses changes occasionally, so this 819 schema that Bugzilla uses changes occasionally, so this
820 hook has to know exactly which schema to use. At the 820 hook has to know exactly which schema to use.</para>
821 moment, the only version supported is
822 <literal>2.16</literal>.
823 </para>
824 </listitem> 821 </listitem>
825 <listitem><para id="x_253"><envar role="rc-item-bugzilla">host</envar>: 822 <listitem><para id="x_253"><envar role="rc-item-bugzilla">host</envar>:
826 The hostname of the MySQL server that stores your 823 The hostname of the MySQL server that stores your
827 Bugzilla data. The database must be configured to allow 824 Bugzilla data. The database must be configured to allow
828 connections from whatever host you are running the 825 connections from whatever host you are running the