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


PHP DifferentialDiff::getSourceControlBaseRevision方法代码示例

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


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

示例1: createDiffDict

 public static function createDiffDict(DifferentialDiff $diff)
 {
     $dict = array('id' => $diff->getID(), 'parent' => $diff->getParentRevisionID(), 'sourceControlBaseRevision' => $diff->getSourceControlBaseRevision(), 'sourceControlPath' => $diff->getSourceControlPath(), 'changes' => array());
     foreach ($diff->getChangesets() as $changeset) {
         $hunks = array();
         foreach ($changeset->getHunks() as $hunk) {
             $hunks[] = array('oldOffset' => $hunk->getOldOffset(), 'newOffset' => $hunk->getNewOffset(), 'oldLength' => $hunk->getOldLen(), 'newLength' => $hunk->getNewLen(), 'addLines' => null, 'delLines' => null, 'isMissingOldNewline' => null, 'isMissingNewNewline' => null, 'corpus' => $hunk->getChanges());
         }
         $change = array('metadata' => $changeset->getMetadata(), 'oldPath' => $changeset->getOldFile(), 'currentPath' => $changeset->getFileName(), 'awayPaths' => $changeset->getAwayPaths(), 'oldProperties' => $changeset->getOldProperties(), 'newProperties' => $changeset->getNewProperties(), 'type' => $changeset->getChangeType(), 'fileType' => $changeset->getFileType(), 'commitHash' => null, 'hunks' => $hunks);
         $dict['changes'][] = $change;
     }
     return $dict;
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:13,代码来源:ConduitAPI_differential_getdiff_Method.php

示例2: renderBaseRevision

 private function renderBaseRevision(DifferentialDiff $diff)
 {
     switch ($diff->getSourceControlSystem()) {
         case 'git':
             $base = $diff->getSourceControlBaseRevision();
             if (strpos($base, '@') === false) {
                 $label = substr($base, 0, 7);
             } else {
                 // The diff is from git-svn
                 $base = explode('@', $base);
                 $base = last($base);
                 $label = $base;
             }
             break;
         case 'svn':
             $base = $diff->getSourceControlBaseRevision();
             $base = explode('@', $base);
             $base = last($base);
             $label = $base;
             break;
         default:
             $label = null;
             break;
     }
     $link = null;
     if ($label) {
         $commit_for_link = idx($this->commitsForLinks, $diff->getSourceControlBaseRevision());
         if ($commit_for_link) {
             $link = phutil_tag('a', array('href' => $commit_for_link->getURI()), $label);
         } else {
             $link = $label;
         }
     }
     return $link;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:35,代码来源:DifferentialRevisionUpdateHistoryView.php

示例3: renderBaseRevision

 private function renderBaseRevision(DifferentialDiff $diff)
 {
     switch ($diff->getSourceControlSystem()) {
         case 'git':
             $base = $diff->getSourceControlBaseRevision();
             if (strpos($base, '@') === false) {
                 return substr($base, 0, 7);
             } else {
                 // The diff is from git-svn
                 $base = explode('@', $base);
                 $base = last($base);
                 return $base;
             }
         case 'svn':
             $base = $diff->getSourceControlBaseRevision();
             $base = explode('@', $base);
             $base = last($base);
             return $base;
         default:
             return null;
     }
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:22,代码来源:DifferentialRevisionUpdateHistoryView.php

示例4: renderBaseRevision

 private function renderBaseRevision(DifferentialDiff $diff)
 {
     switch ($diff->getSourceControlSystem()) {
         case 'git':
             return substr($diff->getSourceControlBaseRevision(), 0, 7);
         case 'svn':
             $base = $diff->getSourceControlBaseRevision();
             $base = explode('@', $base);
             $base = end($base);
             return $base;
         default:
             return null;
     }
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:14,代码来源:DifferentialRevisionUpdateHistoryView.php


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