当前位置: 首页>>代码示例>>PHP>>正文


PHP DifferentialRevision::setLineCount方法代码示例

本文整理汇总了PHP中DifferentialRevision::setLineCount方法的典型用法代码示例。如果您正苦于以下问题:PHP DifferentialRevision::setLineCount方法的具体用法?PHP DifferentialRevision::setLineCount怎么用?PHP DifferentialRevision::setLineCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DifferentialRevision的用法示例。


在下文中一共展示了DifferentialRevision::setLineCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: attachToRevision

 private function attachToRevision(DifferentialRevision $revision, $actor_phid)
 {
     $drequest = DiffusionRequest::newFromDictionary(array('repository' => $this->repository, 'commit' => $this->commit->getCommitIdentifier()));
     $raw_diff = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest)->loadRawDiff();
     $changes = id(new ArcanistDiffParser())->parseDiff($raw_diff);
     $diff = DifferentialDiff::newFromRawChanges($changes)->setRevisionID($revision->getID())->setAuthorPHID($actor_phid)->setCreationMethod('commit')->setSourceControlSystem($this->repository->getVersionControlSystem())->setLintStatus(DifferentialLintStatus::LINT_SKIP)->setUnitStatus(DifferentialUnitStatus::UNIT_SKIP)->setDateCreated($this->commit->getEpoch())->setDescription('Commit r' . $this->repository->getCallsign() . $this->commit->getCommitIdentifier());
     // TODO: This is not correct in SVN where one repository can have multiple
     // Arcanist projects.
     $arcanist_project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere('repositoryID = %d LIMIT 1', $this->repository->getID());
     if ($arcanist_project) {
         $diff->setArcanistProjectPHID($arcanist_project->getPHID());
     }
     $parents = DiffusionCommitParentsQuery::newFromDiffusionRequest($drequest)->loadParents();
     if ($parents) {
         $diff->setSourceControlBaseRevision(head_key($parents));
     }
     // TODO: Attach binary files.
     $revision->setLineCount($diff->getLineCount());
     return $diff->save();
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:20,代码来源:PhabricatorRepositoryCommitMessageParserWorker.php

示例2: initializeNewRevision

 private function initializeNewRevision(DifferentialRevision $revision)
 {
     // These fields aren't nullable; set them to sensible defaults if they
     // haven't been configured. We're just doing this so we can generate an
     // ID for the revision if we don't have one already.
     $revision->setLineCount(0);
     if ($revision->getStatus() === null) {
         $revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
     }
     if ($revision->getTitle() === null) {
         $revision->setTitle('Untitled Revision');
     }
     if ($revision->getAuthorPHID() === null) {
         $revision->setAuthorPHID($this->getActorPHID());
     }
     if ($revision->getSummary() === null) {
         $revision->setSummary('');
     }
     if ($revision->getTestPlan() === null) {
         $revision->setTestPlan('');
     }
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:22,代码来源:DifferentialRevisionEditor.php


注:本文中的DifferentialRevision::setLineCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。