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


PHP DifferentialRevision::getMonogram方法代码示例

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


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

示例1: updateRevisionWithCommit

 public function updateRevisionWithCommit(DifferentialRevision $revision, PhabricatorRepositoryCommit $commit, array $more_xactions, PhabricatorContentSource $content_source)
 {
     $viewer = $this->getViewer();
     $result_data = array();
     $new_diff = $this->newDiffFromCommit($commit);
     $old_diff = $revision->getActiveDiff();
     $changed_uri = null;
     if ($old_diff) {
         $old_diff = id(new DifferentialDiffQuery())->setViewer($viewer)->withIDs(array($old_diff->getID()))->needChangesets(true)->executeOne();
         if ($old_diff) {
             $has_changed = $this->isDiffChangedBeforeCommit($commit, $old_diff, $new_diff);
             if ($has_changed) {
                 $result_data['vsDiff'] = $old_diff->getID();
                 $revision_monogram = $revision->getMonogram();
                 $old_id = $old_diff->getID();
                 $new_id = $new_diff->getID();
                 $changed_uri = "/{$revision_monogram}?vs={$old_id}&id={$new_id}#toc";
                 $changed_uri = PhabricatorEnv::getProductionURI($changed_uri);
             }
         }
     }
     $xactions = array();
     $xactions[] = id(new DifferentialTransaction())->setTransactionType(DifferentialTransaction::TYPE_UPDATE)->setIgnoreOnNoEffect(true)->setNewValue($new_diff->getPHID())->setMetadataValue('isCommitUpdate', true);
     foreach ($more_xactions as $more_xaction) {
         $xactions[] = $more_xaction;
     }
     $editor = id(new DifferentialTransactionEditor())->setActor($viewer)->setContinueOnMissingFields(true)->setContentSource($content_source)->setChangedPriorToCommitURI($changed_uri)->setIsCloseByCommit(true);
     $author_phid = $this->getAuthorPHID();
     if ($author_phid !== null) {
         $editor->setActingAsPHID($author_phid);
     }
     try {
         $editor->applyTransactions($revision, $xactions);
     } catch (PhabricatorApplicationTransactionNoEffectException $ex) {
         // NOTE: We've marked transactions other than the CLOSE transaction
         // as ignored when they don't have an effect, so this means that we
         // lost a race to close the revision. That's perfectly fine, we can
         // just continue normally.
     }
     return $result_data;
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:41,代码来源:DifferentialDiffExtractionEngine.php


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