• 
      

    Fix fetching files that were introduced in a parent diff.

    Review Request #11156 — Created Sept. 1, 2020 and submitted

    Information

    Review Board
    release-3.0.x

    Reviewers

    The new code for properly storing information on a parent file and
    fetching it didn't work correctly when the file was created in the
    parent diff. get_original_file() was checking if the FileDiff was
    new, which would have worked with the older logic because we'd transfer
    over the parent revision to the FileDiff. With the new logic, it
    didn't know that the file was new, and tried fetching it, failing in the
    process.

    This change fixes this by checking the parent revision to see if the
    file was newly-introduced. If it is, no file is fetched.

    There's also a small fix to patching to provide the correct filename.
    This is only used for logging purposes and generating files in a patch
    error bundle.

    Unit tests passed (and verified it fixed some issues found when trying
    to merge in to release-4.0.x with some newer tests there).

    Successfully posted a change with a file introduced in a parent diff.

    Summary ID
    Fix fetching files that were introduced in a parent diff.
    The new code for properly storing information on a parent file and fetching it didn't work correctly when the file was created in the parent diff. `get_original_file()` was checking if the `FileDiff` was new, which would have worked with the older logic because we'd transfer over the parent revision to the `FileDiff`. With the new logic, it didn't know that the file was new, and tried fetching it, failing in the process. This change fixes this by checking the parent revision to see if the file was newly-introduced. If it is, no file is fetched. There's also a small fix to patching to provide the correct filename. This is only used for logging purposes and generating files in a patch error bundle.
    6fbb17f2fc8264afbcb84db73732783c294979da
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.0.x (43a0e64)