# HG changeset patch # User Mads Kiilerich # Date 2020-11-03 12:45:29 # Node ID 94a21c71df91588b85d57d18abe31683675f53ac # Parent 9b7c5d7ad1a2613ab0d8cabf7e39c3b0b0af9d53 hooks: always use the right repo size hook - don't rely on the value in the database diff --git a/kallithea/lib/db_manage.py b/kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py +++ b/kallithea/lib/db_manage.py @@ -245,7 +245,7 @@ class DbManage(object): ('paths', '/', repo_root_path, True), #('phases', 'publish', 'false', False) ('hooks', db.Ui.HOOK_UPDATE, 'hg update >&2', False), - ('hooks', db.Ui.HOOK_REPO_SIZE, 'python:kallithea.lib.hooks.repo_size', True), + ('hooks', db.Ui.HOOK_REPO_SIZE, 'python:', True), # the actual value doesn't matter ('extensions', 'largefiles', '', True), ('largefiles', 'usercache', os.path.join(repo_root_path, '.cache', 'largefiles'), True), ('extensions', 'hggit', '', False), diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -335,6 +335,8 @@ def make_ui(repo_path=None): # push / pull hooks baseui.setconfig(b'hooks', b'changegroup.kallithea_log_push_action', b'python:kallithea.lib.hooks.log_push_action') baseui.setconfig(b'hooks', b'outgoing.kallithea_log_pull_action', b'python:kallithea.lib.hooks.log_pull_action') + if baseui.config(b'hooks', ascii_bytes(db.Ui.HOOK_REPO_SIZE)): # ignore actual value + baseui.setconfig(b'hooks', ascii_bytes(db.Ui.HOOK_REPO_SIZE), b'python:kallithea.lib.hooks.repo_size') if repo_path is not None: # Note: MercurialRepository / mercurial.localrepo.instance will do this too, so it will always be possible to override db settings or what is hardcoded above