comparison ja/hook.tex @ 779:69923723e7f9

more hook.tex
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 27 Apr 2009 17:31:54 +0900
parents 93df8137f563
children 2a93b1d35990
comparison
equal deleted inserted replaced
778:64858a216741 779:69923723e7f9
674 %external, or return boolean ``false'' if in-process. Failure is 674 %external, or return boolean ``false'' if in-process. Failure is
675 %indicated with a non-zero exit status from an external hook, or an 675 %indicated with a non-zero exit status from an external hook, or an
676 %in-process hook returning boolean ``true''. If an in-process hook 676 %in-process hook returning boolean ``true''. If an in-process hook
677 %raises an exception, the hook is considered to have failed. 677 %raises an exception, the hook is considered to have failed.
678 678
679 $B@5$7$/F0:n$7$?30It%U%C%/$O%9%F!<%?%9$H$7$F%<%m$r!$%W%m%;%9Fb%U%C%/$N>l9g(B
680 $B$O%V!<%kCM(B``false''$B$rJV$5$J$1$l$P$J$i$J$$!%$J$s$i$+$N<:GT$,$"$C$?>l9g$O!$(B
681 $B30It%U%C%/$OHs%<%m$N=*N;%9%F!<%?%9$r!$%W%m%;%9Fb%U%C%/$O%V!<%kCM(B``true''
682 $B$rJV$9!%$b$7%W%m%;%9Fb%U%C%/$,Nc30$rH/@8$7$?>l9g$O!$%U%C%/$O<:GT$7$?$H8+(B
683 $B$J$5$l$k!%(B
684
679 %For a hook that controls whether an activity can proceed, zero/false 685 %For a hook that controls whether an activity can proceed, zero/false
680 %means ``allow'', while non-zero/true/exception means ``deny''. 686 %means ``allow'', while non-zero/true/exception means ``deny''.
687
688 $BF0:n$N7QB3$r@)8f$9$k%U%C%/$N>l9g$O!$%<%m!?(Bfalse$B$O7QB3$N5v2D$r!$Hs%<(B
689 $B%m!?(Btrue$B!?Nc30$N>l9g$O6X;_$r0UL#$9$k!%(B
681 690
682 %\subsection{Writing an external hook} 691 %\subsection{Writing an external hook}
683 \subsection{$B30It%U%C%/$r:n@.$9$k(B} 692 \subsection{$B30It%U%C%/$r:n@.$9$k(B}
684 693
685 %When you define an external hook in your \hgrc\ and the hook is run, 694 %When you define an external hook in your \hgrc\ and the hook is run,
1356 \end{codesample2} 1365 \end{codesample2}
1357 1366
1358 %\subsubsection{Configuring the text that gets added to a bug} 1367 %\subsubsection{Configuring the text that gets added to a bug}
1359 \subsubsection{$B%P%0$KDI2C$5$l$?J8;zNs$r@_Dj$9$k(B} 1368 \subsubsection{$B%P%0$KDI2C$5$l$?J8;zNs$r@_Dj$9$k(B}
1360 1369
1361 You can configure the text that this hook adds as a comment; you 1370 %You can configure the text that this hook adds as a comment; you
1362 specify it in the form of a Mercurial template. Several \hgrc\ 1371 %specify it in the form of a Mercurial template. Several \hgrc\
1363 entries (still in the \rcsection{bugzilla} section) control this 1372 %entries (still in the \rcsection{bugzilla} section) control this
1364 behaviour. 1373 %behaviour.
1374 $B%U%C%/$,DI2C$9$k%3%a%s%HJ8;zNs$O(BMercurial$B%F%s%W%l!<%H$H$7$F;XDj$9$k$3$H$,(B
1375 $B$G$-$k!%(B\hgrc $B$N%(%s%H%j(B(\rcsection{bugzilla}$B%;%/%7%g%s$K4^$^$l$F$$$k$b$N(B
1376 $B$r4^$`(B)$B$G5sF0$r%3%s%H%m!<%k$G$-$k!%(B
1377 %\begin{itemize}
1378 %\item[\texttt{strip}] The number of leading path elements to strip
1379 % from a repository's path name to construct a partial path for a URL.
1380 % For example, if the repositories on your server live under
1381 % \dirname{/home/hg/repos}, and you have a repository whose path is
1382 % \dirname{/home/hg/repos/app/tests}, then setting \texttt{strip} to
1383 % \texttt{4} will give a partial path of \dirname{app/tests}. The
1384 % hook will make this partial path available when expanding a
1385 % template, as \texttt{webroot}.
1386 %\item[\texttt{template}] The text of the template to use. In addition
1387 % to the usual changeset-related variables, this template can use
1388 % \texttt{hgweb} (the value of the \texttt{hgweb} configuration item
1389 % above) and \texttt{webroot} (the path constructed using
1390 % \texttt{strip} above).
1391 %\end{itemize}
1365 \begin{itemize} 1392 \begin{itemize}
1366 \item[\texttt{strip}] The number of leading path elements to strip 1393 \item[\texttt{strip}] URL$B@8@.MQ$NItJ,%Q%9L>$r:n$k$?$a$K%j%]%8%H%j$N%Q%9L>(B
1367 from a repository's path name to construct a partial path for a URL. 1394 $B$+$i<h$j=|$+$l$k@h9TMWAG$N?t!%%5!<%P>e$N(B
1368 For example, if the repositories on your server live under 1395 \dirname{/home/hg/repos}$B$K%j%]%8%H%j72$,$"(B
1369 \dirname{/home/hg/repos}, and you have a repository whose path is 1396 $B$j!$(B\dirname{/home/hg/repos/app/tests}$B$H$$$&%j%]%8%H%j$r;}$C(B
1370 \dirname{/home/hg/repos/app/tests}, then setting \texttt{strip} to 1397 $B$F$$$k>l9g!$(B\texttt{strip}$B$r(B\texttt{4}$B$K$9$k$HItJ,%Q%9L>(B
1371 \texttt{4} will give a partial path of \dirname{app/tests}. The 1398 \dirname{app/tests}$B$,F@$i$l$k!%%U%C%/$O$3$NItJ,%Q%9$r%F%s%W(B
1372 hook will make this partial path available when expanding a 1399 $B%l!<%H$N(B\texttt{webroot}$B$KE,MQ$9$k!%(B
1373 template, as \texttt{webroot}. 1400
1374 \item[\texttt{template}] The text of the template to use. In addition 1401 \item[\texttt{template}] $B%F%s%W%l!<%H$K;HMQ$5$l$k%F%-%9%H!%DL>o$N%A%'%s%8(B
1375 to the usual changeset-related variables, this template can use 1402 $B%;%C%H4XO"$NJQ?t$K2C$($F!$(B\texttt{hgweb}$B!J>e5-$N(B
1376 \texttt{hgweb} (the value of the \texttt{hgweb} configuration item 1403 \texttt{hgweb}$B$N@_DjCM!K$H(B\texttt{webroot}$B!J>e5-$N(B
1377 above) and \texttt{webroot} (the path constructed using 1404 \texttt{strip}$B$r;H$C$F:n$C$?%Q%9!K$,MxMQ$G$-$k(B.
1378 \texttt{strip} above).
1379 \end{itemize} 1405 \end{itemize}
1380 1406
1381 In addition, you can add a \rcitem{web}{baseurl} item to the 1407 %In addition, you can add a \rcitem{web}{baseurl} item to the
1382 \rcsection{web} section of your \hgrc. The \hgext{bugzilla} hook will 1408 %\rcsection{web} section of your \hgrc. The \hgext{bugzilla} hook will
1383 make this available when expanding a template, as the base string to 1409 %make this available when expanding a template, as the base string to
1384 use when constructing a URL that will let users browse from a Bugzilla 1410 %use when constructing a URL that will let users browse from a Bugzilla
1385 comment to view a changeset. Example: 1411 %comment to view a changeset. Example:
1412 $B$5$i$K!$(B\rcitem{web}{baseurl}$B9`L\$r(B\hgrc $B$N(B\rcsection{web}$B%;%/%7%g%s$KDI(B
1413 $B2C$G$-$k!%$3$l$O%F%s%W%l!<%H$N3HD%;~$K(B\hgext{bugzilla}$B%U%C%/$K$h$j(B
1414 Bugzilla$B%3%a%s%H$+$i%A%'%s%8%;%C%H$r;2>H$9$k:]$N(BURL$B@8@.$N%Y!<%9J8;zNs$H$7(B
1415 $B$FMxMQ$5$l$k!%(B
1416
1386 \begin{codesample2} 1417 \begin{codesample2}
1387 [web] 1418 [web]
1388 baseurl = http://hg.domain.com/ 1419 baseurl = http://hg.domain.com/
1389 \end{codesample2} 1420 \end{codesample2}
1390 1421
1391 Here is an example set of \hgext{bugzilla} hook config information. 1422 %Here is an example set of \hgext{bugzilla} hook config information.
1423 \hgext{bugzilla}$B%U%C%/$N@_Dj>pJs$NNc$r<($9!%(B
1392 \begin{codesample2} 1424 \begin{codesample2}
1393 [bugzilla] 1425 [bugzilla]
1394 host = bugzilla.example.com 1426 host = bugzilla.example.com
1395 password = mypassword 1427 password = mypassword
1396 version = 2.16 1428 version = 2.16
1406 \end{codesample2} 1438 \end{codesample2}
1407 1439
1408 %\subsubsection{Testing and troubleshooting} 1440 %\subsubsection{Testing and troubleshooting}
1409 \subsubsection{$B%F%9%H$HLdBj2r7h(B} 1441 \subsubsection{$B%F%9%H$HLdBj2r7h(B}
1410 1442
1411 The most common problems with configuring the \hgext{bugzilla} hook 1443 %The most common problems with configuring the \hgext{bugzilla} hook
1412 relate to running Bugzilla's \filename{processmail} script and mapping 1444 %relate to running Bugzilla's \filename{processmail} script and mapping
1413 committer names to user names. 1445 %committer names to user names.
1414 1446
1415 Recall from section~\ref{sec:hook:bugzilla:config} above that the user 1447 \hgext{bugzilla}$B%U%C%/$r@_Dj$9$k:]$K(BBugzilla$B$N(B\filename{processmail}$B%9%/(B
1416 that runs the Mercurial process on the server is also the one that 1448 $B%j%W%H$N<B9T$H%3%_%C%?!<L>$N%f!<%6L>$X$N%^%C%T%s%0$,$h$/LdBj$K$J$k!%(B
1417 will run the \filename{processmail} script. The 1449
1418 \filename{processmail} script sometimes causes Bugzilla to write to 1450 %Recall from section~\ref{sec:hook:bugzilla:config} above that the user
1419 files in its configuration directory, and Bugzilla's configuration 1451 %that runs the Mercurial process on the server is also the one that
1420 files are usually owned by the user that your web server runs under. 1452 %will run the \filename{processmail} script. The
1421 1453 %\filename{processmail} script sometimes causes Bugzilla to write to
1422 You can cause \filename{processmail} to be run with the suitable 1454 %files in its configuration directory, and Bugzilla's configuration
1423 user's identity using the \command{sudo} command. Here is an example 1455 %files are usually owned by the user that your web server runs under.
1424 entry for a \filename{sudoers} file. 1456
1457 \ref{sec:hook:bugzilla:config}$B@a$G!$%5!<%P>e$G(BMercurial$B$rF0:n$5$;$F$$$k%f!<(B
1458 $B%6$H(B\filename{processmail}$B%9%/%j%W%H$rF0$+$7$F$$$k%f!<%6$,F1$8$@$H=R$Y$?!%(B
1459 \filename{processmail}$B%9%/%j%W%H$O(BBugzilla$B$K@_Dj%G%#%l%/%H%jFb$N%U%!%$%k(B
1460 $B$K=q$-9~$^$;$k$3$H$,$"$k!%(B Bugzilla$B$N@_Dj%U%!%$%k$ODL>o!$%&%'%V%5!<%P$r5/(B
1461 $BF0$7$F$$$k%f!<%6$N=jM-$G$"$k!%(B
1462
1463 %You can cause \filename{processmail} to be run with the suitable
1464 %user's identity using the \command{sudo} command. Here is an example
1465 %entry for a \filename{sudoers} file.
1466 %\begin{codesample2}
1467 % hg_user = (httpd_user) NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s
1468 %\end{codesample2}
1469 %This allows the \texttt{hg\_user} user to run a
1470 %\filename{processmail-wrapper} program under the identity of
1471 %\texttt{httpd\_user}.
1472
1473 \command{sudo}$B%3%^%s%I$r;H$&$3$H$G(B\filename{processmail}$B$rE,@Z$J%f!<%6$N(B
1474 $B8"8B$G<B9T$9$k$3$H$,$G$-$k!%(B\filename{sudoers}$B%U%!%$%k$N5-=RNc$r<($9!%(B
1425 \begin{codesample2} 1475 \begin{codesample2}
1426 hg_user = (httpd_user) NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s 1476 hg_user = (httpd_user) NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s
1427 \end{codesample2} 1477 \end{codesample2}
1428 This allows the \texttt{hg\_user} user to run a 1478 $B$3$NNc$G$O!$%f!<%6(B\texttt{hg\_user}$B$,(B\filename{processmail-wrapper}$B%W%m%0(B
1429 \filename{processmail-wrapper} program under the identity of 1479 $B%i%`$r%f!<%6(B\texttt{httpd\_user}$B$N8"8B$N85$G<B9T$9$k$3$H$,$G$-$k!%(B
1430 \texttt{httpd\_user}. 1480
1431 1481 %This indirection through a wrapper script is necessary, because
1432 This indirection through a wrapper script is necessary, because 1482 %\filename{processmail} expects to be run with its current directory
1433 \filename{processmail} expects to be run with its current directory 1483 %set to wherever you installed Bugzilla; you can't specify that kind of
1434 set to wherever you installed Bugzilla; you can't specify that kind of 1484 %constraint in a \filename{sudoers} file. The contents of the wrapper
1435 constraint in a \filename{sudoers} file. The contents of the wrapper 1485 %script are simple:
1436 script are simple: 1486 %\begin{codesample2}
1487 % #!/bin/sh
1488 % cd `dirname $0` && ./processmail "$1" nobody@example.com
1489 %\end{codesample2}
1490 %It doesn't seem to matter what email address you pass to
1491 %\filename{processmail}.
1492
1493 $B$3$N%i%C%Q!<%9%/%j%W%H$+$i<B9T$9$k4V@\<B9T$OI,MW$G$"(B
1494 $B$k!%(B\filename{processmail}$B$O(BBugzilla$B$r$I$3$K%$%s%9%H!<%k$7$F$b%+%l%s%H%G%#(B
1495 $B%l%/%H%j$+$i<B9T$5$l$k$?$a$G$"$k!%<B9T@)8B$N<oN`$r(B\filename{sudoers}$B%U%!(B
1496 $B%$%k$K5-=R$9$k!%%i%C%Q!<%9%/%j%W%H$NFbMF$O%7%s%W%k$J$b$N$G$"$k!%(B
1437 \begin{codesample2} 1497 \begin{codesample2}
1438 #!/bin/sh 1498 #!/bin/sh
1439 cd `dirname $0` && ./processmail "$1" nobody@example.com 1499 cd `dirname $0` && ./processmail "$1" nobody@example.com
1440 \end{codesample2} 1500 \end{codesample2}
1441 It doesn't seem to matter what email address you pass to 1501 \filename{processmail}$B$KEO$9(Bemail$B%"%I%l%9$O$I$s$J$b$N$G$b$h$$!%(B
1442 \filename{processmail}. 1502
1443 1503 %If your \rcsection{usermap} is not set up correctly, users will see an
1444 If your \rcsection{usermap} is not set up correctly, users will see an 1504 %error message from the \hgext{bugzilla} hook when they push changes
1445 error message from the \hgext{bugzilla} hook when they push changes 1505 %to the server. The error message will look like this:
1446 to the server. The error message will look like this: 1506 %\begin{codesample2}
1507 % cannot find bugzilla user id for john.q.public@example.com
1508 %\end{codesample2}
1509 %What this means is that the committer's address,
1510 %\texttt{john.q.public@example.com}, is not a valid Bugzilla user name,
1511 %nor does it have an entry in your \rcsection{usermap} that maps it to
1512 %a valid Bugzilla user name.
1513
1514 \rcsection{usermap}$B$,@5$7$/@_Dj$5$l$F$$$J$$>l9g!$JQ99$r%5!<%P$K%W%C%7%e$9(B
1515 $B$k:]$K(B\hgext{bugzilla}$B%U%C%/$+$i$N%(%i!<%a%C%;!<%8$,%f!<%6$KAw$i$l$k!%(B
1516 $B%(%i!<%a%C%;!<%8$O(B
1447 \begin{codesample2} 1517 \begin{codesample2}
1448 cannot find bugzilla user id for john.q.public@example.com 1518 cannot find bugzilla user id for john.q.public@example.com
1449 \end{codesample2} 1519 \end{codesample2}
1450 What this means is that the committer's address, 1520 $B$N$h$&$JFbMF$G$"$k!%$3$l$O!$%3%_%C%?$N%"%I%l%9(B
1451 \texttt{john.q.public@example.com}, is not a valid Bugzilla user name, 1521 \texttt{john.q.public@example.com}$B$,M-8z$J(BBugzilla$B%f!<%6%M!<%`$G$J$/!$$^(B
1452 nor does it have an entry in your \rcsection{usermap} that maps it to 1522 $B$?M-8z$J(BBugzilla$B%f!<%6L>$X$N%^%C%W%U%!%$%k$G$"$k(B\rcsection{usermap}$B$K$b(B
1453 a valid Bugzilla user name. 1523 $B5-=R$,$J$$$H$$$&0UL#$G$"$k!%(B
1454 1524
1455 %\subsection{\hgext{notify}---send email notifications} 1525 %\subsection{\hgext{notify}---send email notifications}
1456 \subsection{\hgext{notify}---$B%a!<%k$GDLCN$r9T$&(B} 1526 \subsection{\hgext{notify}---$B%a!<%k$GDLCN$r9T$&(B}
1457 1527
1458 Although Mercurial's built-in web server provides RSS feeds of changes 1528 %Although Mercurial's built-in web server provides RSS feeds of changes
1459 in every repository, many people prefer to receive change 1529 %in every repository, many people prefer to receive change
1460 notifications via email. The \hgext{notify} hook lets you send out 1530 %notifications via email. The \hgext{notify} hook lets you send out
1461 notifications to a set of email addresses whenever changesets arrive 1531 %notifications to a set of email addresses whenever changesets arrive
1462 that those subscribers are interested in. 1532 %that those subscribers are interested in.
1463 1533
1464 As with the \hgext{bugzilla} hook, the \hgext{notify} hook is 1534 Mercurial$B$NAH$_9~$_%&%'%V%5!<%P$OA4$F$N%j%]%8%H%j$NJQ99$N(BRSS$B%U%#!<%I$rDs(B
1465 template-driven, so you can customise the contents of the notification 1535 $B6!$9$k$,!$JQ99$NDLCN$r%a!<%k$G<u$1<h$k$3$H$r9%$`%f!<%6$bB?$$!%(B\hgext{notify}
1466 messages that it sends. 1536 \hgext{notify}$B%U%C%/$O!$%A%'%s%8%;%C%H$,E~Ce$7$?;~$K4X?4$r;}$D%f!<%6$N%a!<(B
1467 1537 $B%k%"%I%l%9$KDLCN$rAw$k!%(B
1468 By default, the \hgext{notify} hook includes a diff of every changeset 1538
1469 that it sends out; you can limit the size of the diff, or turn this 1539 %As with the \hgext{bugzilla} hook, the \hgext{notify} hook is
1470 feature off entirely. It is useful for letting subscribers review 1540 %template-driven, so you can customise the contents of the notification
1471 changes immediately, rather than clicking to follow a URL. 1541 %messages that it sends.
1542
1543 \hgext{bugzilla}$B$HF1MM$K(B\hgext{notify}$B%U%C%/$b%F%s%W%l!<%H$r;H$C$FAw?.$5(B
1544 $B$l$kDLCN%a%C%;!<%8$NFbMF$r%+%9%?%^%$%:$9$k$3$H$,$G$-$k!%(B
1545
1546 %By default, the \hgext{notify} hook includes a diff of every changeset
1547 %that it sends out; you can limit the size of the diff, or turn this
1548 %feature off entirely. It is useful for letting subscribers review
1549 %changes immediately, rather than clicking to follow a URL.
1550
1551 $B%G%U%)%k%H$G$O(B\hgext{notify}$B%U%C%/$OAw?.$5$l$kA4$F$N%A%'%s%8%;%C%H$N(Bdiff
1552 $B$r4^$`!%$3$N(Bdiff$B$N%5%$%:$N>e8B$r@_Dj$7$?$j!$Aw?.<+BN$rDd;_$9$k$3$H$,$G$-(B
1553 $B$k!%(Bdiff$B$rAw?.$9$k$H!$9VFI<T$,(BURL$B$r%/%j%C%/$9$k$3$H$J$/JQ99$r$9$0$K%l%S%e!<(B
1554 $B$G$-$kMxE@$,$"$k!%(B
1472 1555
1473 %\subsubsection{Configuring the \hgext{notify} hook} 1556 %\subsubsection{Configuring the \hgext{notify} hook}
1474 \subsubsection{\hgext{notify}$B%U%C%/$N@_Dj(B} 1557 \subsubsection{\hgext{notify}$B%U%C%/$N@_Dj(B}
1475 1558
1476 You can set up the \hgext{notify} hook to send one email message per 1559 %You can set up the \hgext{notify} hook to send one email message per
1477 incoming changeset, or one per incoming group of changesets (all those 1560 %incoming changeset, or one per incoming group of changesets (all those
1478 that arrived in a single pull or push). 1561 %that arrived in a single pull or push).
1562
1563 \hgext{notify}$B%U%C%/$r@_Dj$7!$E~Ce$7$?%A%'%s%8%;%C%HKh$d!J0lEY$N(Bpull$B$d(B
1564 push$B$GE~Ce$7$?!K0lO"$N%A%'%s%8%;%C%HKh$K(Bemail$B$rAw?.$9$k$3$H$,$G$-(B
1565 $B$k!%(B
1479 \begin{codesample2} 1566 \begin{codesample2}
1480 [hooks] 1567 [hooks]
1481 # send one email per group of changes 1568 # $B0lO"$NJQ99Kh$K%a!<%k$rAw?.$9$k(B
1482 changegroup.notify = python:hgext.notify.hook 1569 changegroup.notify = python:hgext.notify.hook
1483 # send one email per change 1570 # $BJQ990l$DKh$K%a!<%k$rAw?.$9$k(B
1484 incoming.notify = python:hgext.notify.hook 1571 incoming.notify = python:hgext.notify.hook
1485 \end{codesample2} 1572 \end{codesample2}
1486 1573
1487 Configuration information for this hook lives in the 1574 %Configuration information for this hook lives in the
1488 \rcsection{notify} section of a \hgrc\ file. 1575 %\rcsection{notify} section of a \hgrc\ file.
1576
1577 $B$3$N%U%C%/$N@_Dj$O(B\hgrc\ $B%U%!%$%k$N(B\rcsection{notify}$B%;%/%7%g%s$K=q$/!%(B
1489 \begin{itemize} 1578 \begin{itemize}
1490 \item[\rcitem{notify}{test}] By default, this hook does not send out 1579 %\item[\rcitem{notify}{test}] By default, this hook does not send out
1491 email at all; instead, it prints the message that it \emph{would} 1580 % email at all; instead, it prints the message that it \emph{would}
1492 send. Set this item to \texttt{false} to allow email to be sent. 1581 % send. Set this item to \texttt{false} to allow email to be sent.
1493 The reason that sending of email is turned off by default is that it 1582 % The reason that sending of email is turned off by default is that it
1494 takes several tries to configure this extension exactly as you would 1583 % takes several tries to configure this extension exactly as you would
1495 like, and it would be bad form to spam subscribers with a number of 1584 % like, and it would be bad form to spam subscribers with a number of
1496 ``broken'' notifications while you debug your configuration. 1585 % ``broken'' notifications while you debug your configuration.
1497 \item[\rcitem{notify}{config}] The path to a configuration file that 1586 \item[\rcitem{notify}{test}] $B%G%U%)%k%H$G$O$3$N%U%C%/$O%a!<%k$rA4$/Aw?.$7(B
1498 contains subscription information. This is kept separate from the 1587 $B$J$$!%$=$NBe$o$j!$Aw?.$5$l$N$HF1$8FbMF$rI=<($9$k!%$3$N9`L\$r(B
1499 main \hgrc\ so that you can maintain it in a repository of its own. 1588 \texttt{false}$B$K@_Dj$9$k$H%a!<%k$,Aw?.$5$l$k!%%G%U%)%k%H$G%a!<(B
1500 People can then clone that repository, update their subscriptions, 1589 $B%kAw?.$,%*%U$K$5$l$F$$$kM}M3$O!$0U?^$9$kDL$j$K$3$N@_Dj$r9T$&(B
1501 and push the changes back to your server. 1590 $B$?$a$K$O?t2s$N;n9T$,I,MW$J$?$a$G$"$k!%%G%P%C%0Cf$K9VFI<T$K2u(B
1502 \item[\rcitem{notify}{strip}] The number of leading path separator 1591 $B$l$?DLCN$rAw$k$N$O%9%Q%`$^$,$$$G9%$^$7$/$J$$!%(B
1503 characters to strip from a repository's path, when deciding whether 1592
1504 a repository has subscribers. For example, if the repositories on 1593 %\item[\rcitem{notify}{config}] The path to a configuration file that
1505 your server live in \dirname{/home/hg/repos}, and \hgext{notify} is 1594 % contains subscription information. This is kept separate from the
1506 considering a repository named \dirname{/home/hg/repos/shared/test}, 1595 % main \hgrc\ so that you can maintain it in a repository of its own.
1507 setting \rcitem{notify}{strip} to \texttt{4} will cause 1596 % People can then clone that repository, update their subscriptions,
1508 \hgext{notify} to trim the path it considers down to 1597 % and push the changes back to your server.
1509 \dirname{shared/test}, and it will match subscribers against that. 1598 \item[\rcitem{notify}{config}] $B9VFI<T>pJs$r4^$`@_Dj%U%!%$%k$X$N%Q%9!%%a%$(B
1510 \item[\rcitem{notify}{template}] The template text to use when sending 1599 $B%s$N(B\hgrc\ $B$HJ,N%$9$k$3$H$G!$%j%]%8%H%jKh$K%j%]%8%H%jFb$G4I(B
1511 messages. This specifies both the contents of the message header 1600 $BM}$G$-$k!%6(NO<T$O%j%]%8%H%j$r%/%m!<%s$7!$9VFI<T$r%"%C%W%G!<(B
1512 and its body. 1601 $B%H$7$FJQ99$r%5!<%P$K(Bpush$B$G$-$k!%(B
1513 \item[\rcitem{notify}{maxdiff}] The maximum number of lines of diff 1602
1514 data to append to the end of a message. If a diff is longer than 1603 %\item[\rcitem{notify}{strip}] The number of leading path separator
1515 this, it is truncated. By default, this is set to 300. Set this to 1604 % characters to strip from a repository's path, when deciding whether
1516 \texttt{0} to omit diffs from notification emails. 1605 % a repository has subscribers. For example, if the repositories on
1517 \item[\rcitem{notify}{sources}] A list of sources of changesets to 1606 % your server live in \dirname{/home/hg/repos}, and \hgext{notify} is
1518 consider. This lets you limit \hgext{notify} to only sending out 1607 % considering a repository named \dirname{/home/hg/repos/shared/test},
1519 email about changes that remote users pushed into this repository 1608 % setting \rcitem{notify}{strip} to \texttt{4} will cause
1520 via a server, for example. See section~\ref{sec:hook:sources} for 1609 % \hgext{notify} to trim the path it considers down to
1521 the sources you can specify here. 1610 % \dirname{shared/test}, and it will match subscribers against that.
1611 \item[\rcitem{notify}{strip}] $B%j%]%8%H%j$K9VFI<T$,$$$k$+$I$&$+H=Dj$9$k:](B
1612 $B$K!$%j%]%8%H%j$N%Q%9$+$i=|5n$9$k@h9TItJ,$r%Q%96h@Z$jJ8;z$G<((B
1613 $B$7$??t!%Nc$($P!$%5!<%P$G%j%]%8%H%j72$,(B
1614 \dirname{/home/hg/repos}$B$KCV$+$l$F$*$j!$(B \hgext{notify}$B$,(B
1615 \dirname{/home/hg/repos/shared/test}$B$H$$$&%j%]%8%H%j$rBP>]$H(B
1616 $B$9$k;~!$(B\rcitem{notify}{strip} $B$r(B \texttt{4}$B$K@_Dj$9$k$H(B
1617 \hgext{notify}$B$O%Q%9$r(B\dirname{shared/test}$B$KC;=L$7!$$3$l$r(B
1618 $BMQ$$$F9VFI<T$N%^%C%A$r9T$&!%(B
1619
1620 %\item[\rcitem{notify}{template}] The template text to use when sending
1621 % messages. This specifies both the contents of the message header
1622 % and its body.
1623 \item[\rcitem{notify}{template}] $B%a%C%;!<%8$rAw?.$9$k;~$K;H$o$l$k%F%-%9(B
1624 $B%H$N%F%s%W%l!<%H!%%a%C%;!<%8$N%X%C%@$H%\%G%#N>J}$r@_Dj$9$k(B
1625 $B$3$H$,$G$-$k!%(B
1626
1627 %\item[\rcitem{notify}{maxdiff}] The maximum number of lines of diff
1628 % data to append to the end of a message. If a diff is longer than
1629 % this, it is truncated. By default, this is set to 300. Set this to
1630 % \texttt{0} to omit diffs from notification emails.
1631 \item[\rcitem{notify}{maxdiff}] $B%a%C%;!<%8$NKvHx$KE:IU$5$l$k(Bdiff$B%G!<%?$N(B
1632 $B:GBg9T?t!%(Bdiff$B$,$3$NCM$h$jBg$-$$>l9g$O@Z$j5M$a$i$l$k!%%G%U%)(B
1633 $B%k%H$G$O(B300$B9T!%$3$NCM$r(B\texttt{0}$B$K$9$k$3$H$GDLCN(Bemail$B$X$N(B
1634 diff$B$NE:IU$rM^@)$9$k$3$H$,$G$-$k!%(B
1635
1636 %\item[\rcitem{notify}{sources}] A list of sources of changesets to
1637 % consider. This lets you limit \hgext{notify} to only sending out
1638 % email about changes that remote users pushed into this repository
1639 % via a server, for example. See section~\ref{sec:hook:sources} for
1640 % the sources you can specify here.
1641 \item[\rcitem{notify}{sources}] $BBP>]%A%'%s%8%;%C%H$N%=!<%9$N%j%9%H!%Nc$((B
1642 $B$P!$$3$N%j%9%H$G%j%b!<%H%f!<%6$,%5!<%P7PM3$G%j%]%8%H%j$X%W%C(B
1643 $B%7%e$7$?JQ99$K4X$7$F$N$_DLCN$r9T$&$h$&$K@)8B$9$k$3$H$,$G$-(B
1644 $B$k!%$3$3$G;XDj$G$-$k%=!<%9$K$D$$$F$O(B\ref{sec:hook:sources}
1645 $B@a$r;2>H$N$3$H!%(B
1522 \end{itemize} 1646 \end{itemize}
1523 1647
1524 If you set the \rcitem{web}{baseurl} item in the \rcsection{web} 1648 %If you set the \rcitem{web}{baseurl} item in the \rcsection{web}
1525 section, you can use it in a template; it will be available as 1649 %section, you can use it in a template; it will be available as
1526 \texttt{webroot}. 1650 %\texttt{webroot}.
1527 1651
1528 Here is an example set of \hgext{notify} configuration information. 1652 \rcsection{web}$B%;%/%7%g%s$N(B\rcitem{web}{baseurl}$B9`L\$r@_Dj$7$F$$$k$J$i!$(B
1653 $B$3$l$r(B\texttt{webroot}$B$H$7$F%F%s%W%l!<%HFb$G;H$&$3$H$,$G$-$k!%(B
1654
1655 %Here is an example set of \hgext{notify} configuration information.
1656 \hgext{notify}$B@_Dj$NNc$r<($9!%(B
1657 %\begin{codesample2}
1658 % [notify]
1659 % # really send email
1660 % test = false
1661 % # subscriber data lives in the notify repo
1662 % config = /home/hg/repos/notify/notify.conf
1663 % # repos live in /home/hg/repos on server, so strip 4 "/" chars
1664 % strip = 4
1665 % template = X-Hg-Repo: \{webroot\}
1666 % Subject: \{webroot\}: \{desc|firstline|strip\}
1667 % From: \{author\}
1668 %
1669 % changeset \{node|short\} in \{root\}
1670 % details: \{baseurl\}\{webroot\}?cmd=changeset;node=\{node|short\}
1671 % description:
1672 % \{desc|tabindent|strip\}
1673 %
1674 % [web]
1675 % baseurl = http://hg.example.com/
1676 %\end{codesample2}
1677
1529 \begin{codesample2} 1678 \begin{codesample2}
1530 [notify] 1679 [notify]
1531 # really send email 1680 # $B<B:]$K%a!<%k$rAw?.$9$k$+(B
1532 test = false 1681 test = false
1533 # subscriber data lives in the notify repo 1682 # $B9VFI<T%G!<%?$,DLCN%j%]%8%H%jFb$K$"$k(B
1534 config = /home/hg/repos/notify/notify.conf 1683 config = /home/hg/repos/notify/notify.conf
1535 # repos live in /home/hg/repos on server, so strip 4 "/" chars 1684 # $B%j%]%8%H%j72$O%5!<%P$N(B /home/hg/repos $B$K$"$k$N$G(B 4$B$D$N(B "/" $BJ8;z$r%9%H%j%C%W$9$k(B
1536 strip = 4 1685 strip = 4
1537 template = X-Hg-Repo: \{webroot\} 1686 template = X-Hg-Repo: \{webroot\}
1538 Subject: \{webroot\}: \{desc|firstline|strip\} 1687 Subject: \{webroot\}: \{desc|firstline|strip\}
1539 From: \{author\} 1688 From: \{author\}
1540 1689
1545 1694
1546 [web] 1695 [web]
1547 baseurl = http://hg.example.com/ 1696 baseurl = http://hg.example.com/
1548 \end{codesample2} 1697 \end{codesample2}
1549 1698
1550 This will produce a message that looks like the following: 1699 %This will produce a message that looks like the following:
1700 $B@8@.$5$l$k%a%C%;!<%8$O<!$N$h$&$K$J$k!'(B
1551 \begin{codesample2} 1701 \begin{codesample2}
1552 X-Hg-Repo: tests/slave 1702 X-Hg-Repo: tests/slave
1553 Subject: tests/slave: Handle error case when slave has no buffers 1703 Subject: tests/slave: Handle error case when slave has no buffers
1554 Date: Wed, 2 Aug 2006 15:25:46 -0700 (PDT) 1704 Date: Wed, 2 Aug 2006 15:25:46 -0700 (PDT)
1555 1705
1567 \end{codesample2} 1717 \end{codesample2}
1568 1718
1569 %\subsubsection{Testing and troubleshooting} 1719 %\subsubsection{Testing and troubleshooting}
1570 \subsubsection{$B%F%9%H$HLdBj2r7h(B} 1720 \subsubsection{$B%F%9%H$HLdBj2r7h(B}
1571 1721
1572 Do not forget that by default, the \hgext{notify} extension \emph{will 1722 %Do not forget that by default, the \hgext{notify} extension \emph{will
1573 not send any mail} until you explicitly configure it to do so, by 1723
1574 setting \rcitem{notify}{test} to \texttt{false}. Until you do that, 1724 % not send any mail} until you explicitly configure it to do so, by
1575 it simply prints the message it \emph{would} send. 1725 %setting \rcitem{notify}{test} to \texttt{false}. Until you do that,
1726 %it simply prints the message it \emph{would} send.
1727
1728 $B%G%U%)%k%H$G$O(B\hgext{notify}$B%(%/%9%F%s%7%g%s$O(B\emph{$B%a!<%k$rAw?.$7$J$$(B}$B$3(B
1729 $B$H$KN10U$9$k$3$H!%<B:]$KAw?.$5$;$k$?$a$K$OL@<(E*$K(B\rcitem{notify}{test}$B$r(B
1730 \texttt{false}$B$K@_Dj$7$J$1$l$P$J$i$J$$!%$3$N@_Dj$r$7$J$1$l$P!$Aw?.$9$k$N(B
1731 $B$HF1$8%a%C%;!<%8$rI=<($9$k$@$1$G$"$k!%(B
1576 1732
1577 %\section{Information for writers of hooks} 1733 %\section{Information for writers of hooks}
1578 \section{$B%U%C%/:n@=<T$X$N>pJs(B} 1734 \section{$B%U%C%/:n@=<T$X$N>pJs(B}
1579 \label{sec:hook:ref} 1735 \label{sec:hook:ref}
1580 1736
1581 %\subsection{In-process hook execution} 1737 %\subsection{In-process hook execution}
1582 \subsection{$B%W%m%;%9Fb%U%C%/$N<B9T(B} 1738 \subsection{$B%W%m%;%9Fb%U%C%/$N<B9T(B}
1583 1739
1584 An in-process hook is called with arguments of the following form: 1740 %An in-process hook is called with arguments of the following form:
1741 $B%W%m%;%9Fb%U%C%/$O<!$N$h$&$J7A<0$N0z?t$rH<$C$F8F$S=P$5$l$k!'(B
1585 \begin{codesample2} 1742 \begin{codesample2}
1586 def myhook(ui, repo, **kwargs): 1743 def myhook(ui, repo, **kwargs):
1587 pass 1744 pass
1588 \end{codesample2} 1745 \end{codesample2}
1589 The \texttt{ui} parameter is a \pymodclass{mercurial.ui}{ui} object. 1746 %The \texttt{ui} parameter is a \pymodclass{mercurial.ui}{ui} object.
1590 The \texttt{repo} parameter is a 1747 %The \texttt{repo} parameter is a
1591 \pymodclass{mercurial.localrepo}{localrepository} object. The 1748 %\pymodclass{mercurial.localrepo}{localrepository} object. The
1592 names and values of the \texttt{**kwargs} parameters depend on the 1749 %names and values of the \texttt{**kwargs} parameters depend on the
1593 hook being invoked, with the following common features: 1750 %hook being invoked, with the following common features:
1751 \texttt{ui}$B%Q%i%a!<%?$O(B\pymodclass{mercurial.ui}{ui}$B$N%*%V%8%'%/%H$G$"$k!%(B
1752 \texttt{repo}$B%Q%i%a!<%?$O(B
1753 \pymodclass{mercurial.localrepo}{localrepository}$B$N%*%V%8%'%/%H$G$"$k!%(B
1754 \texttt{**kwargs}$B%Q%i%a!<%?$NL>A0$HCM$O!$8F$S=P$5$l$k%U%C%/$K0MB8$7!$<!(B
1755 $B$N$h$&$J6&DL$7$?FCD'$r;}$D!%(B
1756 %\begin{itemize}
1757 %\item If a parameter is named \texttt{node} or
1758 % \texttt{parent\emph{N}}, it will contain a hexadecimal changeset ID.
1759 % The empty string is used to represent ``null changeset ID'' instead
1760 % of a string of zeroes.
1761 %\item If a parameter is named \texttt{url}, it will contain the URL of
1762 % a remote repository, if that can be determined.
1763 %\item Boolean-valued parameters are represented as Python
1764 % \texttt{bool} objects.
1765 %\end{itemize}
1594 \begin{itemize} 1766 \begin{itemize}
1595 \item If a parameter is named \texttt{node} or 1767 \item $B%Q%i%a!<%?$,(B\texttt{node}$B$^$?$O(B\texttt{parent\emph{N}}$B$HL>IU$1$i$l(B
1596 \texttt{parent\emph{N}}, it will contain a hexadecimal changeset ID. 1768 $B$?>l9g!$(B16$B?J?t$N%A%'%s%8%;%C%H(BID$B$r;}$D!%(B ``$B%L%k%A%'%s%8%;%C%H(BID''$B$r(B
1597 The empty string is used to represent ``null changeset ID'' instead 1769 $BI=$9$?$a$K(B0$B$G$O$J$/6u$NJ8;zNs$,MQ$$$i$l$k!%(B
1598 of a string of zeroes. 1770 \item $B%Q%i%a!<%?$,(B\texttt{url}$B$HL>IU$1$i$l$?>l9g!$%j%b!<%H%j%]%8%H%j$,FC(B
1599 \item If a parameter is named \texttt{url}, it will contain the URL of 1771 $BDj$5$l$k$J$i$P$=$N(BURL$B$r;}$D!%(B
1600 a remote repository, if that can be determined. 1772 \item $B%V!<%kCM$r;}$D%Q%i%a!<%?$O(BPython$B$N(B\texttt{bool}$B%*%V%8%'%/%H$H$7$F(B
1601 \item Boolean-valued parameters are represented as Python 1773 $BI=8=$5$l$k!%(B
1602 \texttt{bool} objects.
1603 \end{itemize} 1774 \end{itemize}
1604 1775
1605 An in-process hook is called without a change to the process's working 1776 %An in-process hook is called without a change to the process's working
1606 directory (unlike external hooks, which are run in the root of the 1777 %directory (unlike external hooks, which are run in the root of the
1607 repository). It must not change the process's working directory, or 1778 %repository). It must not change the process's working directory, or
1608 it will cause any calls it makes into the Mercurial API to fail. 1779 %it will cause any calls it makes into the Mercurial API to fail.
1609 1780
1610 If a hook returns a boolean ``false'' value, it is considered to have 1781 $B%W%m%;%9Fb%U%C%/$O!$%j%]%8%H%j$N%k!<%H$G<B9T$5$l$k30It%U%C%/$H0[$J$j%W%m(B
1611 succeeded. If it returns a boolean ``true'' value or raises an 1782 $B%;%9$N%o!<%-%s%0%G%#%l%/%H%j$NJQ99$J$7$K8F$S=P$5$l$k!%%W%m%;%9Fb%U%C%/$O(B
1612 exception, it is considered to have failed. A useful way to think of 1783 $B%W%m%;%9%o!<%-%s%0%G%#%l%/%H%j$rJQ99$7$F$O$J$i$J$$!%$5$b$J$1$l(B
1613 the calling convention is ``tell me if you fail''. 1784 $B$P!$(BMercurial API$B$X$N8F$S=P$7$OA4$F<:GT$9$k!%(B
1614 1785
1615 Note that changeset IDs are passed into Python hooks as hexadecimal 1786 %If a hook returns a boolean ``false'' value, it is considered to have
1616 strings, not the binary hashes that Mercurial's APIs normally use. To 1787 %succeeded. If it returns a boolean ``true'' value or raises an
1617 convert a hash from hex to binary, use the 1788 %exception, it is considered to have failed. A useful way to think of
1618 \pymodfunc{mercurial.node}{bin} function. 1789 %the calling convention is ``tell me if you fail''.
1790
1791 $B%U%C%/$,%V!<%kCM(B``false''$B$rJV$7$?>l9g!$%U%C%/$N<B9T$O@.8y$7$?$H8+$J$5$l(B
1792 $B$k!%%V!<%kCM(B``true''$B$rJV$7$?>l9g$*$h$SNc30$rH/@8$5$;$?>l9g$O<:GT$7$?$H8+(B
1793 $B$J$5$l$k!%8F$S=P$74{Ls$O(B ``$B<:GT$7$?;~$O65$($k(B''$B$H3P$($k$H$h$$!%(B
1794
1795 %Note that changeset IDs are passed into Python hooks as hexadecimal
1796 %strings, not the binary hashes that Mercurial's APIs normally use. To
1797 %convert a hash from hex to binary, use the
1798 %\pymodfunc{mercurial.node}{bin} function.
1799
1800 Python$B%U%C%/$KEO$5$l$k%A%'%s%8%;%C%H(BID$B$O!$(BMercurial API$B$,DL>oMQ$$$k%P%$%J(B
1801 $B%j%O%C%7%eCM$G$O$J$/(B16$B?J?tJ8;zNs$G$"$k$3$H$KCm0U!%%O%C%7%eCM$r(B16$B?J?tJ8;z(B
1802 $BNs$+$i%P%$%J%j$KJQ49$9$k$K$O(B\pymodfunc{mercurial.node}{bin}$B4X?t$rMQ$$$k!%(B
1619 1803
1620 %\subsection{External hook execution} 1804 %\subsection{External hook execution}
1621 \subsection{$B%U%C%/$N30It<B9T(B} 1805 \subsection{$B%U%C%/$N30It<B9T(B}
1622 1806
1623 An external hook is passed to the shell of the user running Mercurial. 1807 An external hook is passed to the shell of the user running Mercurial.
1839 2023
1840 %\subsection{\hook{precommit}---before starting to commit a changeset} 2024 %\subsection{\hook{precommit}---before starting to commit a changeset}
1841 \subsection{\hook{precommit}---$B%A%'%s%8%;%C%H$r%3%_%C%H$9$kA0(B} 2025 \subsection{\hook{precommit}---$B%A%'%s%8%;%C%H$r%3%_%C%H$9$kA0(B}
1842 \label{sec:hook:precommit} 2026 \label{sec:hook:precommit}
1843 2027
1844 This hook is run before Mercurial begins to commit a new changeset. 2028 %This hook is run before Mercurial begins to commit a new changeset.
1845 It is run before Mercurial has any of the metadata for the commit, 2029 %It is run before Mercurial has any of the metadata for the commit,
1846 such as the files to be committed, the commit message, or the commit 2030 %such as the files to be committed, the commit message, or the commit
1847 date. 2031 %date.
1848 2032
1849 One use for this hook is to disable the ability to commit new 2033 $B$3$N%U%C%/$O(BMercurial$B$,?7$7$$%A%'%s%8%;%C%H$r%3%_%C%H$9$kA0$K<B9T$5$l$k!%(B
1850 changesets, while still allowing incoming changesets. Another is to 2034 $B<B9T$O(BMercurial$B$,%3%_%C%H$5$l$k%U%!%$%kL>!$%3%_%C%H%a%C%;!<%8!$%3%_%C%HF|(B
1851 run a build or test, and only allow the commit to begin if the build 2035 $B;~$N$h$&$J%3%_%C%H$N$?$a$N%a%?%G!<%?$r;}$DA0$G$"$k!%(B
1852 or test succeeds. 2036
1853 2037 %One use for this hook is to disable the ability to commit new
1854 Parameters to this hook: 2038 %changesets, while still allowing incoming changesets. Another is to
2039 %run a build or test, and only allow the commit to begin if the build
2040 %or test succeeds.
2041
2042 $B$3$N%U%C%/$r;H$C$F!$30It$+$i$N%A%'%s%8%;%C%H$N<h$j9~$_$r5v2D$9$k0lJ}$G!$(B
2043 $B?7$7$$%A%'%s%8%;%C%H$r%3%_%C%H$G$-$J$$$h$&$K$9$k$3$H$b$G$-$k!%$^$?!$%S%k(B
2044 $B%I$d%F%9%H$r<B9T$7$?$j!$$=$l$,@.8y$7$?;~$N$_%3%_%C%H$r9T$&$h$&$K$9$k$3$H(B
2045 $B$b$G$-$k!%(B
2046
2047 %Parameters to this hook:
2048 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
2049 %\begin{itemize}
2050 %\item[\texttt{parent1}] A changeset ID. The changeset ID of the first
2051 % parent of the working directory.
2052 %\item[\texttt{parent2}] A changeset ID. The changeset ID of the second
2053 % parent of the working directory.
2054 %\end{itemize}
1855 \begin{itemize} 2055 \begin{itemize}
1856 \item[\texttt{parent1}] A changeset ID. The changeset ID of the first 2056 \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$N(B1$B$DL\$N(B
1857 parent of the working directory. 2057 $B?F$N%A%'%s%8%;%C%H(BID$B!%(B
1858 \item[\texttt{parent2}] A changeset ID. The changeset ID of the second 2058 \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$N(B2$B$DL\$N(B
1859 parent of the working directory. 2059 $B?F$N%A%'%s%8%;%C%H(BID$B!%(B
1860 \end{itemize} 2060 \end{itemize}
1861 If the commit proceeds, the parents of the working directory will 2061 %If the commit proceeds, the parents of the working directory will
1862 become the parents of the new changeset. 2062 %become the parents of the new changeset.
1863 2063
1864 See also: \hook{commit} (section~\ref{sec:hook:commit}), 2064 $B%3%_%C%H$,?J9T$9$k$H%o!<%-%s%0%G%#%l%/%H%j$N?F$O?7$7$$%A%'%s%8%;%C%H$N?F(B
1865 \hook{pretxncommit} (section~\ref{sec:hook:pretxncommit}) 2065 $B$H$J$k!%(B
2066
2067 %See also: \hook{commit} (section~\ref{sec:hook:commit}),
2068 %\hook{pretxncommit} (section~\ref{sec:hook:pretxncommit})
2069
2070 $B;29M!'(B\hook{commit} (\ref{sec:hook:commit}$B@a(B)$B!$(B\hook{pretxncommit}
2071 (\ref{sec:hook:pretxncommit}$B@a(B)
1866 2072
1867 %\subsection{\hook{preoutgoing}---before starting to propagate 2073 %\subsection{\hook{preoutgoing}---before starting to propagate
1868 %changesets} 2074 %changesets}
1869 \subsection{\hook{preoutgoing}---$B%A%'%s%8%;%C%H$rGH5Z$5$;$kA0$K(B} 2075 \subsection{\hook{preoutgoing}---$B%A%'%s%8%;%C%H$rGH5Z$5$;$kA0$K(B}
1870 \label{sec:hook:preoutgoing} 2076 \label{sec:hook:preoutgoing}
1871 2077
1872 This hook is invoked before Mercurial knows the identities of the 2078 %This hook is invoked before Mercurial knows the identities of the
1873 changesets to be transmitted. 2079 %changesets to be transmitted.
1874 2080
1875 One use for this hook is to prevent changes from being transmitted to 2081 $B$3$N%U%C%/$O(BMercurial$B$,Aw?.$9$k%A%'%s%8%;%C%H$r<1JL$9$kA0$K<B9T$5$l$k!%(B
1876 another repository. 2082
1877 2083 %One use for this hook is to prevent changes from being transmitted to
1878 Parameters to this hook: 2084 %another repository.
2085
2086 $B$3$N%U%C%/$rMQ$$$F!$B>$N%j%]%8%H%j$XJQ99$rAw?.$7$J$$$h$&$K$9$k$3$H$b$G$-(B
2087 $B$k!%(B
2088
2089 %Parameters to this hook:
2090 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
2091 %\begin{itemize}
2092 %\item[\texttt{source}] A string. The source of the operation that is
2093 % attempting to obtain changes from this repository (see
2094 % section~\ref{sec:hook:sources}). See the documentation for the
2095 % \texttt{source} parameter to the \hook{outgoing} hook, in
2096 % section~\ref{sec:hook:outgoing}, for possible values of this
2097 % parameter.
2098 %\item[\texttt{url}] A URL. The location of the remote repository, if
2099 % known. See section~\ref{sec:hook:url} for more information.
2100 %\end{itemize}
1879 \begin{itemize} 2101 \begin{itemize}
1880 \item[\texttt{source}] A string. The source of the operation that is 2102 \item[\texttt{source}] $BJ8;zNs!%$3$N%j%]%8%H%j$+$iJQ99$r<hF@$7$h$&$H$9$kF0(B
1881 attempting to obtain changes from this repository (see 2103 $B:n$N%=!<%9!J(B\ref{sec:hook:sources}$B$r;2>H!K!%$3$N%Q%i!<%a%?$,(B
1882 section~\ref{sec:hook:sources}). See the documentation for the 2104 $B<h$jF@$kCM$K$D$$$F$O!$(B \ref{sec:hook:outgoing}$B@a$N(B
1883 \texttt{source} parameter to the \hook{outgoing} hook, in 2105 \hook{outgoing}$B%U%C%/$X$N(B\texttt{source}$B%Q%i%a!<%?$N9`L\$r;2(B
1884 section~\ref{sec:hook:outgoing}, for possible values of this 2106 $B>H$N$3$H!%(B
1885 parameter. 2107 \item[\texttt{url}] URL$B!%%j%b!<%H%j%]%8%H%j$,FCDj$G$-$k>l9g$O$=$N%"%I%l(B
1886 \item[\texttt{url}] A URL. The location of the remote repository, if 2108 $B%9!%>\:Y$K$D$$$F$O(B\ref{sec:hook:url}$B$r;2>H$N$3$H!%(B
1887 known. See section~\ref{sec:hook:url} for more information.
1888 \end{itemize} 2109 \end{itemize}
1889 2110
1890 See also: \hook{outgoing} (section~\ref{sec:hook:outgoing}) 2111 %See also: \hook{outgoing} (section~\ref{sec:hook:outgoing})
2112 $B;29M!'(B \hook{outgoing} (\ref{sec:hook:outgoing}$B@a(B)
1891 2113
1892 %\subsection{\hook{pretag}---before tagging a changeset} 2114 %\subsection{\hook{pretag}---before tagging a changeset}
1893 \subsection{\hook{pretag}---$B%A%'%s%8%;%C%H$K%?%0$r$D$1$kA0$K(B} 2115 \subsection{\hook{pretag}---$B%A%'%s%8%;%C%H$K%?%0$r$D$1$kA0$K(B}
1894 \label{sec:hook:pretag} 2116 \label{sec:hook:pretag}
1895 2117
1896 This controlling hook is run before a tag is created. If the hook 2118 %This controlling hook is run before a tag is created. If the hook
1897 succeeds, creation of the tag proceeds. If the hook fails, the tag is 2119 %succeeds, creation of the tag proceeds. If the hook fails, the tag is
1898 not created. 2120 %not created.
1899 2121
1900 Parameters to this hook: 2122 $B$3$N@)8f%U%C%/$O%?%0$,:n@.$5$l$kA0$K<B9T$5$l$k!%%U%C%/$N<B9T$,@.8y$7$?>l(B
2123 $B9g$O%?%0$,:n@.$5$l$k!%%U%C%/$N<B9T$,<:GT$7$?>l9g$O%?%0$O:n@.$5$l$J$$!%(B
2124
2125 %Parameters to this hook:
2126 $B$3$N%U%C%/$X$N%Q%i%a!<%?(B
2127 %\begin{itemize}
2128 %\item[\texttt{local}] A boolean. Whether the tag is local to this
2129 % repository instance (i.e.~stored in \sfilename{.hg/localtags}) or
2130 % managed by Mercurial (stored in \sfilename{.hgtags}).
2131 %\item[\texttt{node}] A changeset ID. The ID of the changeset to be tagged.
2132 %\item[\texttt{tag}] A string. The name of the tag to be created.
2133 %\end{itemize}
2134
1901 \begin{itemize} 2135 \begin{itemize}
1902 \item[\texttt{local}] A boolean. Whether the tag is local to this 2136 \item[\texttt{local}] $B%V!<%kCM!%?7$7$$%?%0$,%j%]%8%H%j%m!<%+%k$J$b$N(B
1903 repository instance (i.e.~stored in \sfilename{.hg/localtags}) or 2137 (\sfilename{.hg/localtags}$B$KJ]B8$5$l$k(B)$B$+(BMercurial$B$K4IM}(B
1904 managed by Mercurial (stored in \sfilename{.hgtags}). 2138 $B$5$l$k$b$N(B(\sfilename{.hgtags}$B$KJ]B8$5$l$k(B)$B$+$r<($9!%(B
1905 \item[\texttt{node}] A changeset ID. The ID of the changeset to be tagged. 2139 \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%%?%0IU$1$5$l$k%A%'%s%8%;%C%H$N(BID.
1906 \item[\texttt{tag}] A string. The name of the tag to be created. 2140 \item[\texttt{tag}] $BJ8;zNs!%@8@.$5$l$?%?%0$NL>A0!%(B
1907 \end{itemize} 2141 \end{itemize}
1908 2142
1909 If the tag to be created is revision-controlled, the \hook{precommit} 2143 %If the tag to be created is revision-controlled, the \hook{precommit}
1910 and \hook{pretxncommit} hooks (sections~\ref{sec:hook:commit} 2144 %and \hook{pretxncommit} hooks (sections~\ref{sec:hook:commit}
1911 and~\ref{sec:hook:pretxncommit}) will also be run. 2145 %and~\ref{sec:hook:pretxncommit}) will also be run.
1912 2146
1913 See also: \hook{tag} (section~\ref{sec:hook:tag}) 2147 $B@8@.$5$l$?%?%0$,%j%S%8%g%s%3%s%H%m!<%k$5$l$F$$$k>l9g!$(B\hook{precommit}$B%U%C(B
2148 $B%/$H(B\hook{pretxncommit}$B%U%C%/(B(\ref{sec:hook:commit}$B@a$*$h$S(B
2149 \ref{sec:hook:pretxncommit})$B@a(B)$B$NN>J}$,<B9T$5$l$k!%(B
2150
2151 %See also: \hook{tag} (section~\ref{sec:hook:tag})
2152 $B;29M!'(B \hook{tag} (\ref{sec:hook:tag}$B@a(B)
1914 2153
1915 %\subsection{\hook{pretxnchangegroup}---before completing addition of 2154 %\subsection{\hook{pretxnchangegroup}---before completing addition of
1916 %remote changesets} 2155 %remote changesets}
1917 \subsection{\hook{pretxnchangegroup}---$B%j%b!<%H%A%'%s%8%;%C%H$NDI2C$r40(B 2156 \subsection{\hook{pretxnchangegroup}---$B%j%b!<%H%A%'%s%8%;%C%H$NDI2C$r40(B
1918 $BN;$9$kA0$K(B} 2157 $BN;$9$kA0$K(B}
1919 \label{sec:hook:pretxnchangegroup} 2158 \label{sec:hook:pretxnchangegroup}
1920 2159
1921 This controlling hook is run before a transaction---that manages the 2160 %This controlling hook is run before a transaction---that manages the
1922 addition of a group of new changesets from outside the 2161 %addition of a group of new changesets from outside the
1923 repository---completes. If the hook succeeds, the transaction 2162 %repository---completes. If the hook succeeds, the transaction
1924 completes, and all of the changesets become permanent within this 2163 %completes, and all of the changesets become permanent within this
1925 repository. If the hook fails, the transaction is rolled back, and 2164 %repository. If the hook fails, the transaction is rolled back, and
1926 the data for the changesets is erased. 2165 %the data for the changesets is erased.
1927 2166
1928 This hook can access the metadata associated with the almost-added 2167 $B$3$N@)8f%U%C%/$O!$30It$+$i?7$7$$%A%'%s%8%;%C%H$rDI2C$9$k%H%i%s%6%/%7%g%s(B
1929 changesets, but it should not do anything permanent with this data. 2168 $B$,40N;$9$kA0$K<B9T$5$l$k!%%U%C%/$N<B9T$,@.8y$7$?>l9g!$%H%i%s%6%/%7%g%s$O(B
1930 It must also not modify the working directory. 2169 $B40N;$7!$A4$F$N%A%'%s%8%;%C%H$O%j%]%8%H%jFb$G1JB3E*$K$J$k!%%U%C%/$N<B9T$,(B
1931 2170 $B<:GT$7$?>l9g!$%H%i%s%6%/%7%g%s$O%m!<%k%P%C%/$5$l!$%A%'%s%8%;%C%H$N%G!<%?(B
1932 While this hook is running, if other Mercurial processes access this 2171 $B$O>C5n$5$l$k!%(B
1933 repository, they will be able to see the almost-added changesets as if 2172
1934 they are permanent. This may lead to race conditions if you do not 2173 %This hook can access the metadata associated with the almost-added
1935 take steps to avoid them. 2174 %changesets, but it should not do anything permanent with this data.
1936 2175 %It must also not modify the working directory.
1937 This hook can be used to automatically vet a group of changesets. If 2176
1938 the hook fails, all of the changesets are ``rejected'' when the 2177 $B$3$N%U%C%/$O%H%i%s%6%/%7%g%sCf$N%A%'%s%8%;%C%H$N%a%?%G!<%?$K%"%/%;%9$9$k(B
1939 transaction rolls back. 2178 $B$3$H$,$G$-$k$,!$$3$N%G!<%?$r;H$C$F1JB3E*$J$3$H$O0l@Z$7$F$O$J$i$J$$!%%o!<(B
1940 2179 $B%-%s%0%G%#%l%/%H%j$NJQ99$b$7$F$O$J$i$J$$!%(B
1941 Parameters to this hook: 2180
2181 %While this hook is running, if other Mercurial processes access this
2182 %repository, they will be able to see the almost-added changesets as if
2183 %they are permanent. This may lead to race conditions if you do not
2184 %take steps to avoid them.
2185
2186 $B$3$N%U%C%/$N<B9TCf!$B>$N(BMercurial$B%W%m%;%9$,%j%]%8%H%j$K%"%/%;%9$9$k$H!$%H(B
2187 $B%i%s%6%/%7%g%sCf$N%A%'%s%8%;%C%H$r1JB3E*$J$b$N$H8+$J$92DG=@-$,$"$k!%E,@Z(B
2188 $B$J2sHr:v$r9V$8$J$1$l$P!$$3$l$,6%9g>uBV$r0z$-5/$3$92DG=@-$,$"$k!%(B
2189
2190 %This hook can be used to automatically vet a group of changesets. If
2191 %the hook fails, all of the changesets are ``rejected'' when the
2192 %transaction rolls back.
2193
2194 $B$3$N%U%C%/$O0lO"$N%A%'%s%8%;%C%H$r<+F0E*$KGS=|$9$k$?$a$K;H$&$3$H$b$G$-(B
2195 $B$k!%$3$N%U%C%/$N<B9T$,<:GT$7$?>l9g!$%H%i%s%6%/%7%g%s$,%m!<%k%P%C%/$5$l$k(B
2196 $B;~$K%A%'%s%8%;%C%HA4BN$,%j%8%'%/%H$5$l$k!%(B
2197
2198 %Parameters to this hook:
2199 %\begin{itemize}
2200 %\item[\texttt{node}] A changeset ID. The changeset ID of the first
2201 % changeset in the group that was added. All changesets between this
2202 % and \index{tags!\texttt{tip}}\texttt{tip}, inclusive, were added by
2203 % a single \hgcmd{pull}, \hgcmd{push} or \hgcmd{unbundle}.
2204 %\item[\texttt{source}] A string. The source of these changes. See
2205 % section~\ref{sec:hook:sources} for details.
2206 %\item[\texttt{url}] A URL. The location of the remote repository, if
2207 % known. See section~\ref{sec:hook:url} for more information.
2208 %\end{itemize}
2209
2210 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
1942 \begin{itemize} 2211 \begin{itemize}
1943 \item[\texttt{node}] A changeset ID. The changeset ID of the first 2212 \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%DI2C$5$l$k0lO"$N%A%'%s%8%;%C%H$N(B
1944 changeset in the group that was added. All changesets between this 2213 $B$&$A!$:G=i$N%A%'%s%8%;%C%H(BID$B!%$3$l$H(B
1945 and \index{tags!\texttt{tip}}\texttt{tip}, inclusive, were added by 2214 \index{tags!\texttt{tip}}\texttt{tip}$B$N4V$NA4$F$N%A%'%s%8%;%C(B
1946 a single \hgcmd{pull}, \hgcmd{push} or \hgcmd{unbundle}. 2215 $B%H$,0lEY$N(B\hgcmd{pull}, \hgcmd{push} $B$^$?$O(B
1947 \item[\texttt{source}] A string. The source of these changes. See 2216 \item[\texttt{source}] $BJ8;zNs!%$3$l$i$NJQ99$N%=!<%9!%>\:Y$K$D$$$F$O(B
1948 section~\ref{sec:hook:sources} for details. 2217 \ref{sec:hook:sources}$B@a$r;2>H$N$3$H!%(B
1949 \item[\texttt{url}] A URL. The location of the remote repository, if 2218 \item[\texttt{url}] URL$B!%4{CN$N%j%b!<%H%j%]%8%H%j$N>l=j!%>\:Y$K$D$$$F$O(B
1950 known. See section~\ref{sec:hook:url} for more information. 2219 \ref{sec:hook:url}$B@a$r;2>H$N$3$H!%(B
1951 \end{itemize} 2220 \end{itemize}
1952 2221
1953 See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}), 2222 %See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}),
1954 \hook{incoming} (section~\ref{sec:hook:incoming}), 2223 %\hook{incoming} (section~\ref{sec:hook:incoming}),
1955 \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}) 2224 %\hook{prechangegroup} (section~\ref{sec:hook:prechangegroup})
2225
2226 $B;29M!'(B \hook{changegroup} (\ref{sec:hook:changegroup}$B@a(B),
2227 \hook{incoming} (\ref{sec:hook:incoming}$B@a(B),
2228 \hook{prechangegroup} (\ref{sec:hook:prechangegroup}$B@a(B)
1956 2229
1957 %\subsection{\hook{pretxncommit}---before completing commit of new 2230 %\subsection{\hook{pretxncommit}---before completing commit of new
1958 %changeset} 2231 %changeset}
1959 \subsection{\hook{pretxncommit}---$B?7$7$$%A%'%s%8%;%C%H$N%3%_%C%H$r40N;$9(B 2232 \subsection{\hook{pretxncommit}---$B?7$7$$%A%'%s%8%;%C%H$N%3%_%C%H$r40N;$9(B
1960 $B$kA0$K(B} 2233 $B$kA0$K(B}
1961 \label{sec:hook:pretxncommit} 2234 \label{sec:hook:pretxncommit}
1962 2235
1963 This controlling hook is run before a transaction---that manages a new 2236 %This controlling hook is run before a transaction---that manages a new
1964 commit---completes. If the hook succeeds, the transaction completes 2237 %commit---completes. If the hook succeeds, the transaction completes
1965 and the changeset becomes permanent within this repository. If the 2238 %and the changeset becomes permanent within this repository. If the
1966 hook fails, the transaction is rolled back, and the commit data is 2239 %hook fails, the transaction is rolled back, and the commit data is
1967 erased. 2240 %erased.
1968 2241
1969 This hook can access the metadata associated with the almost-new 2242 $B$3$N@)8f%U%C%/$O?7$?$J%3%_%C%H$N$?$a$N%H%i%s%6%/%7%g%s$N40N;A0$K<B9T$5$l(B
1970 changeset, but it should not do anything permanent with this data. It 2243 $B$k!%$3$N%U%C%/$N<B9T$,@.8y$7$?>l9g!$%H%i%s%6%/%7%g%s$,40N;$5$l!$%A%'%s%8(B
1971 must also not modify the working directory. 2244 $B%;%C%H$O%j%]%8%H%jFb$G1JB3E*$K$J$k!%%U%C%/$N<B9T$,<:GT$7$?>l9g$O%H%i%s%6(B
1972 2245 $B%/%7%g%s$O%m!<%k%P%C%/$5$l!$%3%_%C%H%G!<%?$O>C5n$5$l$k!%(B
1973 While this hook is running, if other Mercurial processes access this 2246
1974 repository, they will be able to see the almost-new changeset as if it 2247 %This hook can access the metadata associated with the almost-new
1975 is permanent. This may lead to race conditions if you do not take 2248 %changeset, but it should not do anything permanent with this data. It
1976 steps to avoid them. 2249 %must also not modify the working directory.
1977 2250
1978 Parameters to this hook: 2251 $B$3$N%U%C%/$O%H%i%s%6%/%7%g%sCf$N%A%'%s%8%;%C%H$N%a%?%G!<%?$K%"%/%;%9$9$k(B
2252 $B$3$H$,$G$-$k$,!$$3$N%G!<%?$r;H$C$F1JB3E*$J$3$H$O0l@Z$7$F$O$J$i$J$$!%%o!<(B
2253 $B%-%s%0%G%#%l%/%H%j$NJQ99$b$7$F$O$J$i$J$$!%(B
2254
2255 %While this hook is running, if other Mercurial processes access this
2256 %repository, they will be able to see the almost-new changeset as if it
2257 %is permanent. This may lead to race conditions if you do not take
2258 %steps to avoid them.
2259
2260 $B$3$N%U%C%/$N<B9TCf!$B>$N(BMercurial$B%W%m%;%9$,%j%]%8%H%j$K%"%/%;%9$9$k$H!$%H(B
2261 $B%i%s%6%/%7%g%sCf$N%A%'%s%8%;%C%H$r1JB3E*$J$b$N$H8+$J$92DG=@-$,$"$k!%E,@Z(B
2262 $B$J2sHr:v$r9V$8$J$1$l$P!$$3$l$,6%9g>uBV$r0z$-5/$3$92DG=@-$,$"$k!%(B
2263
2264 %Parameters to this hook:
2265 %\begin{itemize}
2266 %\item[\texttt{node}] A changeset ID. The changeset ID of the newly
2267 % committed changeset.
2268 %\item[\texttt{parent1}] A changeset ID. The changeset ID of the first
2269 % parent of the newly committed changeset.
2270 %\item[\texttt{parent2}] A changeset ID. The changeset ID of the second
2271 % parent of the newly committed changeset.
2272 %\end{itemize}
2273
2274 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
1979 \begin{itemize} 2275 \begin{itemize}
1980 \item[\texttt{node}] A changeset ID. The changeset ID of the newly 2276 \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K$38+$s$H$5$l$?%A%'%s%8%;%C(B
1981 committed changeset. 2277 $B%H$N(BID$B!%(B
1982 \item[\texttt{parent1}] A changeset ID. The changeset ID of the first 2278 \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K%3%_%C%H$5$l$?%A%'%s%8%;%C(B
1983 parent of the newly committed changeset. 2279 $B%H$N(B1$B$DL\$N?F$N%A%'%s%8%;%C%H(BID$B!%(B
1984 \item[\texttt{parent2}] A changeset ID. The changeset ID of the second 2280 \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K%3%_%C%H$5$l$?%A%'%s%8%;%C(B
1985 parent of the newly committed changeset. 2281 $B%H$N(B2$B$DL\$N?F$N%A%'%s%8%;%C%H(BID$B!%(B
1986 \end{itemize} 2282 \end{itemize}
1987 2283
1988 See also: \hook{precommit} (section~\ref{sec:hook:precommit}) 2284 %See also: \hook{precommit} (section~\ref{sec:hook:precommit})
2285 $B;29M!'(B\hook{precommit} (\ref{sec:hook:precommit}$B@a(B)
1989 2286
1990 %\subsection{\hook{preupdate}---before updating or merging working 2287 %\subsection{\hook{preupdate}---before updating or merging working
1991 %directory} 2288 %directory}
1992 \subsection{\hook{preupdate}---$B%o!<%-%s%0%G%#%l%/%H%j$N%"%C%W%G!<%H$^$?(B 2289 \subsection{\hook{preupdate}---$B%o!<%-%s%0%G%#%l%/%H%j$N%"%C%W%G!<%H$^$?(B
1993 $B$O%^!<%8$NA0$K(B} 2290 $B$O%^!<%8$NA0$K(B}
1994 \label{sec:hook:preupdate} 2291 \label{sec:hook:preupdate}
1995 2292
1996 This controlling hook is run before an update or merge of the working 2293 %This controlling hook is run before an update or merge of the working
1997 directory begins. It is run only if Mercurial's normal pre-update 2294 %directory begins. It is run only if Mercurial's normal pre-update
1998 checks determine that the update or merge can proceed. If the hook 2295 %checks determine that the update or merge can proceed. If the hook
1999 succeeds, the update or merge may proceed; if it fails, the update or 2296 %succeeds, the update or merge may proceed; if it fails, the update or
2000 merge does not start. 2297 %merge does not start.
2001 2298
2002 Parameters to this hook: 2299 $B$3$N@)8f%U%C%/$O%o!<%-%s%0%G%#%l%/%H%j$N%"%C%W%G!<%H$^$?$O%^!<%8$,;O$^$k(B
2300 $BA0$K<B9T$5$l$k!%(B Mercurial$B$NDL>o$N%"%C%W%G!<%HA0%A%'%C%/$,%"%C%W%G!<%H$^(B
2301 $B$?$O%^!<%8$r<B9T$G$-$k$HH=CG$7$?>l9g$K$N$_<B9T$5$l$k!%%U%C%/$N<B9T$,@.8y(B
2302 $B$7$?>l9g!$%"%C%W%G!<%H$^$?$O%^!<%8$,9T$o$l$k!%<:GT$7$?>l9g$O%"%C%W%G!<%H(B
2303 $B$^$?$O%^!<%8$O3+;O$5$l$J$$!%(B
2304
2305 %Parameters to this hook:
2306 %\begin{itemize}
2307 %\item[\texttt{parent1}] A changeset ID. The ID of the parent that the
2308 % working directory is to be updated to. If the working directory is
2309 % being merged, it will not change this parent.
2310 %\item[\texttt{parent2}] A changeset ID. Only set if the working
2311 % directory is being merged. The ID of the revision that the working
2312 % directory is being merged with.
2313 %\end{itemize}
2314
2315 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
2003 \begin{itemize} 2316 \begin{itemize}
2004 \item[\texttt{parent1}] A changeset ID. The ID of the parent that the 2317 \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$,%"%C%W(B
2005 working directory is to be updated to. If the working directory is 2318 $B%G!<%H$5$l$k?F(BID.$B%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8$5$l$k>l9g!$(B
2006 being merged, it will not change this parent. 2319 $B?F(BID$B$OJQ99$5$l$J$$!%(B
2007 \item[\texttt{parent2}] A changeset ID. Only set if the working 2320 \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8(B
2008 directory is being merged. The ID of the revision that the working 2321 $B$5$l$k>l9g$N$_%;%C%H$5$l$k!%%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8(B
2009 directory is being merged with. 2322 $B$5$l$k%j%S%8%g%s(BID$B!%(B
2010 \end{itemize} 2323 \end{itemize}
2011 2324
2012 See also: \hook{update} (section~\ref{sec:hook:update}) 2325 %See also: \hook{update} (section~\ref{sec:hook:update})
2326
2327 $B;29M!'(B \hook{update} (\ref{sec:hook:update}$B@a(B)
2013 2328
2014 %\subsection{\hook{tag}---after tagging a changeset} 2329 %\subsection{\hook{tag}---after tagging a changeset}
2015 \subsection{\hook{tag}---$B%A%'%s%8%;%C%H$K%?%0IU$1$7$?8e$K(B} 2330 \subsection{\hook{tag}---$B%A%'%s%8%;%C%H$K%?%0IU$1$7$?8e$K(B}
2016 \label{sec:hook:tag} 2331 \label{sec:hook:tag}
2017 2332
2018 This hook is run after a tag has been created. 2333 %This hook is run after a tag has been created.
2019 2334 $B$3$N%U%C%/$O%?%0$,@8@.$5$l$?8e$K<B9T$5$l$k!%(B
2020 Parameters to this hook: 2335
2336 %Parameters to this hook:
2337 %\begin{itemize}
2338 %\item[\texttt{local}] A boolean. Whether the new tag is local to this
2339 % repository instance (i.e.~stored in \sfilename{.hg/localtags}) or
2340 % managed by Mercurial (stored in \sfilename{.hgtags}).
2341 %\item[\texttt{node}] A changeset ID. The ID of the changeset that was
2342 % tagged.
2343 %\item[\texttt{tag}] A string. The name of the tag that was created.
2344 %\end{itemize}
2345
2346 $B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B
2021 \begin{itemize} 2347 \begin{itemize}
2022 \item[\texttt{local}] A boolean. Whether the new tag is local to this 2348 \item[\texttt{local}] $B%V!<%kCM!%?7$7$$%?%0$,%j%]%8%H%j%m!<%+%k$J$b$N(B
2023 repository instance (i.e.~stored in \sfilename{.hg/localtags}) or 2349 (\sfilename{.hg/localtags}$B$KJ]B8$5$l$k(B)$B$+(BMercurial$B$K4IM}(B
2024 managed by Mercurial (stored in \sfilename{.hgtags}). 2350 $B$5$l$k$b$N(B(\sfilename{.hgtags}$B$KJ]B8$5$l$k(B)$B$+$r<($9!%(B
2025 \item[\texttt{node}] A changeset ID. The ID of the changeset that was 2351 \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%%?%0IU$1$5$l$k%A%'%s%8%;%C%H$N(BID.
2026 tagged. 2352 \item[\texttt{tag}] $BJ8;zNs!%@8@.$5$l$?%?%0$NL>A0!%(B
2027 \item[\texttt{tag}] A string. The name of the tag that was created.
2028 \end{itemize} 2353 \end{itemize}
2029 2354
2030 If the created tag is revision-controlled, the \hook{commit} hook 2355 %If the created tag is revision-controlled, the \hook{commit} hook
2031 (section~\ref{sec:hook:commit}) is run before this hook. 2356 %(section~\ref{sec:hook:commit}) is run before this hook.
2032 2357
2033 See also: \hook{pretag} (section~\ref{sec:hook:pretag}) 2358 $B@8@.$5$l$?%?%0$,%j%S%8%g%s%3%s%H%m!<%k$5$l$F$$$k>l9g!$(B\hook{commit}$B%U%C(B
2359 $B%/(B(\ref{sec:hook:commit}$B@a(B)$B$O$3$N%U%C%/$NA0$K<B9T$5$l$k!%(B
2360
2361 %See also: \hook{pretag} (section~\ref{sec:hook:pretag})
2362
2363 $B;29M!'(B \hook{pretag} (\ref{sec:hook:pretag}$B@a(B)
2034 2364
2035 %\subsection{\hook{update}---after updating or merging working 2365 %\subsection{\hook{update}---after updating or merging working
2036 %directory} 2366 %directory}
2037 \subsection{\hook{update}---$B%o!<%-%s%0%G%#%l%/%H%j$r99?7$^$?$O%^!<%8$7$?(B 2367 \subsection{\hook{update}---$B%o!<%-%s%0%G%#%l%/%H%j$r99?7$^$?$O%^!<%8$7$?(B
2038 $B8e$K(B} 2368 $B8e$K(B}
2039 \label{sec:hook:update} 2369 \label{sec:hook:update}
2040 2370
2041 This hook is run after an update or merge of the working directory 2371 %This hook is run after an update or merge of the working directory
2042 completes. Since a merge can fail (if the external \command{hgmerge} 2372 %completes. Since a merge can fail (if the external \command{hgmerge}
2043 command fails to resolve conflicts in a file), this hook communicates 2373 %command fails to resolve conflicts in a file), this hook communicates
2044 whether the update or merge completed cleanly. 2374 %whether the update or merge completed cleanly.
2375
2376 $B$3$N%U%C%/$O%o!<%-%s%0%G%#%l%/%H%j$N%"%C%W%G!<%H$^$?$O%^!<%8$,40N;$7$?8e(B
2377 $B$K<B9T$5$l$k!%%^!<%8$O<:GT$9$k$3$H$b$"$k!J30It$N(B\command{hgmerge}$B%3%^%s%I(B
2378 $B$O%U%!%$%kFb$N%3%s%U%j%/%H$r2r7h$G$-$J$$$3$H$,$"$k!K$N$G!$$3$N%U%C%/$O%"%C(B
2379 $B%W%G!<%H$^$?$O%^!<%8$,@5>o$K40N;$7$?$+$I$&$+$rLd$$9g$o$;$k!%(B
2380
2381 %\begin{itemize}
2382 %\item[\texttt{error}] A boolean. Indicates whether the update or
2383 % merge completed successfully.
2384 %\item[\texttt{parent1}] A changeset ID. The ID of the parent that the
2385 % working directory was updated to. If the working directory was
2386 % merged, it will not have changed this parent.
2387 %\item[\texttt{parent2}] A changeset ID. Only set if the working
2388 % directory was merged. The ID of the revision that the working
2389 % directory was merged with.
2390 %\end{itemize}
2045 2391
2046 \begin{itemize} 2392 \begin{itemize}
2047 \item[\texttt{error}] A boolean. Indicates whether the update or 2393 \item[\texttt{error}] $B%V!<%kCM!%%"%C%W%G!<%H$^$?$O%^!<%8$,@5>o$K40N;$7$?(B
2048 merge completed successfully. 2394 $B$+$I$&$+$r<($9!%(B
2049 \item[\texttt{parent1}] A changeset ID. The ID of the parent that the 2395 \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$,%"%C%W(B
2050 working directory was updated to. If the working directory was 2396 $B%G!<%H$5$l$k?F(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8$5$l$k>l9g!$?F(B
2051 merged, it will not have changed this parent. 2397 ID$B$OJQ2=$7$J$$!%(Bxxx
2052 \item[\texttt{parent2}] A changeset ID. Only set if the working 2398 \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!%%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8(B
2053 directory was merged. The ID of the revision that the working 2399 $B$5$l$k;~$N$_%;%C%H$5$l$k!%%o!<%-%s%0%G%#%l%/%H%j$,%^!<%8$5$l(B
2054 directory was merged with. 2400 $B$k%j%S%8%g%s(BID$B!%(B
2055 \end{itemize} 2401 \end{itemize}
2056 2402
2057 See also: \hook{preupdate} (section~\ref{sec:hook:preupdate}) 2403 %See also: \hook{preupdate} (section~\ref{sec:hook:preupdate})
2404 $B;29M(B: \hook{preupdate} (\ref{sec:hook:preupdate}$B@a(B)
2058 2405
2059 %%% Local Variables: 2406 %%% Local Variables:
2060 %%% mode: yatex 2407 %%% mode: yatex
2061 %%% TeX-master: "00book" 2408 %%% TeX-master: "00book"
2062 %%% End: 2409 %%% End: