Differential D21715 Diff 51754 src/applications/repository/daemon/PhabricatorMercurialGraphStream.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/daemon/PhabricatorMercurialGraphStream.php
Show All 10 Lines | final class PhabricatorMercurialGraphStream | ||||
private $repository; | private $repository; | ||||
private $iterator; | private $iterator; | ||||
private $parents = array(); | private $parents = array(); | ||||
private $dates = array(); | private $dates = array(); | ||||
private $local = array(); | private $local = array(); | ||||
private $localParents = array(); | private $localParents = array(); | ||||
public function __construct(PhabricatorRepository $repository, $commit) { | public function __construct(PhabricatorRepository $repository, | ||||
$start_commit = null) { | |||||
$this->repository = $repository; | $this->repository = $repository; | ||||
$command = 'log --template %s --rev %s'; | |||||
$template = '{rev}\1{node}\1{date}\1{parents}\2'; | |||||
if ($start_commit !== null) { | |||||
$revset = hgsprintf('reverse(ancestors(%s))', $start_commit); | |||||
} else { | |||||
$revset = 'reverse(all())'; | |||||
} | |||||
$future = $repository->getLocalCommandFuture( | $future = $repository->getLocalCommandFuture( | ||||
'log --template %s --rev %s', | $command, | ||||
'{rev}\1{node}\1{date}\1{parents}\2', | $template, | ||||
hgsprintf('reverse(ancestors(%s))', $commit)); | $revset); | ||||
$this->iterator = new LinesOfALargeExecFuture($future); | $this->iterator = new LinesOfALargeExecFuture($future); | ||||
$this->iterator->setDelimiter("\2"); | $this->iterator->setDelimiter("\2"); | ||||
$this->iterator->rewind(); | $this->iterator->rewind(); | ||||
} | } | ||||
public function getParents($commit) { | public function getParents($commit) { | ||||
if (!isset($this->parents[$commit])) { | if (!isset($this->parents[$commit])) { | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |