Fixes T6200. Ref T6237. When creating a diff from the web view, allow the user to select the repository at that time. When viewing a diff that has no associated revision and then creating a revision, pass along the repository phid to the create revision controller. Within the create revision controller, default the repository selector to this repository phid. Finally, in the editor, stop aggressively resetting the repository phid for every TYPE_UPDATE; rather, do so if its not a new object -- the diff should reign supreme in that case -- or if there's no repository -- let the diff be the guide.
Details
- Reviewers
epriestley - Maniphest Tasks
- T6237: Use ApplicationTransactions properly in Diff creation
T6200: Inconsistency in revision history vs state - Commits
- Restricted Diffusion Commit
rP7ef236c9a647: Differential - refine selecting a repository diff --> revision workflow
- made a diff with an associated repo, made a revision from the diff, saw the associated repo and it stuck on save!
- made a diff with an associated repo, made a revision from the diff but changed the repo and it stuck on save!
- made a diff with an associated repo, made a revision from the diff but changed the repo to nothing and it stuck on save!
Diff Detail
- Repository
- rP Phabricator
- Branch
- T6200
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 3091 Build 3097: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
src/applications/differential/editor/DifferentialTransactionEditor.php | ||
---|---|---|
208–210 ↗ | (On Diff #26110) | sigh, just realized this bit won't work while I was making dinner per the issue you pointed out prior... One fix that WILL work is to simply have the custom field transactions come AFTER the TYPE_UPDATE transaction. The repository custom field will thus set this correctly 100% of the time. I don't like the brittleness there though of needing transactions in a certain order... but at least it works unlike this bit! |
My idea to make this work failed but here it is anyway with some comments explaining how come it failed.
I guess I need to manually process the repository custom field here as well, and update the diff to have the value that the user selected.
actually make it work. Introduce a setRepositoryPHIDOverride to the editor that makes it so.
One inline.
src/applications/differential/controller/DifferentialDiffCreateController.php | ||
---|---|---|
66 | I'd expect this parameter to need to be array($repository_phid), I think. |
allow the user to select no repository at all from diff create and have that be respected all the way through
wrap $repository_phid in an array. (not sure how come this was working...? still works with this fix.)