@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.

Update utility "bin/repository parents" workflow to work with RefPosition

Summary:
Ref T11823. I think this is the last callsite which relies on the old data format: `bin/repository parents` rebuilds a cache which we don't currently use very heavily.

Update it to work with the new data.

Test Plan: Ran `bin/repository parents <repository> --trace`, saw successful script execution and reasonable-looking output.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11823

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

+17 -16
+17 -16
src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php
··· 54 54 ->setViewer($this->getViewer()) 55 55 ->withRefTypes(array(PhabricatorRepositoryRefCursor::TYPE_BRANCH)) 56 56 ->withRepositoryPHIDs(array($repo->getPHID())) 57 + ->needPositions(true) 57 58 ->execute(); 58 59 59 60 $graph = array(); ··· 66 67 "%s\n", 67 68 pht('Rebuilding branch "%s"...', $ref->getRefName())); 68 69 69 - $commit = $ref->getCommitIdentifier(); 70 + foreach ($ref->getPositionIdentifiers() as $commit) { 71 + if ($repo->isGit()) { 72 + $stream = new PhabricatorGitGraphStream($repo, $commit); 73 + } else { 74 + $stream = new PhabricatorMercurialGraphStream($repo, $commit); 75 + } 70 76 71 - if ($repo->isGit()) { 72 - $stream = new PhabricatorGitGraphStream($repo, $commit); 73 - } else { 74 - $stream = new PhabricatorMercurialGraphStream($repo, $commit); 75 - } 76 - 77 - $discover = array($commit); 78 - while ($discover) { 79 - $target = array_pop($discover); 80 - if (isset($graph[$target])) { 81 - continue; 82 - } 83 - $graph[$target] = $stream->getParents($target); 84 - foreach ($graph[$target] as $parent) { 85 - $discover[] = $parent; 77 + $discover = array($commit); 78 + while ($discover) { 79 + $target = array_pop($discover); 80 + if (isset($graph[$target])) { 81 + continue; 82 + } 83 + $graph[$target] = $stream->getParents($target); 84 + foreach ($graph[$target] as $parent) { 85 + $discover[] = $parent; 86 + } 86 87 } 87 88 } 88 89 }