Show More
@@ -338,15 +338,19 b' the supported syntax in ``issue_pat``, `' | |||||
338 | Hook management |
|
338 | Hook management | |
339 | --------------- |
|
339 | --------------- | |
340 |
|
340 | |||
341 |
|
|
341 | Custom Mercurial hooks can be managed in a similar way to that used in ``.hgrc`` files. | |
342 | To manage hooks, choose *Admin > Settings > Hooks*. |
|
342 | To manage hooks, choose *Admin > Settings > Hooks*. | |
343 |
|
343 | |||
344 | The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section. |
|
|||
345 |
|
||||
346 | To add another custom hook simply fill in the first textbox with |
|
344 | To add another custom hook simply fill in the first textbox with | |
347 | ``<name>.<hook_type>`` and the second with the hook path. Example hooks |
|
345 | ``<name>.<hook_type>`` and the second with the hook path. Example hooks | |
348 | can be found in ``kallithea.lib.hooks``. |
|
346 | can be found in ``kallithea.lib.hooks``. | |
349 |
|
347 | |||
|
348 | Kallithea will also use some hooks internally. They cannot be modified, but | |||
|
349 | some of them can be enabled or disabled in the *VCS* section. | |||
|
350 | ||||
|
351 | Kallithea has no support for custom Git hooks. Kallithea will install and use | |||
|
352 | Git hooks internally, and they might collide with manually installed hooks. | |||
|
353 | ||||
350 |
|
354 | |||
351 | Changing default encoding |
|
355 | Changing default encoding | |
352 | ------------------------- |
|
356 | ------------------------- |
@@ -225,8 +225,8 b' clear out your log file so that new erro' | |||||
225 | upgrade. |
|
225 | upgrade. | |
226 |
|
226 | |||
227 |
|
227 | |||
228 |
10. |
|
228 | 10. Reinstall internal Git repository hooks | |
229 | ------------------------------- |
|
229 | ------------------------------------------- | |
230 |
|
230 | |||
231 | It is possible that an upgrade involves changes to the Git hooks installed by |
|
231 | It is possible that an upgrade involves changes to the Git hooks installed by | |
232 | Kallithea. As these hooks are created inside the repositories on the server |
|
232 | Kallithea. As these hooks are created inside the repositories on the server |
@@ -43,12 +43,18 b' Troubleshooting' | |||||
43 | | |
|
43 | | | |
44 |
|
44 | |||
45 | :Q: **How can I use hooks in Kallithea?** |
|
45 | :Q: **How can I use hooks in Kallithea?** | |
46 | :A: It's easy if they are Python hooks: just use advanced link in |
|
46 | :A: If using Mercurial, use *Admin > Settings > Hooks* to install | |
47 | hooks section in Admin panel, that works only for Mercurial. If |
|
47 | global hooks. Inside the hooks, you can use the current working directory to | |
48 | you want to use Git hooks, just install th proper one in the repository, |
|
48 | control different behaviour for different repositories. | |
49 | e.g., create a file `/gitrepo/hooks/pre-receive`. You can also use |
|
49 | ||
50 | Kallithea-extensions to connect to callback hooks, for both Git |
|
50 | If using Git, install the hooks manually in each repository, for example by | |
51 | and Mercurial. |
|
51 | creating a file ``gitrepo/hooks/pre-receive``. | |
|
52 | Note that Kallithea uses the ``post-receive`` hook internally. | |||
|
53 | Kallithea will not work properly if another post-receive hook is installed instead. | |||
|
54 | You might also accidentally overwrite your own post-receive hook with the Kallithea hook. | |||
|
55 | ||||
|
56 | You can also use Kallithea-extensions to connect to callback hooks, | |||
|
57 | for both Git and Mercurial. | |||
52 |
|
58 | |||
53 | | |
|
59 | | | |
54 |
|
60 |
@@ -2,7 +2,7 b'' | |||||
2 | ${h.form(url('admin_settings_hooks'), method='post')} |
|
2 | ${h.form(url('admin_settings_hooks'), method='post')} | |
3 | <div class="form"> |
|
3 | <div class="form"> | |
4 | <div class="form-group"> |
|
4 | <div class="form-group"> | |
5 | <h4>${_('Custom Hooks')}</h4> |
|
5 | <h4>${_('Custom Global Mercurial Hooks')}</h4> | |
6 | <span class="help-block">${_('Hooks can be used to trigger actions on certain events such as push / pull. They can trigger Python functions or external applications.')}</span> |
|
6 | <span class="help-block">${_('Hooks can be used to trigger actions on certain events such as push / pull. They can trigger Python functions or external applications.')}</span> | |
7 | %for hook in c.custom_hooks: |
|
7 | %for hook in c.custom_hooks: | |
8 | <div class="form-group form-inline" id="${'id%s' % hook.ui_id }"> |
|
8 | <div class="form-group form-inline" id="${'id%s' % hook.ui_id }"> | |
@@ -37,6 +37,15 b'' | |||||
37 | </div> |
|
37 | </div> | |
38 | </div> |
|
38 | </div> | |
39 | ${h.end_form()} |
|
39 | ${h.end_form()} | |
|
40 | ||||
|
41 | <div class="form"> | |||
|
42 | <div class="form-group"> | |||
|
43 | <h4>${_('Git Hooks')}</h4> | |||
|
44 | <span class="help-block">${h.HTML(_('Kallithea has no support for custom Git hooks. Kallithea will use Git post-receive hooks internally. Installation of these hooks is managed in %s.')) % (h.literal('''<a href="%s">%s</a>''') % (h.url('admin_settings_mapping'), _('Remap and Rescan')))}</span> | |||
|
45 | </div> | |||
|
46 | ||||
|
47 | % else: | |||
|
48 | <h4>${_('Custom Hooks are not enabled')}</h4> | |||
40 | % endif |
|
49 | % endif | |
41 |
|
50 | |||
42 | <script> |
|
51 | <script> |
@@ -1,7 +1,7 b'' | |||||
1 | ${h.form(url('admin_settings'), method='post')} |
|
1 | ${h.form(url('admin_settings'), method='post')} | |
2 | <div class="form"> |
|
2 | <div class="form"> | |
3 | <div class="form-group"> |
|
3 | <div class="form-group"> | |
4 | <label class="control-label">${_('Hooks')}:</label> |
|
4 | <label class="control-label">${_('Mercurial Push Hooks')}:</label> | |
5 | <div> |
|
5 | <div> | |
6 | <div class="checkbox"> |
|
6 | <div class="checkbox"> | |
7 | <label> |
|
7 | <label> |
General Comments 0
You need to be logged in to leave comments.
Login now