comparison rhodecode/controllers/changeset.py @ 2391:91fae60bf2b6 codereview

merge with beta
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 05 Jun 2012 21:22:23 +0200
parents e5c0f201ca0b bc2d8c03c050
children ad19dfcdb1cc
comparison
equal deleted inserted replaced
2364:9d61aad859bc 2391:91fae60bf2b6
38 from rhodecode.lib.vcs.nodes import FileNode 38 from rhodecode.lib.vcs.nodes import FileNode
39 39
40 import rhodecode.lib.helpers as h 40 import rhodecode.lib.helpers as h
41 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator 41 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
42 from rhodecode.lib.base import BaseRepoController, render 42 from rhodecode.lib.base import BaseRepoController, render
43 from rhodecode.lib.utils import EmptyChangeset 43 from rhodecode.lib.utils import EmptyChangeset, action_logger
44 from rhodecode.lib.compat import OrderedDict 44 from rhodecode.lib.compat import OrderedDict
45 from rhodecode.lib import diffs 45 from rhodecode.lib import diffs
46 from rhodecode.model.db import ChangesetComment, ChangesetStatus 46 from rhodecode.model.db import ChangesetComment, ChangesetStatus
47 from rhodecode.model.comment import ChangesetCommentsModel 47 from rhodecode.model.comment import ChangesetCommentsModel
48 from rhodecode.model.changeset_status import ChangesetStatusModel 48 from rhodecode.model.changeset_status import ChangesetStatusModel
49 from rhodecode.model.meta import Session 49 from rhodecode.model.meta import Session
50 from rhodecode.lib.diffs import wrapped_diff 50 from rhodecode.lib.diffs import wrapped_diff
51 from rhodecode.model.repo import RepoModel
51 52
52 log = logging.getLogger(__name__) 53 log = logging.getLogger(__name__)
53 54
54 55
55 def _update_with_GET(params, GET): 56 def _update_with_GET(params, GET):
164 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 165 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
165 'repository.admin') 166 'repository.admin')
166 def __before__(self): 167 def __before__(self):
167 super(ChangesetController, self).__before__() 168 super(ChangesetController, self).__before__()
168 c.affected_files_cut_off = 60 169 c.affected_files_cut_off = 60
170 repo_model = RepoModel()
171 c.users_array = repo_model.get_users_js()
172 c.users_groups_array = repo_model.get_users_groups_js()
169 173
170 def index(self, revision): 174 def index(self, revision):
171 175
172 c.anchor_url = anchor_url 176 c.anchor_url = anchor_url
173 c.ignorews_url = _ignorews_url 177 c.ignorews_url = _ignorews_url
389 revision, 393 revision,
390 status, 394 status,
391 c.rhodecode_user.user_id, 395 c.rhodecode_user.user_id,
392 comm, 396 comm,
393 ) 397 )
398 action_logger(self.rhodecode_user,
399 'user_commented_revision:%s' % revision,
400 c.rhodecode_db_repo, self.ip_addr, self.sa)
394 401
395 Session.commit() 402 Session.commit()
403
396 if not request.environ.get('HTTP_X_PARTIAL_XHR'): 404 if not request.environ.get('HTTP_X_PARTIAL_XHR'):
397 return redirect(h.url('changeset_home', repo_name=repo_name, 405 return redirect(h.url('changeset_home', repo_name=repo_name,
398 revision=revision)) 406 revision=revision))
399 407
400 data = { 408 data = {