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