{"record":{"id":"e59bb85c882871a6","repo":"phacility/phabricator","slug":"you-can-not-abandon-this-revision-because-it-has-a","errorCode":null,"errorMessage":"You can not abandon this revision because it has already been closed. Only open revisions can be abandoned.","messagePattern":"You can not abandon this revision because it has already been closed\\. Only open revisions can be abandoned\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php","lineNumber":60,"sourceCode":"    return array();\n  }\n\n  public function getCommandSummary() {\n    return pht('Abandon a revision.');\n  }\n\n  public function generateOldValue($object) {\n    return $object->isAbandoned();\n  }\n\n  public function applyInternalEffects($object, $value) {\n    $status_abandoned = DifferentialRevisionStatus::ABANDONED;\n    $object->setModernRevisionStatus($status_abandoned);\n  }\n\n  protected function validateAction($object, PhabricatorUser $viewer) {\n    if ($object->isClosed()) {\n      throw new Exception(\n        pht(\n          'You can not abandon this revision because it has already been '.\n          'closed. Only open revisions can be abandoned.'));\n    }\n\n    $config_key = 'differential.always-allow-abandon';\n    if (!PhabricatorEnv::getEnvConfig($config_key)) {\n      if (!$this->isViewerRevisionAuthor($object, $viewer)) {\n        throw new Exception(\n          pht(\n            'You can not abandon this revision because you are not the '.\n            'author. You can only abandon revisions you own. You can change '.\n            'this behavior by adjusting the \"%s\" setting in Config.',\n            $config_key));\n      }\n    }\n  }\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php#L42-L78","documentation":"State-machine guard inside DifferentialRevisionAbandonTransaction::validateAction(): the abandon transaction refuses to apply when the target revision is already in a closed status (published or abandoned). Abandon is only a valid transition from an open revision, so by the time this editor validation runs the revision's status is terminal and the abandon workflow cannot proceed.","triggerScenarios":"Thrown at src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the revision's current status on the revision page before abandoning; if it was already abandoned or published no action is needed","If the revision was closed by landing a commit and you want further work, create a new revision instead of reopening the closed one","If you believe the revision was closed in error, an administrator can investigate the revision transaction history to see which transaction closed it"],"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"}