本文整理匯總了PHP中PhabricatorRepositoryCommit::makeEphemeral方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorRepositoryCommit::makeEphemeral方法的具體用法?PHP PhabricatorRepositoryCommit::makeEphemeral怎麽用?PHP PhabricatorRepositoryCommit::makeEphemeral使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorRepositoryCommit
的用法示例。
在下文中一共展示了PhabricatorRepositoryCommit::makeEphemeral方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadCommitsByIdentifiers
protected final function loadCommitsByIdentifiers(array $identifiers)
{
if (!$identifiers) {
return array();
}
$commits = array();
$commit_data = array();
$drequest = $this->getRequest();
$repository = $drequest->getRepository();
$commits = id(new PhabricatorRepositoryCommit())->loadAllWhere('repositoryID = %d AND commitIdentifier IN (%Ls)', $repository->getID(), $identifiers);
$commits = mpull($commits, null, 'getCommitIdentifier');
// Build empty commit objects for every commit, so we can show unparsed
// commits in history views as "unparsed" instead of not showing them. This
// makes the process of importing and parsing commits much clearer to the
// user.
$commit_list = array();
foreach ($identifiers as $identifier) {
$commit_obj = idx($commits, $identifier);
if (!$commit_obj) {
$commit_obj = new PhabricatorRepositoryCommit();
$commit_obj->setRepositoryID($repository->getID());
$commit_obj->setCommitIdentifier($identifier);
$commit_obj->setIsUnparsed(true);
$commit_obj->makeEphemeral();
}
$commit_list[$identifier] = $commit_obj;
}
$commits = $commit_list;
$commit_ids = array_filter(mpull($commits, 'getID'));
if ($commit_ids) {
$commit_data = id(new PhabricatorRepositoryCommitData())->loadAllWhere('commitID in (%Ld)', $commit_ids);
$commit_data = mpull($commit_data, null, 'getCommitID');
}
foreach ($commits as $commit) {
if (!$commit->getID()) {
continue;
}
if (idx($commit_data, $commit->getID())) {
$commit->attachCommitData($commit_data[$commit->getID()]);
}
}
return $commits;
}