本文整理汇总了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;
}