@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve handling of bad branches in Diffusion

Summary:
Fixes T7972.

- Trap the RefNotFound error which may occur in `getAlternatives()`.
- Improve error handling in Mercurial.

Test Plan: {F387611}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7972

Differential Revision: https://secure.phabricator.com/D12590

+10 -1
+4
src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
··· 204 204 // unclear how to best do that. For now, treat it as a miss instead. 205 205 continue; 206 206 } 207 + if (preg_match('/unknown revision/', $ex->getStdErr())) { 208 + // No matches for this ref. 209 + continue; 210 + } 207 211 throw $ex; 208 212 } 209 213
+6 -1
src/applications/diffusion/request/DiffusionRequest.php
··· 755 755 756 756 public function getRefAlternatives() { 757 757 // Make sure we've resolved the reference into a stable commit first. 758 - $this->getStableCommit(); 758 + try { 759 + $this->getStableCommit(); 760 + } catch (DiffusionRefNotFoundException $ex) { 761 + // If we have a bad reference, just return the empty set of 762 + // alternatives. 763 + } 759 764 return $this->refAlternatives; 760 765 } 761 766