1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

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
This commit is contained in:
epriestley 2012-05-07 07:35:56 -07:00
parent 7b5f47b17d
commit 2d9d2f1aed
3 changed files with 4 additions and 2 deletions

View file

@ -86,7 +86,7 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod {
switch ($client) {
case 'arc':
$server_version = 3;
$server_version = 4;
switch ($client_version) {
case $server_version:
break;

View file

@ -431,6 +431,8 @@ abstract class DifferentialFieldSpecification {
* message, return true. If the authoritative value should always be used,
* return false. By default, fields can not be overwritten.
*
* arc will only attempt to overwrite field values if run with "--verbatim".
*
* @return bool True to indicate the field is save to overwrite.
* @task commit
*/

View file

@ -47,7 +47,7 @@ final class DifferentialRevisionIDFieldSpecification
}
public function renderValueForCommitMessage($is_edit) {
if ($is_edit || !$this->id) {
if (!$this->id) {
return null;
}
return PhabricatorEnv::getProductionURI('/D'.$this->id);