{"record":{"id":"da73d8ceb7abbd06","repo":"phacility/phabricator","slug":"mercurial-repository-has-no-new-or-old-heads-for-b","errorCode":null,"errorMessage":"Mercurial repository has no new or old heads for branch \"%s\" after push. This makes no sense; rejecting change.","messagePattern":"Mercurial repository has no new or old heads for branch \"(.+?)\" after push\\. This makes no sense; rejecting change\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/engine/DiffusionCommitHookEngine.php","lineNumber":807,"sourceCode":"    list($err, $old_raw) = $futures['old']->resolve();\n    $old_refs = $this->parseMercurialHeads($old_raw);\n\n    list($err, $new_raw) = $futures['new']->resolve();\n    $new_refs = $this->parseMercurialHeads($new_raw);\n\n    $all_refs = array_keys($old_refs + $new_refs);\n\n    $ref_updates = array();\n    foreach ($all_refs as $ref) {\n      $old_heads = idx($old_refs, $ref, array());\n      $new_heads = idx($new_refs, $ref, array());\n\n      sort($old_heads);\n      sort($new_heads);\n\n      if (!$old_heads && !$new_heads) {\n        // This should never be possible, as it makes no sense. Explode.\n        throw new Exception(\n          pht(\n            'Mercurial repository has no new or old heads for branch \"%s\" '.\n            'after push. This makes no sense; rejecting change.',\n            $ref));\n      }\n\n      if ($old_heads === $new_heads) {\n        // No changes to this branch, so skip it.\n        continue;\n      }\n\n      $stray_heads = array();\n      $head_map = array();\n\n      if ($old_heads && !$new_heads) {\n        // This is a branch deletion with \"--close-branch\".\n        foreach ($old_heads as $old_head) {\n          $head_map[$old_head] = array(self::EMPTY_HASH);","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/engine/DiffusionCommitHookEngine.php#L789-L825","documentation":"Error \"Mercurial repository has no new or old heads for branch \"%s\" after push. This makes no sense; rejecting change.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:807 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}