<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 12/05/2016 à 18:23, Konstantin
Veretennicov a écrit :<br>
</div>
<blockquote
cite="mid:CAHA=1V21vSBehcTud7R_xBemosT5AS1JGJSyxNfDi_KZiHBZyg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p dir="ltr"><br>
On May 12, 2016 10:36 AM, "Nicolas Pinault" <<a
moz-do-not-send="true" href="mailto:nicolasp@aaton.com"><a class="moz-txt-link-abbreviated" href="mailto:nicolasp@aaton.com">nicolasp@aaton.com</a></a>>
wrote:<br>
><br>
><br>
>> In Admin/Settings/Hooks, I tried the following
configurations without success :<br>
>> - changegroup.my_script python
c:/Kallithea/Bin/my_script.py<br>
><br>
> This syntax is the correct one and works perfectly.<br>
> My error was that the cwd used is not the Bin directory of
Kallithea but the repo directory. That made my script not work.</p>
<p dir="ltr">Glad you figured it out and thanks for sharing.</p>
<p dir="ltr">Was the mistake difficult to diagnose? Do you think
Kallithea could make it easier to debug this kind of issues?</p>
</blockquote>
I think documentation could be improved.<br>
<br>
Please note that I use Kallithea with Mercurial.<br>
For my tests, I created a small Python script which write a simple
log in a file. I though this file would be located in Kallithea
binary directory as its path is "./log.txt". In fact it was located
in repository directory. It took me some time to realize it.<br>
Maybe the documentation should notice it.<br>
<br>
I used the following link for documentation :
<a class="moz-txt-link-freetext" href="https://pythonhosted.org/Kallithea/setup.html">https://pythonhosted.org/Kallithea/setup.html</a> "Hook management"
section.<br>
The "<<code class="docutils literal"><span class="pre">name>.<hook_type></span></code>"
assertion is either false or misleading. I think it should be
replaced with "<hook_type>.<name>" as the first part of
the hook description is the Mercurial hook type.<br>
Also specifying the following may be helpful :<br>
- The "<name>" part can be whatever we want (are there
character restrictions ?) and is just a description (a reminder).<br>
- "<hook_type>.<name>" must be unique <br>
- "<hook_type> must be a Mercurial hook type. These can be
found here : <a class="moz-txt-link-freetext" href="https://selenic.com/hg/help/hgrc">https://selenic.com/hg/help/hgrc</a><br>
- Mercurial hook "arguments" like "$HG_NODE" are set in process
environment variables by Kallithea before calling the hook.<br>
- Kallithea sets an environment variable called "$KALLITHEA_EXTRAS"
before calling the hook. This is especially useful to get the
repository name in the hook process.<br>
<br>
I have seen no trace in the console output noticing the execution of
the hook. There might be a log somewhere but I have not found any
log file anywhere. <br>
<br>
Example hook descriptions might me helpful.<br>
<br>
Hope this helps.<br>
<br>
Regards,<br>
Nicolas<br>
<blockquote
cite="mid:CAHA=1V21vSBehcTud7R_xBemosT5AS1JGJSyxNfDi_KZiHBZyg@mail.gmail.com"
type="cite">
<p dir="ltr">--<br>
Regards,<br>
Konstantin</p>
<p dir="ltr">><br>
><br>
> Nicolas<br>
><br>
> _______________________________________________<br>
> kallithea-general mailing list<br>
> <a moz-do-not-send="true"
href="mailto:kallithea-general@sfconservancy.org">kallithea-general@sfconservancy.org</a><br>
> <a moz-do-not-send="true"
href="http://lists.sfconservancy.org/mailman/listinfo/kallithea-general">http://lists.sfconservancy.org/mailman/listinfo/kallithea-general</a><br>
</p>
</blockquote>
<br>
<p><br>
</p>
<div class="moz-signature">-- <br>
<font face="arial" size="1">
<font color="0096ff">
<b>
Nicolas PINAULT<br>
R&D electronics engineer<br>
</b></font><b>
</b>
<a href="mailto:nicolas@aaton.com">nicolas@aaton.com</a><br>
<br>
<font color="0096ff">
<b>AATON-Digital</b><br>
</font>
38000 Grenoble - France<br>
Tel +33 4 7642 9550<br>
<br>
<a href="http://www.aaton.com">http://www.aaton.com</a><br>
<a href="http://www.transvideo.eu">http://www.transvideo.eu</a><br>
French Technologies for Film and Digital Cinematography<br>
<br>
Follow us on Twitter<br>
@Aaton_Digital<br>
@Transvideo_HD<br>
<br>
Like us on Facebook<br>
<a href="https://www.facebook.com/AatonDigital">https://www.facebook.com/AatonDigital</a><br>
<br>
</font></div>
</body>
</html>