diff --git a/kallithea/alembic/versions/7ba0d2cad930_hooks_migrate_internal_hooks_to_.py b/kallithea/alembic/versions/7ba0d2cad930_hooks_migrate_internal_hooks_to_.py
new file mode 100644
--- /dev/null
+++ b/kallithea/alembic/versions/7ba0d2cad930_hooks_migrate_internal_hooks_to_.py
@@ -0,0 +1,57 @@
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+"""hooks: migrate internal hooks to kallithea namespace
+
+Revision ID: 7ba0d2cad930
+Revises: f62826179f39
+Create Date: 2021-01-11 00:10:13.576586
+
+"""
+
+# The following opaque hexadecimal identifiers ("revisions") are used
+# by Alembic to track this migration script and its relations to others.
+revision = '7ba0d2cad930'
+down_revision = 'f62826179f39'
+branch_labels = None
+depends_on = None
+
+from alembic import op
+from sqlalchemy import MetaData, Table
+
+from kallithea.model import db
+
+
+meta = MetaData()
+
+
+def upgrade():
+ meta.bind = op.get_bind()
+ ui = Table(db.Ui.__tablename__, meta, autoload=True)
+
+ ui.update(values={
+ 'ui_key': 'changegroup.kallithea_update',
+ 'ui_value': 'python:', # value in db isn't used
+ }).where(ui.c.ui_key == 'changegroup.update').execute()
+ ui.update(values={
+ 'ui_key': 'changegroup.kallithea_repo_size',
+ 'ui_value': 'python:', # value in db isn't used
+ }).where(ui.c.ui_key == 'changegroup.repo_size').execute()
+
+ # 642847355a10 moved these hooks out of db - remove old entries
+ ui.delete().where(ui.c.ui_key == 'changegroup.push_logger').execute()
+ ui.delete().where(ui.c.ui_key == 'outgoing.pull_logger').execute()
+
+
+def downgrade():
+ pass
diff --git a/kallithea/bin/vcs_hooks.py b/kallithea/bin/vcs_hooks.py
--- a/kallithea/bin/vcs_hooks.py
+++ b/kallithea/bin/vcs_hooks.py
@@ -48,7 +48,7 @@ log = logging.getLogger(__name__)
def repo_size(ui, repo, hooktype=None, **kwargs):
"""Show size of Mercurial repository.
- Called as Mercurial hook changegroup.repo_size after push.
+ Called as Mercurial hook changegroup.kallithea_repo_size after push.
"""
size_hg, size_root = get_scm_size('.hg', safe_str(repo.root))
@@ -69,7 +69,7 @@ def update(ui, repo, hooktype=None, **kw
"""Update repo after push. The equivalent to 'hg update' but using the same
Mercurial as everything else.
- Called as Mercurial hook changegroup.update after push.
+ Called as Mercurial hook changegroup.kallithea_update after push.
"""
try:
ui.pushbuffer(error=True, subproc=True)
diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py
--- a/kallithea/controllers/admin/settings.py
+++ b/kallithea/controllers/admin/settings.py
@@ -100,10 +100,10 @@ class SettingsController(base.BaseContro
# HOOKS
sett = db.Ui.get_by_key('hooks', db.Ui.HOOK_UPDATE)
- sett.ui_active = form_result['hooks_changegroup_update']
+ sett.ui_active = form_result['hooks_changegroup_kallithea_update']
sett = db.Ui.get_by_key('hooks', db.Ui.HOOK_REPO_SIZE)
- sett.ui_active = form_result['hooks_changegroup_repo_size']
+ sett.ui_active = form_result['hooks_changegroup_kallithea_repo_size']
## EXTENSIONS
sett = db.Ui.get_or_create('extensions', 'largefiles')
diff --git a/kallithea/model/db.py b/kallithea/model/db.py
--- a/kallithea/model/db.py
+++ b/kallithea/model/db.py
@@ -330,8 +330,8 @@ class Ui(meta.Base, BaseDbModel):
_table_args_default_dict,
)
- HOOK_UPDATE = 'changegroup.update'
- HOOK_REPO_SIZE = 'changegroup.repo_size'
+ HOOK_UPDATE = 'changegroup.kallithea_update'
+ HOOK_REPO_SIZE = 'changegroup.kallithea_repo_size'
ui_id = Column(Integer(), primary_key=True)
ui_section = Column(String(255), nullable=False)
diff --git a/kallithea/model/forms.py b/kallithea/model/forms.py
--- a/kallithea/model/forms.py
+++ b/kallithea/model/forms.py
@@ -384,8 +384,8 @@ def ApplicationUiSettingsForm():
v.ValidPath(),
v.UnicodeString(strip=True, min=1, not_empty=True)
)
- hooks_changegroup_update = v.StringBoolean(if_missing=False)
- hooks_changegroup_repo_size = v.StringBoolean(if_missing=False)
+ hooks_changegroup_kallithea_update = v.StringBoolean(if_missing=False)
+ hooks_changegroup_kallithea_repo_size = v.StringBoolean(if_missing=False)
extensions_largefiles = v.StringBoolean(if_missing=False)
extensions_hggit = v.StringBoolean(if_missing=False)
diff --git a/kallithea/templates/admin/settings/settings_vcs.html b/kallithea/templates/admin/settings/settings_vcs.html
--- a/kallithea/templates/admin/settings/settings_vcs.html
+++ b/kallithea/templates/admin/settings/settings_vcs.html
@@ -5,13 +5,13 @@ ${h.form(url('admin_settings'), method='