1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

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
This commit is contained in:
epriestley 2017-09-15 09:22:26 -07:00
parent 8982e3e52d
commit 49b7181780

View file

@ -54,6 +54,7 @@ final class PhabricatorRepositoryManagementParentsWorkflow
->setViewer($this->getViewer()) ->setViewer($this->getViewer())
->withRefTypes(array(PhabricatorRepositoryRefCursor::TYPE_BRANCH)) ->withRefTypes(array(PhabricatorRepositoryRefCursor::TYPE_BRANCH))
->withRepositoryPHIDs(array($repo->getPHID())) ->withRepositoryPHIDs(array($repo->getPHID()))
->needPositions(true)
->execute(); ->execute();
$graph = array(); $graph = array();
@ -66,8 +67,7 @@ final class PhabricatorRepositoryManagementParentsWorkflow
"%s\n", "%s\n",
pht('Rebuilding branch "%s"...', $ref->getRefName())); pht('Rebuilding branch "%s"...', $ref->getRefName()));
$commit = $ref->getCommitIdentifier(); foreach ($ref->getPositionIdentifiers() as $commit) {
if ($repo->isGit()) { if ($repo->isGit()) {
$stream = new PhabricatorGitGraphStream($repo, $commit); $stream = new PhabricatorGitGraphStream($repo, $commit);
} else { } else {
@ -86,6 +86,7 @@ final class PhabricatorRepositoryManagementParentsWorkflow
} }
} }
} }
}
$console->writeOut( $console->writeOut(
"%s\n", "%s\n",