Page MenuHomePhabricator

Implement viewing versions and downloading patches in Phragment
ClosedPublic

Authored by hach-que on Dec 7 2013, 6:07 AM.
Tags
None
Referenced Files
F18888114: D7734.diff
Fri, Nov 7, 7:00 AM
F18857040: D7734.id.diff
Sat, Nov 1, 12:51 PM
F18852695: D7734.diff
Fri, Oct 31, 11:26 AM
F18835820: D7734.id17479.diff
Sun, Oct 26, 7:06 PM
F18821230: D7734.id17491.diff
Oct 22 2025, 8:41 PM
F18804251: D7734.id17491.diff
Oct 18 2025, 7:00 AM
F18803855: D7734.id17491.diff
Oct 18 2025, 4:18 AM
F18783581: D7734.id17479.diff
Oct 13 2025, 8:15 AM

Details

Summary

This adds support for viewing individual versions on a fragment as well as comparing versions and downloading diff_match_patch-based patches.

It does not use the side-by-side diff format as while it works for small changes, it quickly becomes impossible to distingush what changes have been made due to the diff_match_patch format.

Test Plan

Clicked on versions and downloaded patches.

Diff Detail

Branch
phragment-view-versions
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

epriestley added inline comments.
src/applications/phragment/controller/PhragmentPatchController.php
17–23

This seems weird. I'd expect the URIs to look like:

/patch/a/b/ (patch from a -> b)
/patch/b/ (patch from null -> b)

Is there a compelling reason not to just make the second component optional, and drop this x magic?

The main reason for that format is that you're not omitting the last version; you're omitting the first version. So having "null -> b" in the format of just /version/b/ is a bit weird in my opinion.

I think that's reasonable, but there's no way anyone could ever guess /x/ is the magical incantation to omit a source. They could reasonably guess /b/, or a less-surprsing string like /null/, maybe. We could also flip it to be /b/a/ instead of /a/b/, and then /b/ is just a shortening, rather than a skip. This leaves the two-arg case with an unintuitive order, though.