diff options
author | Milo Casagrande <milo@ubuntu.com> | 2013-04-05 11:51:13 +0200 |
---|---|---|
committer | Milo Casagrande <milo@ubuntu.com> | 2013-04-05 11:51:13 +0200 |
commit | f10be2e07cb59c01eca14e0508521737f04358a1 (patch) | |
tree | ff30760c98e6e7ba8bd1a428dc499e5686cafe21 | |
parent | 70e2ec0ee8aa0812d8a97f4adf16fbb48f76599a (diff) | |
parent | 80a7850ba89c17f9ea538954a835f8b4efd9e2da (diff) |
Merged fix for dumb http, fixed conflicts.
-rw-r--r-- | rhodecode/controllers/admin/settings.py | 1 | ||||
-rw-r--r-- | rhodecode/lib/db_manage.py | 4 | ||||
-rw-r--r-- | rhodecode/lib/middleware/pygrack.py | 14 |
3 files changed, 10 insertions, 9 deletions
diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py index 712d6534..858e412e 100644 --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -299,6 +299,7 @@ class SettingsController(BaseController): sett.ui_key = 'dumbgit' sett.ui_section = 'extensions' + sett.ui_value = form_result[_f('extensions_dumbgit')] sett.ui_active = form_result[_f('extensions_dumbgit')] Session().add(sett) diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py index 7b7c0224..8dcc6162 100644 --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -260,8 +260,7 @@ class DbManage(object): dumbgit.ui_key = 'dumbgit' dumbgit.ui_value = '' dumbgit.ui_active = False - Session().ad(dumbgit) - RhodeCodeSetting('dumbgit', False) + Session().add(dumbgit) notify('re-check default permissions') default_user = User.get_by_username(User.DEFAULT_USER) @@ -494,7 +493,6 @@ class DbManage(object): dumbgit.ui_section = 'extensions' dumbgit.ui_key = 'dumbgit' dumbgit.ui_value = '' - dumbgit.ui_active = False self.sa.add(dumbgit) def create_ldap_options(self, skip_existing=False): diff --git a/rhodecode/lib/middleware/pygrack.py b/rhodecode/lib/middleware/pygrack.py index 2db161e4..5fce811d 100644 --- a/rhodecode/lib/middleware/pygrack.py +++ b/rhodecode/lib/middleware/pygrack.py @@ -7,7 +7,7 @@ import traceback from webob import Request, Response, exc from rhodecode.lib import subprocessio -from rhodecode.model.db import RhodeCodeSetting +from rhodecode.model.db import RhodeCodeUi from rhodecode.lib.utils2 import str2bool log = logging.getLogger(__name__) @@ -46,7 +46,7 @@ class GitRepository(object): def __init__(self, repo_name, content_path, extras): files = set([f.lower() for f in os.listdir(content_path)]) - if not (self.git_folder_signature.intersection(files) + if not (self.git_folder_signature.intersection(files) == self.git_folder_signature): raise OSError('%s missing git signature' % content_path) self.content_path = content_path @@ -55,9 +55,11 @@ class GitRepository(object): c for c in self.commands] self.repo_name = repo_name self.extras = extras - # TODO: work-around for LP bug 1163317. - # self.dumb = str2bool(RhodeCodeSetting.get_by_name(key='extensions_dumbgit')) - self.dumb = True + self.dumb = str2bool(RhodeCodeUi.get_by_key('dumbgit').ui_value) + if self.dumb is True: + log.info('Using dumb HTTP git protocol') + else: + log.info('Using smart HTTP git protocol') def _get_fixedpath(self, path): """ @@ -77,7 +79,7 @@ class GitRepository(object): if self.dumb: git_path = self._get_fixedpath(request.path_info) filename = os.path.join(self.content_path, git_path) - if os.path.isfile(filename): + if os.path.isfile(filename): out = open(filename) content_type = 'text/plain' content_length = os.path.getsize(filename) |