1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-20 19:51:08 +01:00

Add "mark committed" action to the web UI

Summary: When a revision is accepted, allow users to manually mark it committed if there's a daemon/tracking problem. This shouldn't happen in most installs but we have less-robust support for Mercurial and some installs may not be fully configured.

Test Plan: Marked a revision committed.

Reviewers: btrahan, Makinde

Reviewed By: Makinde

CC: aran, epriestley

Maniphest Tasks: T948

Differential Revision: https://secure.phabricator.com/D1808
This commit is contained in:
epriestley 2012-03-07 09:47:31 -08:00
parent 84d2f5fcad
commit 62f18914db
3 changed files with 11 additions and 1 deletions

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -72,6 +72,7 @@ final class DifferentialAction {
self::ACTION_RESIGN => 'Resign as Reviewer', self::ACTION_RESIGN => 'Resign as Reviewer',
self::ACTION_ADDREVIEWERS => 'Add Reviewers', self::ACTION_ADDREVIEWERS => 'Add Reviewers',
self::ACTION_ADDCCS => 'Add CCs', self::ACTION_ADDCCS => 'Add CCs',
self::ACTION_COMMIT => 'Mark Committed',
); );
if (!empty($verbs[$action])) { if (!empty($verbs[$action])) {

View file

@ -445,6 +445,7 @@ class DifferentialRevisionViewController extends DifferentialController {
$actions[DifferentialAction::ACTION_ABANDON] = true; $actions[DifferentialAction::ACTION_ABANDON] = true;
$actions[DifferentialAction::ACTION_REQUEST] = true; $actions[DifferentialAction::ACTION_REQUEST] = true;
$actions[DifferentialAction::ACTION_RETHINK] = true; $actions[DifferentialAction::ACTION_RETHINK] = true;
$actions[DifferentialAction::ACTION_COMMIT] = true;
break; break;
case ArcanistDifferentialRevisionStatus::COMMITTED: case ArcanistDifferentialRevisionStatus::COMMITTED:
break; break;

View file

@ -320,6 +320,14 @@ class DifferentialCommentEditor {
break; break;
case DifferentialAction::ACTION_COMMIT: case DifferentialAction::ACTION_COMMIT:
// TODO: We allow this from any state because the daemons are
// considered authoritative. However, this technically means that anyone
// can mark anything committed at any time with the right POST.
// Ideally we should set a flag on the editor to tell it whether it
// should enforce the web workflow rules (actor must be author and
// state must be 'accepted') or the daemon workflow rules (no rules).
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED); ->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED);
break; break;