Page MenuHomePhabricator

Mark moved files as unchanged
AbandonedPublic

Authored by epriestley on Jan 22 2015, 9:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 3:58 AM
Unknown Object (File)
Thu, Nov 14, 5:22 AM
Unknown Object (File)
Sat, Nov 2, 4:57 PM
Unknown Object (File)
Oct 20 2024, 9:59 AM
Unknown Object (File)
Oct 15 2024, 2:01 AM
Unknown Object (File)
Oct 9 2024, 1:32 PM
Unknown Object (File)
Oct 9 2024, 1:31 PM
Unknown Object (File)
Oct 9 2024, 1:17 PM
Subscribers

Details

Summary

Fixes T6857. It appears that this was broken in D10865. Basically, if a file has been moved then we should mark it as unchanged.

Test Plan

before (744×1 px, 100 KB)

after (744×1 px, 79 KB)

Diff Detail

Event Timeline

joshuaspence retitled this revision from to Mark moved files as unchanged.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added reviewers: epriestley, btrahan.
epriestley edited edge metadata.

We need to start adding test coverage when we change diff rendering, this code is really complex/fragile and there are a lot of unintended effects and regressions, especially around these shields. Notably, this is fixing some kind of regression or fallout.

differential/__tests__/ has some ability to do rendering tests, via DifferentialChangesetOneUpTestRenderer and DifferentialChangesetTwoUpTestRenderer. I'm not sure if it supports shields yet -- but if not, we should expand the test renderers so they do. Basically, I think we're within striking distance of being able to get reasonable test coverage on this stuff, and it's fragile enough that we should do it before continuing to make rendering changes.

This revision now requires changes to proceed.Jan 22 2015, 8:10 PM

(If it's a ton of work I'm happy to do the legwork to make the tests writable, but my recollection is that the test stuff was in fairly good shape, just never got pushed the last mile.)

I just had a quick look at the code and must admit that I have no idea how this stuff works. I'll probably have a chance to figure it out in more detail over the weekend, but if you had some thoughts on how to go about testing this, that would be helpful too.

Sure, let me see if I can write some sort of similar test case and fill in whatever gaps we're missing.

Im finding the screenshots confusing since they aren't of the same thing, but apologies for however I broke this.

src/applications/differential/parser/DifferentialChangesetParser.php
609

files can be moved and then changed in their new location.

Im finding the screenshots confusing since they aren't of the same thing, but apologies for however I broke this.

Oops yeah, they are completely unrelated... let me amend my test plan.

joshuaspence edited edge metadata.
joshuaspence added inline comments.
src/applications/differential/parser/DifferentialChangesetParser.php
609

Yes, but in this case we show the changes in the new location rather than the old location right?

src/applications/differential/parser/DifferentialChangesetParser.php
609

I don't really know the implications of changing the $unchanged variable here, other than logically it could be false in this case. :/

src/applications/differential/parser/DifferentialChangesetParser.php
609

Neither... I'm happy to wait until we add some tests.

epriestley edited reviewers, added: joshuaspence; removed: epriestley.

I rolled this into D11970 with coverage, although I think the "broken" behavior is better so I retained it (although maybe I'm not quite understanding). In either case, moves-with-changes and moves-without-changes seem to do reasonable things now, and have test coverage.