Fix filtering SVN commits by branch in the New Review Request page.

Review Request #5987 — Created June 12, 2014 and submitted

Information

Review Board
release-2.0.x
583b1d0...

Reviewers

The New Review Request page wasn't properly filtering commits by branch
for Subversion repositories. It was assuming it could start at a
revision and pass that to the equivalent of svn log. However, this
ended up picking up commits that existed on other branches as well.

The Repository Commits API for commits now accepts a branch= parameter,
which is the branch ID returned by the Repository Branches API. This is
passed through to get_commits(), which will then filter by that branch.

Through this, it's possible to properly limit the commits shown to those
on the branch. We'll also be able to make use of this later for other
repositories, if they suffer the same problem.

Set up a repository with different commits on different branches, and
some shared history.

Before this change, I was getting the wrong commits on different selected
branches.

After, I was seeing only the commits I'd expect, which matched what 'svn log'
was showing for those branches.

Description From Last Updated

this.options.branch should be URL-encoded here.

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/webapi/resources/repository_commits.py
        reviewboard/scmtools/svn/pysvn.py
        reviewboard/webapi/resources/repository_branches.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js
        reviewboard/static/rb/js/newReviewRequest/views/postCommitView.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/resources/models/repositoryModel.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/webapi/resources/repository_commits.py
        reviewboard/scmtools/svn/pysvn.py
        reviewboard/webapi/resources/repository_branches.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js
        reviewboard/static/rb/js/newReviewRequest/views/postCommitView.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/resources/models/repositoryModel.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    this.options.branch should be URL-encoded here.

  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/webapi/resources/repository_commits.py
        reviewboard/scmtools/svn/pysvn.py
        reviewboard/webapi/resources/repository_branches.py
      Ignored Files:
        reviewboard/static/rb/js/newReviewRequest/views/tests/postCommitViewTests.js
        reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js
        reviewboard/static/rb/js/newReviewRequest/views/postCommitView.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/resources/models/repositoryModel.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/webapi/resources/repository_commits.py
        reviewboard/scmtools/svn/pysvn.py
        reviewboard/webapi/resources/repository_branches.py
      Ignored Files:
        reviewboard/static/rb/js/newReviewRequest/views/tests/postCommitViewTests.js
        reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js
        reviewboard/static/rb/js/newReviewRequest/views/postCommitView.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/resources/models/repositoryModel.js
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (367fffe)