comparison rhodecode/controllers/pullrequests.py @ 2892:5fba3778431c beta

#590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs, That are far better for doing code reviews. The /compare url still uses bundle compare for full comparision including the incoming changesets. - Fixed tests
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 03 Oct 2012 18:41:57 +0200
parents 95923493de9a
children eb180eb16c18
comparison
equal deleted inserted replaced
2891:9812e617c564 2892:5fba3778431c
270 c.other_repo = other_repo 270 c.other_repo = other_repo
271 271
272 c.cs_ranges, discovery_data = PullRequestModel().get_compare_data( 272 c.cs_ranges, discovery_data = PullRequestModel().get_compare_data(
273 org_repo, org_ref, other_repo, other_ref 273 org_repo, org_ref, other_repo, other_ref
274 ) 274 )
275 if c.cs_ranges:
276 # case we want a simple diff without incoming changesets, just
277 # for review purposes. Make the diff on the forked repo, with
278 # revision that is common ancestor
279 other_ref = ('rev', c.cs_ranges[-1].parents[0].raw_id)
280 other_repo = org_repo
275 281
276 c.statuses = org_repo.statuses([x.raw_id for x in c.cs_ranges]) 282 c.statuses = org_repo.statuses([x.raw_id for x in c.cs_ranges])
277 # defines that we need hidden inputs with changesets 283 # defines that we need hidden inputs with changesets
278 c.as_form = request.GET.get('as_form', False) 284 c.as_form = request.GET.get('as_form', False)
279 285