• 
      

    Properly generate parent diffs in git

    Review Request #5825 — Created May 14, 2014 and submitted — Latest diff uploaded

    Information

    RBTools
    release-0.6.x
    8647517...

    Reviewers

    The old behavior was to only populate the 'parent_base' attribute
    if the 'base' of the review range did not show up with
    git branch -r --contains <base>

    This fails for many common environments (such as having pushed to
    your private github repository prior to posting the review).
    Presumably, the assumption that was made is that if the base is
    present on a remote branch, it must be already available to
    Review Board. With distributed version-control systems, this is
    not a safe assumption to make.

    With this change, we will always look up the merge base and
    compare it to the review base. If they are different, we will pass
    along the parent_base so that the parent diff can be generated
    correctly.

    1) Set up a series of patches that depended on one another. (Patch 2 depends on changes from patch 1)
    2) Pushed the patches to a remote git repository
    3) Ran 'rbt post patch1:patch2'

    Previous behavior:
    The file was not found in the repository (HTTP 400, API Error 207)

    Behavior after this patch:
    Review was properly uploaded.