Changeset - b45e9fd75ac0
[Not reviewed]
codereview
0 2 0
Marcin Kuzminski - 13 years ago 2012-06-11 23:10:34
marcin@python-works.com
data checks
2 files changed with 19 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/compare.py
Show inline comments
 
@@ -65,12 +65,16 @@ class CompareController(BaseRepoControll
 
        c.other_repo = other_repo = Repository.get_by_repo_name(other_repo)
 

	
 
        if c.org_repo is None or c.other_repo is None:
 
            log.error('Could not found repo %s or %s' % (org_repo, other_repo))
 
            raise HTTPNotFound
 

	
 
        if c.org_repo.scm_instance.alias != 'hg':
 
            log.error('Review not available for GIT REPOS')
 
            raise HTTPNotFound
 

	
 
        c.cs_ranges, discovery_data = PullRequestModel().get_compare_data(
 
                                       org_repo, org_ref, other_repo, other_ref
 
                                      )
 

	
 
        c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in
 
                                                   c.cs_ranges])
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -75,12 +75,17 @@ class PullrequestsController(BaseRepoCon
 
        c.pull_requests = PullRequestModel().get_all(repo_name)
 
        c.repo_name = repo_name
 
        return render('/pullrequests/pullrequest_show_all.html')
 

	
 
    def index(self):
 
        org_repo = c.rhodecode_db_repo
 

	
 
        if org_repo.scm_instance.alias != 'hg':
 
            log.error('Review not available for GIT REPOS')
 
            raise HTTPNotFound
 

	
 
        c.org_refs = self._get_repo_refs(c.rhodecode_repo)
 
        c.org_repos = []
 
        c.other_repos = []
 
        c.org_repos.append((org_repo.repo_name, '%s/%s' % (
 
                                org_repo.user.username, c.repo_name))
 
                           )
 
@@ -98,13 +103,12 @@ class PullrequestsController(BaseRepoCon
 
            c.default_pull_request = org_repo.parent.repo_name
 
            c.other_repos.append((org_repo.parent.repo_name, '%s/%s' % (
 
                                        org_repo.parent.user.username,
 
                                        org_repo.parent.repo_name))
 
                                     )
 

	
 
        #TODO: maybe the owner should be default ?
 
        c.review_members = []
 
        c.available_members = []
 
        for u in User.query().filter(User.username != 'default').all():
 
            uname = u.username
 
            if org_repo.user == u:
 
                uname = _('%s (owner)' % u.username)
 
@@ -189,12 +193,21 @@ class PullrequestsController(BaseRepoCon
 
    def show(self, repo_name, pull_request_id):
 
        repo_model = RepoModel()
 
        c.users_array = repo_model.get_users_js()
 
        c.users_groups_array = repo_model.get_users_groups_js()
 
        c.pull_request = PullRequest.get(pull_request_id)
 

	
 
        # valid ID
 
        if not c.pull_request:
 
            raise HTTPNotFound
 

	
 
        # pull_requests repo_name we opened it against
 
        # ie. other_repo must match
 
        if repo_name != c.pull_request.other_repo.repo_name:
 
            raise HTTPNotFound
 

	
 
        # load compare data into template context
 
        self._load_compare_data(c.pull_request)
 

	
 
        # inline comments
 
        c.inline_cnt = 0
 
        c.inline_comments = ChangesetCommentsModel()\
 
@@ -258,7 +271,7 @@ class PullrequestsController(BaseRepoCon
 
        if comm:
 
            c.co = comm
 
            data.update(comm.get_dict())
 
            data.update({'rendered_text':
 
                         render('changeset/changeset_comment_block.html')})
 

	
 
        return data
 
\ No newline at end of file
 
        return data
0 comments (0 inline, 0 general)