{"record":{"id":"2fede878fafc5cf3","repo":"phacility/phabricator","slug":"you-can-not-commandeer-this-revision-because-it-ha","errorCode":null,"errorMessage":"You can not commandeer this revision because it has already been closed. You can only commandeer open or abandoned revisions.","messagePattern":"You can not commandeer this revision because it has already been closed\\. You can only commandeer open or abandoned revisions\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/xaction/DifferentialRevisionCommandeerTransaction.php","lineNumber":75,"sourceCode":"    return $actor->getPHID();\n  }\n\n  public function applyInternalEffects($object, $value) {\n    $object->setAuthorPHID($value);\n  }\n\n  protected function validateAction($object, PhabricatorUser $viewer) {\n    // If a revision has already landed, we generally want to discourage\n    // reopening and reusing it since this tends to create a big mess (users\n    // should create a new revision instead). Thus, we stop you from\n    // commandeering closed revisions.\n\n    // See PHI985. If the revision was abandoned, there's no peril in allowing\n    // the commandeer since the change (likely) never actually landed. So\n    // it's okay to commandeer abandoned revisions.\n\n    if ($object->isClosed() && !$object->isAbandoned()) {\n      throw new Exception(\n        pht(\n          'You can not commandeer this revision because it has already '.\n          'been closed. You can only commandeer open or abandoned '.\n          'revisions.'));\n    }\n\n    if ($this->isViewerRevisionAuthor($object, $viewer)) {\n      throw new Exception(\n        pht(\n          'You can not commandeer this revision because you are already '.\n          'the author.'));\n    }\n  }\n\n  public function getTitle() {\n    return pht(\n      '%s commandeered this revision.',\n      $this->renderAuthor());","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/xaction/DifferentialRevisionCommandeerTransaction.php#L57-L93","documentation":"State guard inside DifferentialRevisionCommandeerTransaction::validateAction(): commandeer is refused because the revision is closed and not abandoned (isClosed && !isAbandoned), i.e. it was published/landed. The comments explain the policy: landed revisions should not be reopened and reused (users should create a new revision), but abandoned revisions are explicitly exempted (PHI985) because the change likely never landed, so commandeer remains available for them.","triggerScenarios":"Thrown at src/applications/differential/xaction/DifferentialRevisionCommandeerTransaction.php:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["If the revision was abandoned, commandeer is allowed; verify the status shown on the revision page","For landed (published) revisions, create a new revision for further work instead of commandeering the closed one","If the revision closed erroneously, address the closure (e.g. repository discovery issue) before attempting to commandeer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}