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

Allow "Differential Revision ID" field appear on create/edit messages

Summary:
- In practice, 'edit' has two modes, 'create' and 'edit'. These seem like they should map to "create a revision" and "update a revision", but they are completely different.
- We use the "create" mode:
- When creating a message from the working copy.
- When creating a message from a file.
- When creating a message from a commit.
- When creating a message from a user template.
- When creating a message from an "--edit"!
- We use the "edit" mode:
- ONLY when updating a revision with `arc diff --verbatim`.
- The only difference is in which fields may be overwritten. Under "create", all fields may be overwritten. Under "edit", only safe fields may be overwritten.
- The "Differential Revision" field currently does not render in either edit mode. This is wrong. Even though it can not be updated in the "edit" mode, it should still render in both modes. This is the only material change this revision makes.
- Without this change, when we "create" a new message from a working copy and the working copy has a "Differential Revision" field, we incorrectly discard it.
- The only field which does not render on edit modes now is "Reviewed by" (not "Reviewers"), which is correct, since we do not read the value.

Test Plan: Ran "arc diff" to create/update revisions. Ran "arc diff --verbatim" to create/update revisions with implicit edits (with D2411). Ran "arc diff --edit" to update revisions with explicit edits.

Reviewers: jungejason, btrahan

Reviewed by: jungejason

CC: vrana, aran

Differential Revision: https://secure.phabricator.com/D2412

+4 -2
+1 -1
src/applications/conduit/method/conduit/connect/ConduitAPI_conduit_connect_Method.php
··· 86 86 87 87 switch ($client) { 88 88 case 'arc': 89 - $server_version = 3; 89 + $server_version = 4; 90 90 switch ($client_version) { 91 91 case $server_version: 92 92 break;
+2
src/applications/differential/field/specification/base/DifferentialFieldSpecification.php
··· 431 431 * message, return true. If the authoritative value should always be used, 432 432 * return false. By default, fields can not be overwritten. 433 433 * 434 + * arc will only attempt to overwrite field values if run with "--verbatim". 435 + * 434 436 * @return bool True to indicate the field is save to overwrite. 435 437 * @task commit 436 438 */
+1 -1
src/applications/differential/field/specification/revisionid/DifferentialRevisionIDFieldSpecification.php
··· 47 47 } 48 48 49 49 public function renderValueForCommitMessage($is_edit) { 50 - if ($is_edit || !$this->id) { 50 + if (!$this->id) { 51 51 return null; 52 52 } 53 53 return PhabricatorEnv::getProductionURI('/D'.$this->id);