Changeset - 2c0208bd686b
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-01-31 23:27:21
madski@unity3d.com
pull request: shuffle different-repo and hg-git conditionals around, no code change
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/pull_request.py
Show inline comments
 
@@ -169,12 +169,15 @@ class PullRequestModel(BaseModel):
 
        :param other_repo:
 
        :param other_ref:
 
        :param tmp:
 
        """
 

	
 
        changesets = []
 

	
 
        if alias == 'hg':
 

	
 
        #case two independent repos
 
        if org_repo != other_repo:
 
            revs = [
 
                org_repo._repo.lookup(org_ref[1]),
 
                org_repo._repo.lookup(other_ref[1]),
 
            ]
 
@@ -191,15 +194,15 @@ class PullRequestModel(BaseModel):
 
            # in case we have revisions filter out the ones not in given range
 
            if org_ref[0] == 'rev' and other_ref[0] == 'rev':
 
                revs = [x.raw_id for x in changesets]
 
                start = org_ref[1]
 
                stop = other_ref[1]
 
                changesets = changesets[revs.index(start):revs.index(stop) + 1]
 
        else:
 

	
 
            #no remote compare do it on the same repository
 
            if alias == 'hg':
 
            else:
 
                _revset_predicates = {
 
                        'branch': 'branch',
 
                        'book': 'bookmark',
 
                        'tag': 'tag',
 
                        'rev': 'id',
 
                    }
 
@@ -211,13 +214,15 @@ class PullRequestModel(BaseModel):
 
                   )
 
                ]
 

	
 
                out = scmutil.revrange(org_repo._repo, revs)
 
                for cs in (out):
 
                    changesets.append(org_repo.get_changeset(cs))
 

	
 
            elif alias == 'git':
 
            assert org_repo == other_repo, (org_repo, other_repo) # no git support for different repos
 
                so, se = org_repo.run_git_command(
 
                    'log --reverse --pretty="format: %%H" -s -p %s..%s' % (org_ref[1],
 
                                                                     other_ref[1])
 
                )
 
                ids = re.findall(r'[0-9a-fA-F]{40}', so)
 
                for cs in (ids):
0 comments (0 inline, 0 general)