Page MenuHomePhabricator

Differential - refine selecting a repository diff --> revision workflow
ClosedPublic

Authored by btrahan on Nov 19 2014, 1:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 4:27 PM
Unknown Object (File)
Thu, Dec 19, 4:27 PM
Unknown Object (File)
Thu, Dec 19, 4:27 PM
Unknown Object (File)
Thu, Dec 19, 4:27 PM
Unknown Object (File)
Thu, Dec 19, 4:27 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Subscribers

Details

Summary

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.

Test Plan
  • 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 3093
Build 3099: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

btrahan retitled this revision from to Differential - refine selecting a repository diff --> revision workflow.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
src/applications/differential/editor/DifferentialTransactionEditor.php
214–219

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.

epriestley edited edge metadata.

One inline.

src/applications/differential/controller/DifferentialDiffCreateController.php
68

I'd expect this parameter to need to be array($repository_phid), I think.

This revision is now accepted and ready to land.Nov 19 2014, 6:54 PM
btrahan edited edge metadata.

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.)

This revision was automatically updated to reflect the committed changes.