Fix creating a new review request from the first committed change

Review Request #5321 — Created Jan. 24, 2014 and submitted

Information

Review Board
master

Reviewers

Creating a new review request from committed change by selecting the first/root commit in a linked GitHub repository failed because the root commit has no parents. This raised a SCMError when trying to fetch the "compare two commits" API.

The fix is to check if "parent_revision" is empty before trying to fetch "compare two commits". If "parent_revision" is empty, it fetches the root commit itself.

  • Manually created new review requests for a root commit with 1 changed file and for multiple changed files, and verified that "View Diff" listed the expected changes (for both a private and a public GitHub repository).
  • Ran unit tests.
david
  1. This looks good to me. Thanks for your detailed change description :)

  2. 
      
anselina
Review request changed
Status:
Completed
Change Summary:
Pushed to master (7baff93). Thanks!