##// END OF EJS Templates
fixes #20 hg middleware breaks ui() instance when repository has hgrc file....
marcink -
r385:eda5f01d default
parent child Browse files
Show More
@@ -2,7 +2,7 b''
2 2 # encoding: utf-8
3 3 # middleware to handle mercurial api calls
4 4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
5 #
6 6 # This program is free software; you can redistribute it and/or
7 7 # modify it under the terms of the GNU General Public License
8 8 # as published by the Free Software Foundation; version 2
@@ -17,14 +17,6 b''
17 17 # along with this program; if not, write to the Free Software
18 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 19 # MA 02110-1301, USA.
20
21 """
22 Created on 2010-04-28
23
24 @author: marcink
25 SimpleHG middleware for handling mercurial protocol request (push/clone etc.)
26 It's implemented with basic auth function
27 """
28 20 from datetime import datetime
29 21 from itertools import chain
30 22 from mercurial.error import RepoError
@@ -35,7 +27,7 b' from paste.httpheaders import REMOTE_USE'
35 27 from pylons_app.lib.auth import authfunc, HasPermissionAnyMiddleware, \
36 28 get_user_cached
37 29 from pylons_app.lib.utils import is_mercurial, make_ui, invalidate_cache, \
38 check_repo_fast
30 check_repo_fast, ui_sections
39 31 from pylons_app.model import meta
40 32 from pylons_app.model.db import UserLog, User
41 33 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
@@ -43,6 +35,14 b' import logging'
43 35 import os
44 36 import pylons_app.lib.helpers as h
45 37 import traceback
38
39 """
40 Created on 2010-04-28
41
42 @author: marcink
43 SimpleHG middleware for handling mercurial protocol request (push/clone etc.)
44 It's implemented with basic auth function
45 """
46 46
47 47 log = logging.getLogger(__name__)
48 48
@@ -226,8 +226,25 b' class SimpleHg(object):'
226 226 hgrc = os.path.join(self.repo_path, '.hg', 'hgrc')
227 227 repoui = make_ui('file', hgrc, False)
228 228
229
229 230 if repoui:
230 #set the repository based config
231 hgserve.repo.ui = repoui
231 #overwrite our ui instance with the section from hgrc file
232 for section in ui_sections:
233 for k, v in repoui.configitems(section):
234 hgserve.repo.ui.setconfig(section, k, v)
232 235
233 236 return hgserve
237
238
239
240
241
242
243
244
245
246
247
248
249
250
General Comments 0
You need to be logged in to leave comments. Login now