Tighten up some of the interdiff file mapping logic.

Review Request #4142 — Created May 12, 2013 and submitted — Latest diff uploaded

Information

Review Board
release-1.7.x

Reviewers

Tighten up some of the interdiff file mapping logic.

We have a long-standing bug where, sometimes, an interdiff will have
problems when there's a file changed in one revision of a diff and then
reverted in another. While it's supposed to show that file as reverted,
this didn't always happen.

We determine that a file should be shown as reverted if we store the
force_interdiff flag for that file (which is based on there being an
interdiffset object). We seem to do that pretty reliably, yet it
sometimes screws up anyway.

The only thing I can think of is that we were comparing against None
incorrectly. Perhaps in some weird corner case, the comparison was
providing the incorrect result. Now, we use "is not" instead of "!=" for
this comparison.

I've also changed the logic to use generators where possible. Should
be more efficient (though barely).
Interdiffs still work correctly here. I could not reproduce the original
problem.
    Loading...