Skip to content

Commit

Permalink
[api] request "addrevision" option is using unexpanded revision when …
Browse files Browse the repository at this point in the history
…"updatelink" option is used
  • Loading branch information
adrianschroeter committed May 12, 2015
1 parent 46b82c7 commit f152e0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions ReleaseNotes-2.7
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Changes on purpose:

* Users are allowed to add themself in their home project, even when they got removed.
Admins should use the user state and set them to "locked" when they do want to block them.
* request "addrevision" option is using unexpanded revision when "updatelink" option is used

Incompatible changes:
=====================
Expand Down
3 changes: 2 additions & 1 deletion src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,8 @@ def check_for_expand_errors!(add_revision)

# validate that the sources are not broken
begin
query = { expand: 1 }
query = {}
query[:expand] = "1" unless self.updatelink
query[:rev] = self.source_rev if self.source_rev
# FIXM2.4 we have a Directory model
url = Package.source_path(self.source_project, self.source_package, nil, query)
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,7 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
<description>SUBMIT</description>
<state who='Iggy' name='new'/>
</request>"
post '/request?cmd=create', req
post '/request?cmd=create&addrevision=1', req
assert_response :success
assert_xml_tag(:tag => 'request')
node = Xmlhash.parse(@response.body)
Expand Down

0 comments on commit f152e0c

Please sign in to comment.