diff --git a/rhodecode/lib/middleware/simplevcs.py b/rhodecode/lib/middleware/simplevcs.py --- a/rhodecode/lib/middleware/simplevcs.py +++ b/rhodecode/lib/middleware/simplevcs.py @@ -45,6 +45,7 @@ from rhodecode.lib.middleware.utils impo from rhodecode.lib.utils import ( is_valid_repo, get_rhodecode_realm, get_rhodecode_base_path) from rhodecode.lib.utils2 import safe_str, fix_PATH, str2bool +from rhodecode.lib.vcs.conf import settings as vcs_settings from rhodecode.model import meta from rhodecode.model.db import User, Repository from rhodecode.model.scm import ScmModel @@ -429,8 +430,8 @@ class SimpleVCS(object): def _prepare_callback_daemon(self, extras): return prepare_callback_daemon( - extras, protocol=self.config.get('vcs.hooks.protocol'), - use_direct_calls=self.config.get('vcs.hooks.direct_calls')) + extras, protocol=vcs_settings.HOOKS_PROTOCOL, + use_direct_calls=vcs_settings.HOOKS_DIRECT_CALLS) def _should_check_locking(query_string): diff --git a/rhodecode/lib/vcs/conf/settings.py b/rhodecode/lib/vcs/conf/settings.py --- a/rhodecode/lib/vcs/conf/settings.py +++ b/rhodecode/lib/vcs/conf/settings.py @@ -49,6 +49,9 @@ ARCHIVE_SPECS = { 'zip': ('application/zip', '.zip'), } +HOOKS_PROTOCOL = None +HOOKS_DIRECT_CALLS = False + PYRO_PORT = 9900 PYRO_GIT = 'git_remote' diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -31,7 +31,6 @@ import datetime from pylons.i18n.translation import _ from pylons.i18n.translation import lazy_ugettext -import rhodecode from rhodecode.lib import helpers as h, hooks_utils, diffs from rhodecode.lib.compat import OrderedDict from rhodecode.lib.hooks_daemon import prepare_callback_daemon @@ -41,13 +40,14 @@ from rhodecode.lib.utils import action_l from rhodecode.lib.utils2 import safe_unicode, safe_str, md5_safe from rhodecode.lib.vcs.backends.base import ( Reference, MergeResponse, MergeFailureReason) +from rhodecode.lib.vcs.conf import settings as vcs_settings from rhodecode.lib.vcs.exceptions import ( CommitDoesNotExistError, EmptyRepositoryError) from rhodecode.model import BaseModel from rhodecode.model.changeset_status import ChangesetStatusModel from rhodecode.model.comment import ChangesetCommentsModel from rhodecode.model.db import ( - PullRequest, PullRequestReviewers, Notification, ChangesetStatus, + PullRequest, PullRequestReviewers, ChangesetStatus, PullRequestVersion, ChangesetComment) from rhodecode.model.meta import Session from rhodecode.model.notification import NotificationModel, \ @@ -423,12 +423,11 @@ class PullRequestModel(BaseModel): } workspace_id = self._workspace_id(pull_request) - protocol = rhodecode.CONFIG.get('vcs.hooks.protocol') - use_direct_calls = rhodecode.CONFIG.get('vcs.hooks.direct_calls') use_rebase = self._use_rebase_for_merging(pull_request) callback_daemon, extras = prepare_callback_daemon( - extras, protocol=protocol, use_direct_calls=use_direct_calls) + extras, protocol=vcs_settings.HOOKS_PROTOCOL, + use_direct_calls=vcs_settings.HOOKS_DIRECT_CALLS) with callback_daemon: # TODO: johbo: Implement a clean way to run a config_override