@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Attach Diff to Revision: fix Repository asked twice

Summary:
If you manually upload a Diff (patch) from the Differential web
interface you can select the Repository.

We fix the default value of the Repository field during creation mode,
guessing the repo from the potentially already-available diff.

Closes T15537

Test Plan:
- Create a cute Differential Revision from web
- Pick a Repository > Continue
- Create a new Revision > Continue

At this point you should still have that repository instead of nothing.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15537

Differential Revision: https://we.phorge.it/D25338

+8 -2
+8 -2
src/applications/differential/editor/DifferentialRevisionEditEngine.php
··· 189 189 190 190 // Don't show the "Author" field when creating a revision using the web 191 191 // workflow, since it adds more noise than signal to this workflow. 192 - if ($this->getIsCreate()) { 192 + if ($is_create) { 193 193 $author_field->setIsHidden(true); 194 194 } 195 195 ··· 239 239 ->setConduitTypeDescription(pht('New reviewers.')) 240 240 ->setValue($object->getReviewerPHIDsForEdit()); 241 241 242 + // Prefill Repository for example when coming from "Attach To". 243 + $repository_phid = $object->getRepositoryPHID(); 244 + if ($is_create && !$repository_phid && $diff) { 245 + $repository_phid = $diff->getRepositoryPHID(); 246 + } 247 + 242 248 $fields[] = id(new PhabricatorDatasourceEditField()) 243 249 ->setKey('repositoryPHID') 244 250 ->setLabel(pht('Repository')) ··· 248 254 ->setDescription(pht('The repository the revision belongs to.')) 249 255 ->setConduitDescription(pht('Change the repository for this revision.')) 250 256 ->setConduitTypeDescription(pht('New repository.')) 251 - ->setSingleValue($object->getRepositoryPHID()); 257 + ->setSingleValue($repository_phid); 252 258 253 259 // This is a little flimsy, but allows "Maniphest Tasks: ..." to continue 254 260 // working properly in commit messages until we fully sort out T5873.