本文整理匯總了PHP中PhabricatorRepositoryCommit::getMonogram方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorRepositoryCommit::getMonogram方法的具體用法?PHP PhabricatorRepositoryCommit::getMonogram怎麽用?PHP PhabricatorRepositoryCommit::getMonogram使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorRepositoryCommit
的用法示例。
在下文中一共展示了PhabricatorRepositoryCommit::getMonogram方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: newDiffFromCommit
public function newDiffFromCommit(PhabricatorRepositoryCommit $commit)
{
$viewer = $this->getViewer();
$repository = $commit->getRepository();
$identifier = $commit->getCommitIdentifier();
$monogram = $commit->getMonogram();
$drequest = DiffusionRequest::newFromDictionary(array('user' => $viewer, 'repository' => $repository));
$raw_diff = DiffusionQuery::callConduitWithDiffusionRequest($viewer, $drequest, 'diffusion.rawdiffquery', array('commit' => $identifier));
// TODO: Support adds, deletes and moves under SVN.
if (strlen($raw_diff)) {
$changes = id(new ArcanistDiffParser())->parseDiff($raw_diff);
} else {
// This is an empty diff, maybe made with `git commit --allow-empty`.
// NOTE: These diffs have the same tree hash as their ancestors, so
// they may attach to revisions in an unexpected way. Just let this
// happen for now, although it might make sense to special case it
// eventually.
$changes = array();
}
$diff = DifferentialDiff::newFromRawChanges($viewer, $changes)->setRepositoryPHID($repository->getPHID())->setCreationMethod('commit')->setSourceControlSystem($repository->getVersionControlSystem())->setLintStatus(DifferentialLintStatus::LINT_AUTO_SKIP)->setUnitStatus(DifferentialUnitStatus::UNIT_AUTO_SKIP)->setDateCreated($commit->getEpoch())->setDescription($monogram);
$author_phid = $this->getAuthorPHID();
if ($author_phid !== null) {
$diff->setAuthorPHID($author_phid);
}
$parents = DiffusionQuery::callConduitWithDiffusionRequest($viewer, $drequest, 'diffusion.commitparentsquery', array('commit' => $identifier));
if ($parents) {
$diff->setSourceControlBaseRevision(head($parents));
}
// TODO: Attach binary files.
return $diff->save();
}
示例2: parseCommit
protected function parseCommit(PhabricatorRepository $repository, PhabricatorRepositoryCommit $commit)
{
$this->log("%s\n", pht('Parsing "%s"...', $commit->getMonogram()));
if ($this->isBadCommit($commit)) {
$this->log(pht('This commit is marked bad!'));
return;
}
$results = $this->parseCommitChanges($repository, $commit);
if ($results) {
$this->writeCommitChanges($repository, $commit, $results);
}
$this->finishParse();
}
示例3: parseCommit
protected function parseCommit(PhabricatorRepository $repository, PhabricatorRepositoryCommit $commit)
{
$this->log("%s\n", pht('Parsing "%s"...', $commit->getMonogram()));
if ($this->isBadCommit($commit)) {
$this->log(pht('This commit is marked bad!'));
return;
}
if (!$this->shouldSkipImportStep()) {
$results = $this->parseCommitChanges($repository, $commit);
if ($results) {
$this->writeCommitChanges($repository, $commit, $results);
}
$commit->writeImportStatusFlag($this->getImportStepFlag());
PhabricatorSearchWorker::queueDocumentForIndexing($commit->getPHID());
}
$this->finishParse();
}
示例4: isBadCommit
protected function isBadCommit(PhabricatorRepositoryCommit $commit)
{
$repository = new PhabricatorRepository();
$bad_commit = queryfx_one($repository->establishConnection('w'), 'SELECT * FROM %T WHERE fullCommitName = %s', PhabricatorRepository::TABLE_BADCOMMIT, $commit->getMonogram());
return (bool) $bad_commit;
}
示例5: getMailThreading
public static function getMailThreading(PhabricatorRepository $repository, PhabricatorRepositoryCommit $commit)
{
return array('diffusion-audit-' . $commit->getPHID(), pht('Commit %s', $commit->getMonogram()));
}