##// END OF EJS Templates
config: Use hooks protocol and direc calls seting from vcs settings module.
Martin Bornhold -
r590:cb08eb7b default
parent child Browse files
Show More
@@ -45,6 +45,7 b' from rhodecode.lib.middleware.utils impo'
45 from rhodecode.lib.utils import (
45 from rhodecode.lib.utils import (
46 is_valid_repo, get_rhodecode_realm, get_rhodecode_base_path)
46 is_valid_repo, get_rhodecode_realm, get_rhodecode_base_path)
47 from rhodecode.lib.utils2 import safe_str, fix_PATH, str2bool
47 from rhodecode.lib.utils2 import safe_str, fix_PATH, str2bool
48 from rhodecode.lib.vcs.conf import settings as vcs_settings
48 from rhodecode.model import meta
49 from rhodecode.model import meta
49 from rhodecode.model.db import User, Repository
50 from rhodecode.model.db import User, Repository
50 from rhodecode.model.scm import ScmModel
51 from rhodecode.model.scm import ScmModel
@@ -429,8 +430,8 b' class SimpleVCS(object):'
429
430
430 def _prepare_callback_daemon(self, extras):
431 def _prepare_callback_daemon(self, extras):
431 return prepare_callback_daemon(
432 return prepare_callback_daemon(
432 extras, protocol=self.config.get('vcs.hooks.protocol'),
433 extras, protocol=vcs_settings.HOOKS_PROTOCOL,
433 use_direct_calls=self.config.get('vcs.hooks.direct_calls'))
434 use_direct_calls=vcs_settings.HOOKS_DIRECT_CALLS)
434
435
435
436
436 def _should_check_locking(query_string):
437 def _should_check_locking(query_string):
@@ -49,6 +49,9 b' ARCHIVE_SPECS = {'
49 'zip': ('application/zip', '.zip'),
49 'zip': ('application/zip', '.zip'),
50 }
50 }
51
51
52 HOOKS_PROTOCOL = None
53 HOOKS_DIRECT_CALLS = False
54
52 PYRO_PORT = 9900
55 PYRO_PORT = 9900
53
56
54 PYRO_GIT = 'git_remote'
57 PYRO_GIT = 'git_remote'
@@ -31,7 +31,6 b' import datetime'
31 from pylons.i18n.translation import _
31 from pylons.i18n.translation import _
32 from pylons.i18n.translation import lazy_ugettext
32 from pylons.i18n.translation import lazy_ugettext
33
33
34 import rhodecode
35 from rhodecode.lib import helpers as h, hooks_utils, diffs
34 from rhodecode.lib import helpers as h, hooks_utils, diffs
36 from rhodecode.lib.compat import OrderedDict
35 from rhodecode.lib.compat import OrderedDict
37 from rhodecode.lib.hooks_daemon import prepare_callback_daemon
36 from rhodecode.lib.hooks_daemon import prepare_callback_daemon
@@ -41,13 +40,14 b' from rhodecode.lib.utils import action_l'
41 from rhodecode.lib.utils2 import safe_unicode, safe_str, md5_safe
40 from rhodecode.lib.utils2 import safe_unicode, safe_str, md5_safe
42 from rhodecode.lib.vcs.backends.base import (
41 from rhodecode.lib.vcs.backends.base import (
43 Reference, MergeResponse, MergeFailureReason)
42 Reference, MergeResponse, MergeFailureReason)
43 from rhodecode.lib.vcs.conf import settings as vcs_settings
44 from rhodecode.lib.vcs.exceptions import (
44 from rhodecode.lib.vcs.exceptions import (
45 CommitDoesNotExistError, EmptyRepositoryError)
45 CommitDoesNotExistError, EmptyRepositoryError)
46 from rhodecode.model import BaseModel
46 from rhodecode.model import BaseModel
47 from rhodecode.model.changeset_status import ChangesetStatusModel
47 from rhodecode.model.changeset_status import ChangesetStatusModel
48 from rhodecode.model.comment import ChangesetCommentsModel
48 from rhodecode.model.comment import ChangesetCommentsModel
49 from rhodecode.model.db import (
49 from rhodecode.model.db import (
50 PullRequest, PullRequestReviewers, Notification, ChangesetStatus,
50 PullRequest, PullRequestReviewers, ChangesetStatus,
51 PullRequestVersion, ChangesetComment)
51 PullRequestVersion, ChangesetComment)
52 from rhodecode.model.meta import Session
52 from rhodecode.model.meta import Session
53 from rhodecode.model.notification import NotificationModel, \
53 from rhodecode.model.notification import NotificationModel, \
@@ -423,12 +423,11 b' class PullRequestModel(BaseModel):'
423 }
423 }
424
424
425 workspace_id = self._workspace_id(pull_request)
425 workspace_id = self._workspace_id(pull_request)
426 protocol = rhodecode.CONFIG.get('vcs.hooks.protocol')
427 use_direct_calls = rhodecode.CONFIG.get('vcs.hooks.direct_calls')
428 use_rebase = self._use_rebase_for_merging(pull_request)
426 use_rebase = self._use_rebase_for_merging(pull_request)
429
427
430 callback_daemon, extras = prepare_callback_daemon(
428 callback_daemon, extras = prepare_callback_daemon(
431 extras, protocol=protocol, use_direct_calls=use_direct_calls)
429 extras, protocol=vcs_settings.HOOKS_PROTOCOL,
430 use_direct_calls=vcs_settings.HOOKS_DIRECT_CALLS)
432
431
433 with callback_daemon:
432 with callback_daemon:
434 # TODO: johbo: Implement a clean way to run a config_override
433 # TODO: johbo: Implement a clean way to run a config_override
General Comments 0
You need to be logged in to leave comments. Login now